Package com.jme3.system.android
Class OGLESContext
- java.lang.Object
-
- com.jme3.system.android.OGLESContext
-
- All Implemented Interfaces:
android.opengl.GLSurfaceView.Renderer,com.jme3.input.SoftTextDialogInput,com.jme3.system.JmeContext
public class OGLESContext extends java.lang.Object implements com.jme3.system.JmeContext, android.opengl.GLSurfaceView.Renderer, com.jme3.input.SoftTextDialogInput
-
-
Field Summary
Fields Modifier and Type Field Description protected AndroidInputHandlerandroidInputprotected booleanautoFlushprotected java.util.concurrent.atomic.AtomicBooleancreatedprotected longlastUpdateTimeprotected com.jme3.system.SystemListenerlistenerprotected longminFrameDurationprotected java.util.concurrent.atomic.AtomicBooleanneedCloseprotected java.util.concurrent.atomic.AtomicBooleanrenderableprotected com.jme3.renderer.opengl.GLRendererrendererprotected com.jme3.system.AppSettingssettingsprotected com.jme3.system.Timertimer
-
Constructor Summary
Constructors Constructor Description OGLESContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreate()voidcreate(boolean waitFor)android.opengl.GLSurfaceViewcreateView(android.content.Context context)createViewcreates the GLSurfaceView that the renderer will draw to.protected voiddeinitInThread()De-initialize in the OpenGL thread.voiddestroy()voiddestroy(boolean waitFor)com.jme3.input.JoyInputgetJoyInput()com.jme3.input.KeyInputgetKeyInput()com.jme3.input.MouseInputgetMouseInput()com.jme3.opencl.ContextgetOpenCLContext()com.jme3.renderer.RenderergetRenderer()com.jme3.system.AppSettingsgetSettings()com.jme3.system.TimergetTimer()com.jme3.input.TouchInputgetTouchInput()com.jme3.system.JmeContext.TypegetType()protected voidinitInThread()booleanisCreated()booleanisRenderable()voidonDrawFrame(javax.microedition.khronos.opengles.GL10 gl)voidonSurfaceChanged(javax.microedition.khronos.opengles.GL10 gl, int width, int height)voidonSurfaceCreated(javax.microedition.khronos.opengles.GL10 gl, javax.microedition.khronos.egl.EGLConfig cfg)voidrequestDialog(int id, java.lang.String title, java.lang.String initialValue, com.jme3.input.controls.SoftTextDialogInputListener listener)voidrestart()voidsetAutoFlushFrames(boolean enabled)voidsetSettings(com.jme3.system.AppSettings settings)voidsetSystemListener(com.jme3.system.SystemListener listener)voidsetTitle(java.lang.String title)protected voidwaitFor(boolean createdVal)
-
-
-
Field Detail
-
created
protected final java.util.concurrent.atomic.AtomicBoolean created
-
renderable
protected final java.util.concurrent.atomic.AtomicBoolean renderable
-
needClose
protected final java.util.concurrent.atomic.AtomicBoolean needClose
-
settings
protected com.jme3.system.AppSettings settings
-
renderer
protected com.jme3.renderer.opengl.GLRenderer renderer
-
timer
protected com.jme3.system.Timer timer
-
listener
protected com.jme3.system.SystemListener listener
-
autoFlush
protected boolean autoFlush
-
androidInput
protected AndroidInputHandler androidInput
-
minFrameDuration
protected long minFrameDuration
-
lastUpdateTime
protected long lastUpdateTime
-
-
Method Detail
-
getType
public com.jme3.system.JmeContext.Type getType()
- Specified by:
getTypein interfacecom.jme3.system.JmeContext
-
createView
public android.opengl.GLSurfaceView createView(android.content.Context context)
createViewcreates 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.
- Parameters:
context- (not null)- Returns:
- GLSurfaceView The newly created view
-
onSurfaceCreated
public void onSurfaceCreated(javax.microedition.khronos.opengles.GL10 gl, javax.microedition.khronos.egl.EGLConfig cfg)- Specified by:
onSurfaceCreatedin interfaceandroid.opengl.GLSurfaceView.Renderer
-
initInThread
protected void initInThread()
-
deinitInThread
protected void deinitInThread()
De-initialize in the OpenGL thread.
-
setSettings
public void setSettings(com.jme3.system.AppSettings settings)
- Specified by:
setSettingsin interfacecom.jme3.system.JmeContext
-
setSystemListener
public void setSystemListener(com.jme3.system.SystemListener listener)
- Specified by:
setSystemListenerin interfacecom.jme3.system.JmeContext
-
getSettings
public com.jme3.system.AppSettings getSettings()
- Specified by:
getSettingsin interfacecom.jme3.system.JmeContext
-
getRenderer
public com.jme3.renderer.Renderer getRenderer()
- Specified by:
getRendererin interfacecom.jme3.system.JmeContext
-
getMouseInput
public com.jme3.input.MouseInput getMouseInput()
- Specified by:
getMouseInputin interfacecom.jme3.system.JmeContext
-
getKeyInput
public com.jme3.input.KeyInput getKeyInput()
- Specified by:
getKeyInputin interfacecom.jme3.system.JmeContext
-
getJoyInput
public com.jme3.input.JoyInput getJoyInput()
- Specified by:
getJoyInputin interfacecom.jme3.system.JmeContext
-
getTouchInput
public com.jme3.input.TouchInput getTouchInput()
- Specified by:
getTouchInputin interfacecom.jme3.system.JmeContext
-
getTimer
public com.jme3.system.Timer getTimer()
- Specified by:
getTimerin interfacecom.jme3.system.JmeContext
-
setTitle
public void setTitle(java.lang.String title)
- Specified by:
setTitlein interfacecom.jme3.system.JmeContext
-
isCreated
public boolean isCreated()
- Specified by:
isCreatedin interfacecom.jme3.system.JmeContext
-
setAutoFlushFrames
public void setAutoFlushFrames(boolean enabled)
- Specified by:
setAutoFlushFramesin interfacecom.jme3.system.JmeContext
-
onSurfaceChanged
public void onSurfaceChanged(javax.microedition.khronos.opengles.GL10 gl, int width, int height)- Specified by:
onSurfaceChangedin interfaceandroid.opengl.GLSurfaceView.Renderer
-
onDrawFrame
public void onDrawFrame(javax.microedition.khronos.opengles.GL10 gl)
- Specified by:
onDrawFramein interfaceandroid.opengl.GLSurfaceView.Renderer
-
isRenderable
public boolean isRenderable()
- Specified by:
isRenderablein interfacecom.jme3.system.JmeContext
-
create
public void create(boolean waitFor)
- Specified by:
createin interfacecom.jme3.system.JmeContext
-
create
public void create()
-
restart
public void restart()
- Specified by:
restartin interfacecom.jme3.system.JmeContext
-
destroy
public void destroy(boolean waitFor)
- Specified by:
destroyin interfacecom.jme3.system.JmeContext
-
destroy
public void destroy()
-
waitFor
protected void waitFor(boolean createdVal)
-
requestDialog
public void requestDialog(int id, java.lang.String title, java.lang.String initialValue, com.jme3.input.controls.SoftTextDialogInputListener listener)- Specified by:
requestDialogin interfacecom.jme3.input.SoftTextDialogInput
-
getOpenCLContext
public com.jme3.opencl.Context getOpenCLContext()
- Specified by:
getOpenCLContextin interfacecom.jme3.system.JmeContext
-
-