public class OGLESContext extends java.lang.Object implements JmeContext, android.opengl.GLSurfaceView.Renderer, SoftTextDialogInput
JmeContext.Type| Modifier and Type | Field and Description |
|---|---|
protected AndroidInputHandler |
androidInput |
protected boolean |
autoFlush |
protected java.util.concurrent.atomic.AtomicBoolean |
created |
protected long |
lastUpdateTime |
protected SystemListener |
listener |
protected long |
minFrameDuration |
protected java.util.concurrent.atomic.AtomicBoolean |
needClose |
protected java.util.concurrent.atomic.AtomicBoolean |
renderable |
protected GLRenderer |
renderer |
protected AppSettings |
settings |
protected Timer |
timer |
NUMERIC_ENTRY_DIALOG, NUMERIC_KEYPAD_DIALOG, TEXT_ENTRY_DIALOG| Constructor and Description |
|---|
OGLESContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
create() |
void |
create(boolean waitFor)
Creates the context and makes it active.
|
android.opengl.GLSurfaceView |
createView(android.content.Context context)
createView creates the GLSurfaceView that the renderer will
draw to. |
protected void |
deinitInThread()
De-initialize in the OpenGL thread.
|
void |
destroy() |
void |
destroy(boolean waitFor)
Destroys the context completely, making it inactive.
|
JoyInput |
getJoyInput() |
KeyInput |
getKeyInput() |
MouseInput |
getMouseInput() |
Context |
getOpenCLContext() |
Renderer |
getRenderer() |
AppSettings |
getSettings() |
Timer |
getTimer() |
TouchInput |
getTouchInput() |
JmeContext.Type |
getType() |
protected void |
initInThread() |
boolean |
isCreated() |
boolean |
isRenderable() |
void |
onDrawFrame(javax.microedition.khronos.opengles.GL10 gl) |
void |
onSurfaceChanged(javax.microedition.khronos.opengles.GL10 gl,
int width,
int height) |
void |
onSurfaceCreated(javax.microedition.khronos.opengles.GL10 gl,
javax.microedition.khronos.egl.EGLConfig cfg) |
void |
requestDialog(int id,
java.lang.String title,
java.lang.String initialValue,
SoftTextDialogInputListener listener) |
void |
restart()
Destroys and then re-creates the context.
|
void |
setAutoFlushFrames(boolean enabled) |
void |
setSettings(AppSettings settings) |
void |
setSystemListener(SystemListener listener)
Sets the listener that will receive events relating to context
creation, update, and destroy.
|
void |
setTitle(java.lang.String title)
Sets the title of the display (if available).
|
protected void |
waitFor(boolean createdVal) |
protected final java.util.concurrent.atomic.AtomicBoolean created
protected final java.util.concurrent.atomic.AtomicBoolean renderable
protected final java.util.concurrent.atomic.AtomicBoolean needClose
protected AppSettings settings
protected GLRenderer renderer
protected Timer timer
protected SystemListener listener
protected boolean autoFlush
protected AndroidInputHandler androidInput
protected long minFrameDuration
protected long lastUpdateTime
public JmeContext.Type getType()
getType in interface JmeContextpublic android.opengl.GLSurfaceView createView(android.content.Context context)
createView creates the GLSurfaceView that the renderer will
draw to. The result GLSurfaceView will receive input events and forward them to the Application. Any rendering will be done into the GLSurfaceView. Only one GLSurfaceView can be created at this time. The given configType specifies how to determine the display configuration.
context - (not null)public void onSurfaceCreated(javax.microedition.khronos.opengles.GL10 gl,
javax.microedition.khronos.egl.EGLConfig cfg)
onSurfaceCreated in interface android.opengl.GLSurfaceView.Rendererprotected void initInThread()
protected void deinitInThread()
public void setSettings(AppSettings settings)
setSettings in interface JmeContextsettings - the display settings to use for the created context. If
the context has already been created, then restart() must be called
for the changes to be applied.public void setSystemListener(SystemListener listener)
JmeContextsetSystemListener in interface JmeContextlistener - the desired listenerpublic AppSettings getSettings()
getSettings in interface JmeContextpublic Renderer getRenderer()
getRenderer in interface JmeContextpublic MouseInput getMouseInput()
getMouseInput in interface JmeContextpublic KeyInput getKeyInput()
getKeyInput in interface JmeContextpublic JoyInput getJoyInput()
getJoyInput in interface JmeContextpublic TouchInput getTouchInput()
getTouchInput in interface JmeContextpublic Timer getTimer()
getTimer in interface JmeContextpublic void setTitle(java.lang.String title)
JmeContextsetTitle in interface JmeContexttitle - The new title of the display.public boolean isCreated()
isCreated in interface JmeContextpublic void setAutoFlushFrames(boolean enabled)
setAutoFlushFrames in interface JmeContextenabled - If enabled, the context will automatically flush
frames to the video card (swap buffers) after an update cycle.public void onSurfaceChanged(javax.microedition.khronos.opengles.GL10 gl,
int width,
int height)
onSurfaceChanged in interface android.opengl.GLSurfaceView.Rendererpublic void onDrawFrame(javax.microedition.khronos.opengles.GL10 gl)
onDrawFrame in interface android.opengl.GLSurfaceView.Rendererpublic boolean isRenderable()
isRenderable in interface JmeContextRenderer are called
while this is false, then the result is undefined.public void create(boolean waitFor)
JmeContextcreate in interface JmeContextwaitFor - If true, will wait until context has initialized.public void create()
public void restart()
JmeContextrestart in interface JmeContextpublic void destroy(boolean waitFor)
JmeContextdestroy in interface JmeContextwaitFor - If true, will wait until the context is destroyed fully.public void destroy()
protected void waitFor(boolean createdVal)
public void requestDialog(int id,
java.lang.String title,
java.lang.String initialValue,
SoftTextDialogInputListener listener)
requestDialog in interface SoftTextDialogInputpublic Context getOpenCLContext()
getOpenCLContext in interface JmeContext