-
-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MLNCustomStyleLayer + Metal example (#2041)
- Loading branch information
1 parent
17e6e7c
commit 1d00e5b
Showing
56 changed files
with
513 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ | |
|
||
namespace mbgl { | ||
|
||
class PaintParameters; | ||
|
||
namespace gfx { | ||
|
||
class Drawable; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,9 @@ | |
#include <mbgl/renderer/layer_group.hpp> | ||
|
||
namespace mbgl { | ||
|
||
class PaintParameters; | ||
|
||
namespace gl { | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,9 @@ | |
#include <mbgl/renderer/layer_group.hpp> | ||
|
||
namespace mbgl { | ||
|
||
class PaintParameters; | ||
|
||
namespace mtl { | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,9 @@ | |
#include <optional> | ||
|
||
namespace mbgl { | ||
|
||
class PaintParameters; | ||
|
||
namespace mtl { | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
include/mbgl/style/layers/custom_layer_render_parameters.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
|
||
#include <memory> | ||
#include <array> | ||
|
||
namespace mbgl { | ||
|
||
class PaintParameters; | ||
|
||
namespace style { | ||
|
||
/** | ||
* Parameters that define the current camera position for a | ||
* `CustomLayerHost::render()` function. | ||
*/ | ||
struct CustomLayerRenderParameters { | ||
double width; | ||
double height; | ||
double latitude; | ||
double longitude; | ||
double zoom; | ||
double bearing; | ||
double pitch; | ||
double fieldOfView; | ||
std::array<double, 16> projectionMatrix; | ||
|
||
CustomLayerRenderParameters(const PaintParameters&); | ||
}; | ||
|
||
} // namespace style | ||
} // namespace mbgl |
30 changes: 30 additions & 0 deletions
30
include/mbgl/style/layers/mtl/custom_layer_render_parameters.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
|
||
#include <mbgl/style/layers/custom_layer_render_parameters.hpp> | ||
|
||
#include <mbgl/mtl/mtl_fwd.hpp> | ||
#include <Foundation/Foundation.hpp> | ||
#include <Metal/Metal.hpp> | ||
|
||
#include <memory> | ||
|
||
namespace mbgl { | ||
|
||
class PaintParameters; | ||
|
||
namespace style { | ||
|
||
namespace mtl { | ||
|
||
/** | ||
* Metal subclass of CustomLayerRenderParameters | ||
*/ | ||
struct CustomLayerRenderParameters : mbgl::style::CustomLayerRenderParameters { | ||
mbgl::mtl::MTLRenderCommandEncoderPtr encoder; | ||
|
||
CustomLayerRenderParameters(const PaintParameters&); | ||
}; | ||
|
||
} // namespace mtl | ||
} // namespace style | ||
} // namespace mbgl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#import "Mapbox.h" | ||
|
||
@interface CustomStyleLayerExample : MLNCustomStyleLayer | ||
|
||
@end |
Oops, something went wrong.