Package com.jme3.view.surfaceview
package com.jme3.view.surfaceview
Holds
JmeSurfaceView
with some lifecycle interfaces.
This package provides the following :
JmeSurfaceView
: An OpenGL android view wrapper for rendering, updating and destroying a jMonkeyEngine game.
OnRendererStarted
: Provides a method to be invoked when a jMonkeyEngine application starts.
OnLayoutDrawn
: Provides a method to be invoked when the GLSurfaceView draws the content, before OnRendererCompleted.
OnRendererCompleted
: Provides a method to be invoked on the first update of the game.
OnExceptionThrown
: Provides a method to be invoked when an exception is thrown.
-
ClassDescriptionA RelativeLayout class holder that wraps a
GLSurfaceView
as a renderer UI component and usesOGLESContext
as a renderer context to render a jme game on an android view for custom xml designs. The main idea ofJmeSurfaceView
class is to start a jMonkeyEngine application in aSystemListener
context on a GL_ES thread, then the game is rendered and updated through aGLSurfaceView
component with a delay of user's choice using aHandler
, during the delay, the user has the ability to handle a couple of actions asynchronously as displaying a progress bar on a SplashScreen or an image or even play a preface game music of choice.Determines whether the app context would be destructed with the holder activity context in case ofJmeSurfaceView.DestructionPolicy.DESTROY_WHEN_FINISH
or be spared for a second use in case ofJmeSurfaceView.DestructionPolicy.KEEP_WHEN_FINISH
.Used as a static memory to protect the game context from destruction by Activity#onDestroy().An interface designed to listen for exceptions and fire an event when an exception is thrown.An interface used for dispatching an event when the layout holding theGLSurfaceView
is drawn, the event is dispatched on the user activity context thread.An interface used for invoking an event when the user delay finishes, on the first update of the game.An interface used for invoking an event when the application is started explicitly fromJmeSurfaceView.startRenderer(int)
.