org.rajawali3d.wear / WatchRenderer

WatchRenderer

abstract class WatchRenderer : Renderer

Author
Ian Thomas (toxicbakery@gmail.com)

Author
Jared Woolston (jwoolston@tenkiv.com)

Constructors

<init>

WatchRenderer(context: Context!)

Inherited Properties

AVAILABLE_CORES

static val AVAILABLE_CORES: Int

mContext

var mContext: Context!

mCurrentViewportHeight

var mCurrentViewportHeight: Int

mCurrentViewportWidth

var mCurrentViewportWidth: Int

mDefaultViewportHeight

var mDefaultViewportHeight: Int

mDefaultViewportWidth

var mDefaultViewportWidth: Int

mEnableDepthBuffer

var mEnableDepthBuffer: Boolean

mFogEnabled

static var mFogEnabled: Boolean

mFPSUpdateListener

var mFPSUpdateListener: OnFPSUpdateListener!

mFrameCount

var mFrameCount: Int

mFrameRate

var mFrameRate: Double

mGLES_Major_Version

var mGLES_Major_Version: Int

mGLES_Minor_Version

var mGLES_Minor_Version: Int

mLastMeasuredFPS

var mLastMeasuredFPS: Double

mLoaderExecutor

val mLoaderExecutor: Executor!

mMaterialManager

var mMaterialManager: MaterialManager!

mOverrideViewportHeight

var mOverrideViewportHeight: Int

mOverrideViewportWidth

var mOverrideViewportWidth: Int

mRenderTargets

val mRenderTargets: MutableList<RenderTarget!>!

mSceneInitialized

var mSceneInitialized: Boolean

mScenes

val mScenes: MutableList<Scene!>!

mSurface

var mSurface: ISurface!

mTextureManager

var mTextureManager: TextureManager!

mTimer

var mTimer: ScheduledExecutorService!

sMaxLights

static var sMaxLights: Int

Functions

onOffsetsChanged

open fun onOffsetsChanged(xOffset: Float, yOffset: Float, xOffsetStep: Float, yOffsetStep: Float, xPixelOffset: Int, yPixelOffset: Int): Unit

onTouchEvent

open fun onTouchEvent(event: MotionEvent!): Unit

Inherited Functions

addAndSwitchScene

open fun addAndSwitchScene(scene: Scene!): Boolean

Adds a Scene, switching to it immediately

addMaterial

open fun addMaterial(material: Material!): Boolean

addRenderTarget

open fun addRenderTarget(renderTarget: RenderTarget!): Boolean

Add a render target in a thread safe manner.

addScene

open fun addScene(scene: Scene!): Boolean

Adds a Scene to the renderer.

addScenes

open fun addScenes(scenes: MutableCollection<Scene!>!): Boolean

Adds a Collection of scenes to the renderer.

addTexture

open fun addTexture(texture: ATexture!): Boolean

clearOverrideViewportDimensions

open fun clearOverrideViewportDimensions(): Unit

clearScenes

open fun clearScenes(): Unit

Clears all scenes from the renderer. This should be used with extreme care as it will also clear the current scene. If this is done while still rendering, bad things will happen.

getContext

open fun getContext(): Context!

getCurrentCamera

open fun getCurrentCamera(): Camera!

Retrieve the current Camera in use. This is the camera being used by the current scene.

getCurrentScene

open fun getCurrentScene(): Scene!

Fetches the Scene currently being being displayed. Note that the scene is not thread safe so this should be used with extreme caution.

getDefaultViewportHeight

open fun getDefaultViewportHeight(): Int

getDefaultViewportWidth

open fun getDefaultViewportWidth(): Int

getFrameRate

open fun getFrameRate(): Double

getGLMajorVersion

open fun getGLMajorVersion(): Int

Fetches the Open GL ES major version of the EGL surface.

getGLMinorVersion

open fun getGLMinorVersion(): Int

Fetches the Open GL ES minor version of the EGL surface.

getMaxLights

open static fun getMaxLights(): Int

getNewDefaultScene

open fun getNewDefaultScene(): Scene!

Return a new instance of the default initial scene for the Renderer instance. This method is only intended to be called one time by the renderer itself and should not be used elsewhere.

getNumScenes

open fun getNumScenes(): Int

Retrieve the number of Scene associated with the Renderer.

getOverrideViewportHeight

open fun getOverrideViewportHeight(): Int

getOverrideViewportWidth

open fun getOverrideViewportWidth(): Int

getRefreshRate

open fun getRefreshRate(): Double

getRenderTarget

open fun getRenderTarget(): RenderTarget!

getScene

open fun getScene(scene: Int): Scene!

Fetches the specified scene.

getSceneCachingEnabled

open fun getSceneCachingEnabled(): Boolean

getSceneInitialized

open fun getSceneInitialized(): Boolean

getTextureManager

open fun getTextureManager(): TextureManager!

getViewportHeight

open fun getViewportHeight(): Int

getViewportWidth

open fun getViewportWidth(): Int

hasGLContext

open static fun hasGLContext(): Boolean

Indicates whether the OpenGL context is still alive or not.

initializeColorPicker

open fun initializeColorPicker(picker: ObjectColorPicker!): Boolean

initScene

abstract fun initScene(): Unit

Scene construction should happen here, not in onSurfaceCreated()

internalOfferTask

open fun internalOfferTask(task: AFrameTask!): Boolean

loadModel

open fun loadModel(loader: ALoader!, callback: IAsyncLoaderCallback!, tag: Int): ALoader!

Add an ALoader instance to queue parsing for the given resource ID. Use IAsyncLoaderCallback#onModelLoadComplete(ALoader), IAsyncLoaderCallback#onModelLoadFailed(ALoader), and

open fun loadModel(loaderClass: Class<out ALoader!>!, callback: IAsyncLoaderCallback!, resID: Int): ALoader!

Create and add an ALoader instance using reflection to queue parsing of the given resource ID. Use IAsyncLoaderCallback#onModelLoadComplete(ALoader), IAsyncLoaderCallback#onModelLoadFailed(ALoader) to monitor the status of loading. Returns null if the loader fails to instantiate, IAsyncLoaderCallback#onModelLoadFailed(ALoader) will still be called. A tag will be set automatically for the model equal to the resource ID passed.

open fun loadModel(loaderClass: Class<out ALoader!>!, callback: IAsyncLoaderCallback!, resID: Int, tag: Int): ALoader!

Create and add an ALoader instance using reflection to queue parsing of the given resource ID. Use IAsyncLoaderCallback#onModelLoadComplete(ALoader), IAsyncLoaderCallback#onModelLoadFailed(ALoader) to monitor the status of loading. Returns null if the loader fails to instantiate, IAsyncLoaderCallback#onModelLoadFailed(ALoader) will still be called. Use the tag identified to determine which model completed loading when multiple models are loaded.

onPause

open fun onPause(): Unit

onRender

open fun onRender(elapsedRealtime: Long, deltaTime: Double): Unit

Called by #onRenderFrame(GL10) to render the next frame. This is called prior to the current scene's Scene#render(long, double, RenderTarget) method.

onRenderFrame

open fun onRenderFrame(gl: GL10!): Unit

onRenderSurfaceCreated

open fun onRenderSurfaceCreated(config: EGLConfig!, gl: GL10!, width: Int, height: Int): Unit

onRenderSurfaceDestroyed

open fun onRenderSurfaceDestroyed(surface: SurfaceTexture!): Unit

onRenderSurfaceSizeChanged

open fun onRenderSurfaceSizeChanged(gl: GL10!, width: Int, height: Int): Unit

onResume

open fun onResume(): Unit

performFrameTasks

open fun performFrameTasks(): Unit

reloadMaterials

open fun reloadMaterials(): Boolean

reloadRenderTargets

open fun reloadRenderTargets(): Unit

reloadScenes

open fun reloadScenes(): Unit

Called to reload the scenes.

reloadTextures

open fun reloadTextures(): Boolean

removeMaterial

open fun removeMaterial(material: Material!): Boolean

removeRenderTarget

open fun removeRenderTarget(renderTarget: RenderTarget!): Boolean

Remove a render target in a thread safe manner.

removeScene

open fun removeScene(scene: Scene!): Boolean

Removes a Scene from the renderer. If the Scene being removed is the one in current use, the 0 index Scene will be selected on the next frame.

removeTexture

open fun removeTexture(texture: ATexture!): Boolean

render

open fun render(elapsedRealtime: Long, deltaTime: Double): Unit

Called by #onRender(long, double) to render the next frame.

replaceAndSwitchScene

open fun replaceAndSwitchScene(scene: Scene!, location: Int): Boolean

Replaces a Scene at the specified index, switching to the replacement immediately on the next frame. This does not validate the index.

open fun replaceAndSwitchScene(oldScene: Scene!, newScene: Scene!): Boolean

Replaces the specified Scene in the renderer with the new one, switching to it immediately on the next frame. If the scene to replace does not exist, nothing will happen.

replaceScene

open fun replaceScene(scene: Scene!, location: Int): Boolean

Replaces a Scene in the renderer at the specified location in the list. This does not validate the index, so if it is not contained in the list already, an exception will be thrown.

open fun replaceScene(oldScene: Scene!, newScene: Scene!): Boolean

Replaces the specified Scene in the renderer with the new one. If the Scene being replaced is the one in current use, the replacement will be selected on the next frame.

replaceTexture

open fun replaceTexture(texture: ATexture!): Boolean

resetMaterials

open fun resetMaterials(): Boolean

resetTextures

open fun resetTextures(): Boolean

resizeRenderTarget

open fun resizeRenderTarget(renderTargetTexture: RenderTargetTexture): Boolean

screenToCartesian

open fun screenToCartesian(screenX: Float, screenY: Float): PointF!

converts screen coordinates (y increases downwards) to cartesian (y increases upwards) coordinates

setAntiAliasingMode

open fun setAntiAliasingMode(config: ISurface.ANTI_ALIASING_CONFIG!): Unit

setFPSUpdateListener

open fun setFPSUpdateListener(listener: OnFPSUpdateListener!): Unit

setFrameRate

open fun setFrameRate(frameRate: Int): Unit
open fun setFrameRate(frameRate: Double): Unit

setMaxLights

open static fun setMaxLights(maxLights: Int): Unit

setOverrideViewportDimensions

open fun setOverrideViewportDimensions(width: Int, height: Int): Unit

setRenderSurface

open fun setRenderSurface(surface: ISurface!): Unit

setRenderTarget

open fun setRenderTarget(renderTarget: RenderTarget!): Unit

Sets the current render target. Please mind that this CAN ONLY BE called on the main OpenGL render thread. A subsequent call to Renderer#render(long, double) will render the current scene into this render target. Setting the render target to null will switch back to normal rendering.

setSceneCachingEnabled

open fun setSceneCachingEnabled(enabled: Boolean): Unit

setViewPort

open fun setViewPort(width: Int, height: Int): Unit

Sets the GL Viewport used. User code is free to override this method, so long as the viewport is set somewhere (and the projection matrix updated).

startRendering

open fun startRendering(): Unit

stopRendering

open fun stopRendering(): Boolean

Stop rendering the scene.

switchScene

open fun switchScene(scene: Scene!): Unit
open fun switchScene(scene: Int): Unit

Switches the Scene currently being displayed.

switchSceneDirect

open fun switchSceneDirect(nextScene: Scene!): Unit

Switches the Scene currently being displayed. It resets the OpenGL state and sets the projection matrix for the new scene.

unProject

open fun unProject(p: PointF!, distance: Float): Vector3!open fun unProject(x: Double, y: Double, z: Double): Vector3!

Unprojects screen position into world space; 0,0,0 is center of screen