summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLOpenGLStyleLayer.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLOpenGLStyleLayer.mm')
-rw-r--r--platform/darwin/src/MGLOpenGLStyleLayer.mm44
1 files changed, 22 insertions, 22 deletions
diff --git a/platform/darwin/src/MGLOpenGLStyleLayer.mm b/platform/darwin/src/MGLOpenGLStyleLayer.mm
index 5d81eb85ea..da131b6de8 100644
--- a/platform/darwin/src/MGLOpenGLStyleLayer.mm
+++ b/platform/darwin/src/MGLOpenGLStyleLayer.mm
@@ -11,7 +11,7 @@
/**
Runs the preparation handler block contained in the given context, which is
implicitly an instance of `MGLOpenGLStyleLayer`.
-
+
@param context An `MGLOpenGLStyleLayer` instance that was provided as context
when creating an OpenGL style layer.
*/
@@ -23,7 +23,7 @@ void MGLPrepareCustomStyleLayer(void *context) {
/**
Runs the drawing handler block contained in the given context, which is
implicitly an instance of `MGLOpenGLStyleLayer`.
-
+
@param context An `MGLOpenGLStyleLayer` instance that was provided as context
when creating an OpenGL style layer.
*/
@@ -43,7 +43,7 @@ void MGLDrawCustomStyleLayer(void *context, const mbgl::style::CustomLayerRender
/**
Runs the completion handler block contained in the given context, which is
implicitly an instance of `MGLOpenGLStyleLayer`.
-
+
@param context An `MGLOpenGLStyleLayer` instance that was provided as context
when creating an OpenGL style layer.
*/
@@ -55,18 +55,18 @@ void MGLFinishCustomStyleLayer(void *context) {
/**
An `MGLOpenGLStyleLayer` is a style layer that is rendered by OpenGL code that
you provide.
-
+
By default, this class does nothing. You can subclass this class to provide
custom OpenGL drawing code that is run on each frame of the map. Your subclass
should override the `-didMoveToMapView:`, `-willMoveFromMapView:`, and
`-drawInMapView:withContext:` methods.
-
+
You can access an existing OpenGL style layer using the
`-[MGLStyle layerWithIdentifier:]` method if you know its identifier;
otherwise, find it using the `MGLStyle.layers` property. You can also create a
new OpenGL style layer and add it to the style using a method such as
`-[MGLStyle addLayer:]`.
-
+
@warning This API is undocumented and therefore unsupported. It may change at
any time without notice.
*/
@@ -76,7 +76,7 @@ void MGLFinishCustomStyleLayer(void *context) {
/**
The map view whose style currently contains the layer.
-
+
If the layer is not currently part of any map view’s style, this property is
set to `nil`.
*/
@@ -90,11 +90,11 @@ void MGLFinishCustomStyleLayer(void *context) {
/**
Returns an OpenGL style layer object initialized with the given identifier.
-
+
After initializing and configuring the style layer, add it to a map view’s
style using the `-[MGLStyle addLayer:]` or
`-[MGLStyle insertLayer:belowLayer:]` method.
-
+
@param identifier A string that uniquely identifies the layer in the style to
which it is added.
@return An initialized OpenGL style layer.
@@ -154,58 +154,58 @@ void MGLFinishCustomStyleLayer(void *context) {
/**
Called immediately after a layer is added to a map view’s style.
-
+
This method is intended to be overridden in a subclass. You can use this method
to perform any setup work before the layer is used to draw a frame. For
example, you might use this method to compile an OpenGL shader. The default
implementation of this method does nothing.
-
+
Any resource acquired in this method must be released in
`-willMoveFromMapView:`.
-
+
@param mapView The map view to whose style the layer has been added.
*/
- (void)didMoveToMapView:(MGLMapView *)mapView {
-
+
}
/**
Called immediately before a layer is removed from a map view’s style.
-
+
This method is intended to be overridden in a subclass. You can use this method
to perform any teardown work once the layer has drawn its last frame and is
about to be removed from the style. The default implementation of this method
does nothing.
-
+
This method may be called even if `-didMoveToMapView:` has not been called.
-
+
@param mapView The map view from whose style the layer is about to be removed.
*/
- (void)willMoveFromMapView:(MGLMapView *)mapView {
-
+
}
/**
Called each time the layer needs to draw a new frame in a map view.
-
+
This method is intended to be overridden in a subclass. You can use this method
to draw the layer’s content. The default implementation of this method does
nothing.
-
+
Your implementation should not make any assumptions about the OpenGL state,
other than that the current OpenGL context is active. It may make changes to
the OpenGL state. It is not required to reset values such as the depth mask,
stencil mask, or corresponding test flags to their original values.
-
+
Be sure to draw your fragments with a <var>z</var> value of 1 to take advantage
of the opaque fragment culling, in case the style contains any opaque layers
above this layer.
-
+
@param mapView The map view to which the layer draws.
@param context A context structure with information defining the frame to draw.
*/
- (void)drawInMapView:(MGLMapView *)mapView withContext:(MGLStyleLayerDrawingContext)context {
-
+
}
/**