MaplyVariableTarget
Objective-C
@interface MaplyVariableTarget : NSObject
Swift
class MaplyVariableTarget : NSObject
A variable target manages two pass rendering for one type of variable.
Set up the variable target
-
Initialize with the variable type and view controller
Declaration
Objective-C
- (nonnull instancetype) initWithType:(MaplyQuadImageFormat)type viewC:(NSObject<MaplyRenderControllerProtocol> *_Nonnull)viewC;
Swift
init(type: MaplyQuadImageFormat, viewC: NSObjectProtocol & MaplyRenderControllerProtocol)
-
Render target created for this variable target
Declaration
Objective-C
@property (nonatomic, strong, readonly, nonnull) MaplyRenderTarget *renderTarget;
Swift
var renderTarget: MaplyRenderTarget { get }
-
Scale the screen by this amount for the render target
Declaration
Objective-C
- (void)setScale:(double)scale;
Swift
func setScale(_ scale: Double)
-
Color of the rectangle used to draw the render target
Declaration
Objective-C
@property (nonatomic, strong, nonnull) UIColor *color
Swift
var color: UnsafeMutablePointer<Int32> { get set }
-
Draw priority of the rectangle we’ll use to draw the render target to the screen
Declaration
Objective-C
@property (nonatomic) int drawPriority;
Swift
var drawPriority: Int32 { get set }
-
If set (by default), then we clear out the render target every frame
Declaration
Objective-C
@property (nonatomic) _Bool clearEveryFrame;
Swift
var clearEveryFrame: Bool { get set }
-
Shader used to draw the render target to the screen. Leave this empty and we’ll provide our own
Declaration
Objective-C
@property (nonatomic, strong, nullable) MaplyShader *shader;
Swift
var shader: MaplyShader? { get set }
-
By default we’ll build a rectangle to display the target
Declaration
Objective-C
@property (nonatomic) _Bool buildRectangle;
Swift
var buildRectangle: Bool { get set }
-
If set, the rectangle rendered to the screen will read from the z Buffer Useful, when doing depth comparisons
Declaration
Objective-C
@property (nonatomic) _Bool zBuffer;
Swift
var zBuffer: Bool { get set }
-
Rectangle created to show the variable target (if that’s set)
Declaration
Objective-C
@property (nonatomic, readonly, nullable) MaplyComponentObject *rectObj;
Swift
var rectObj: MaplyComponentObject? { get }
-
Size of the texture in pixels for the render target
Declaration
Objective-C
@property (nonatomic, readonly) CGSize texSize;
Swift
var texSize: CGSize { get }
-
The texture we’re rendering to (as part of the render target)
Declaration
Objective-C
@property (nonatomic, strong, readonly, nullable) MaplyTexture *renderTex;
Swift
var renderTex: MaplyTexture? { get }
-
Passing in another variable target will let us assign that target to the rectangle used to render this variable target’s data. This is used if you need the contents of more than one target in a shader.
Declaration
Objective-C
- (void)addVariableTarget:(MaplyVariableTarget *_Nonnull)target;
Swift
func add(_ target: MaplyVariableTarget)
-
Undocumented
Declaration
Objective-C
- (void)setUniformBlock:(NSData *__nonnull)uniBlock buffer:(int)bufferID;
Swift
func setUniformBlock(_ uniBlock: Data, buffer bufferID: Int32)
-
Clear the target for the next frame
Declaration
Objective-C
- (void)clear;
Swift
func clear()
-
Stop rendering to the target and release everything
Declaration
Objective-C
- (void)shutdown;
Swift
func shutdown()