WTExternalOpenGLESRenderingProtocol Protocol Reference

Conforms to NSObject
Declared in WTOpenGLESRenderingMode.h

Overview

WTExternalOpenGLESRenderingProtocol is used to handle information exchange between the Wikitude Native SDK and an external OpenGLES renderer.

– wikitudeNativeSDK:didCreateExternalOpenGLESUpdateHandler: required method

Called during -start:completion: method of the WTWikitudeNativeSDK.

This method is called to pass a Wikitude internal update block to the external renderer.

- (void)wikitudeNativeSDK:(WTWikitudeNativeSDK *)wikitudeNativeSDK didCreateExternalOpenGLESUpdateHandler:(WTWikitudeOpenGLESUpdateHandler)updateHandler

Parameters

wikitudeNativeSDK

The Wikitude Native SDK object that create the update handler.

updateHandler

An ObjC block object that needs to be called every frame in order to update the Wikitude Native SDK internally. If this handler is not called, no computer vision related updates are done.

Declared In

WTOpenGLESRenderingMode.h

– wikitudeNativeSDK:didCreateExternalOpenGLESDrawHandler: required method

Called during -start:completion: method of the WTWikitudeNativeSDK.

This method is called to pass a Wikitude internal draw handler to the external renderer.

- (void)wikitudeNativeSDK:(WTWikitudeNativeSDK *)wikitudeNativeSDK didCreateExternalOpenGLESDrawHandler:(WTWikitudeOpenGLESDrawHandler)drawHandler

Parameters

wikitudeNativeSDK

The Wikitude Native SDK object that created the draw handler.

drawHandler

An ObjC block object that needs to be called every frame in order to draw the camera background.

Declared In

WTOpenGLESRenderingMode.h

– eaglViewSizeForExternalRenderingInWikitudeNativeSDK: required method

Called during -start:completion: method of the WTWikitudeNativeSDK.

This method is called to retrieve the OpenGL ES view size.

- (CGRect)eaglViewSizeForExternalRenderingInWikitudeNativeSDK:(WTWikitudeNativeSDK *)wikitudeNativeSDK

Parameters

wikitudeNativeSDK

The Wikitude Native SDK object that requests the eagl view size.

Return Value

CGRect A rect representing the current OpenGL ES view size. This method needs to return a non zero rect.

Declared In

WTOpenGLESRenderingMode.h

– eaglContextForVideoCameraInWikitudeNativeSDK: required method

Called during -start:completion:

This method is called to retrieve the EAGLContext that should be used to perform camera related OpenGL ES calls.

- (EAGLContext *)eaglContextForVideoCameraInWikitudeNativeSDK:(WTWikitudeNativeSDK *)wikitudeNativeSDK

Parameters

wikitudeNativeSDK

The Wikitude Native SDK object that needs an EAGLContext object.

Return Value

EAGLContext The EAGLContext object that should be used to perform OpenGL ES calls that are camera related. Note that this context can be a shared context from another EAGLContext object.

Declared In

WTOpenGLESRenderingMode.h

– cameraFrameRenderingTargetTextureId

The target texture that should be used to draw the camera frame onto.

- (GLuint)cameraFrameRenderingTargetTextureId

Discussion

The target texture that should be used to draw the camera frame onto.

The texture should have a size equal to the rendering view size (and needs to be updated in case the rendering view size changes).

You should only implement this method if your application has already setup a fixed rendering pipeline and wants the Wikitude SDK to draw the camera frame onto a very specific OpenGL ES 2 or 3 texture.

Declared In

WTOpenGLESRenderingMode.h

– eaglContextForVideoCameraToTextureRenderingInWikitudeNativeSDK:

Called during -start:completion:

This method is called to retrieve the EAGLContext object that should be used to perform offsceen rendering related OpenGL ES calls.

- (EAGLContext *)eaglContextForVideoCameraToTextureRenderingInWikitudeNativeSDK:(WTWikitudeNativeSDK *)wikitudeNativeSDK

Parameters

wikitudeNativeSDK

The Wikitude Native SDK object that needs an EAGLContext object for video to texture rendering.

Return Value

EAGLContext The EAGLContext object that manages the OpenGL ES texture which is used as a render target.

Declared In

WTOpenGLESRenderingMode.h