Package com.jme3.system.android
Class OGLESContext
java.lang.Object
com.jme3.system.android.OGLESContext
- All Implemented Interfaces:
- android.opengl.GLSurfaceView.Renderer,- SoftTextDialogInput,- JmeContext
public class OGLESContext
extends Object
implements JmeContext, android.opengl.GLSurfaceView.Renderer, SoftTextDialogInput
- 
Nested Class SummaryNested classes/interfaces inherited from interface com.jme3.system.JmeContextJmeContext.Type
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected AndroidInputHandlerprotected booleanprotected final AtomicBooleanprotected longprotected SystemListenerprotected longprotected final AtomicBooleanprotected final AtomicBooleanprotected GLRendererprotected AppSettingsprotected TimerFields inherited from interface com.jme3.input.SoftTextDialogInputNUMERIC_ENTRY_DIALOG, NUMERIC_KEYPAD_DIALOG, TEXT_ENTRY_DIALOG
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcreate()voidcreate(boolean waitFor) Creates the context and makes it active.android.opengl.GLSurfaceViewcreateView(android.content.Context context) createViewcreates the GLSurfaceView that the renderer will draw to.protected voidDe-initialize in the OpenGL thread.voiddestroy()voiddestroy(boolean waitFor) Destroys the context completely, making it inactive.This call will return a list of Monitors that glfwGetMonitors() returns and information about the monitor, like width, height, and refresh rate.intReturns the height of the input surface.intReturns the width of the input surface.intUse this to get the positional number of the primary monitor from the glfwGetMonitors() function call.Accesses the listener that receives events related to this context.getTimer()getType()intReturns the screen X coordinate of the left edge of the content area.intReturns the screen Y coordinate of the top edge of the content area.protected voidbooleanbooleanvoidonDrawFrame(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, String title, String initialValue, SoftTextDialogInputListener listener) voidrestart()Destroys and then re-creates the context.voidsetAutoFlushFrames(boolean enabled) voidsetSettings(AppSettings settings) voidsetSystemListener(SystemListener listener) Sets the listener that will receive events relating to context creation, update, and destroy.voidSets the title of the display (if available).protected voidwaitFor(boolean createdVal) 
- 
Field Details- 
created
- 
renderable
- 
needClose
- 
settings
- 
renderer
- 
timer
- 
listener
- 
autoFlushprotected boolean autoFlush
- 
androidInput
- 
minFrameDurationprotected long minFrameDuration
- 
lastUpdateTimeprotected long lastUpdateTime
 
- 
- 
Constructor Details- 
OGLESContextpublic OGLESContext()
 
- 
- 
Method Details- 
getType- Specified by:
- getTypein interface- JmeContext
- Returns:
- The type of the context.
 
- 
createViewpublic 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
 
- 
onSurfaceCreatedpublic void onSurfaceCreated(javax.microedition.khronos.opengles.GL10 gl, javax.microedition.khronos.egl.EGLConfig cfg) - Specified by:
- onSurfaceCreatedin interface- android.opengl.GLSurfaceView.Renderer
 
- 
initInThreadprotected void initInThread()
- 
deinitInThreadprotected void deinitInThread()De-initialize in the OpenGL thread.
- 
setSettings- Specified by:
- setSettingsin interface- JmeContext
- Parameters:
- settings- 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.
 
- 
getSystemListenerAccesses the listener that receives events related to this context.- Specified by:
- getSystemListenerin interface- JmeContext
- Returns:
- the pre-existing instance
 
- 
setSystemListenerDescription copied from interface:JmeContextSets the listener that will receive events relating to context creation, update, and destroy.- Specified by:
- setSystemListenerin interface- JmeContext
- Parameters:
- listener- the desired listener
 
- 
getSettings- Specified by:
- getSettingsin interface- JmeContext
- Returns:
- The current display settings. Note that they might be different from the ones set with setDisplaySettings() if the context was restarted or the settings changed internally.
 
- 
getRenderer- Specified by:
- getRendererin interface- JmeContext
- Returns:
- The renderer for this context, or null if not created yet.
 
- 
getMouseInput- Specified by:
- getMouseInputin interface- JmeContext
- Returns:
- Mouse input implementation. May be null if not available.
 
- 
getKeyInput- Specified by:
- getKeyInputin interface- JmeContext
- Returns:
- Keyboard input implementation. May be null if not available.
 
- 
getJoyInput- Specified by:
- getJoyInputin interface- JmeContext
- Returns:
- Joystick input implementation. May be null if not available.
 
- 
getTouchInput- Specified by:
- getTouchInputin interface- JmeContext
- Returns:
- Touch device input implementation. May be null if not available.
 
- 
getTimer- Specified by:
- getTimerin interface- JmeContext
- Returns:
- The timer for this context, or null if not created yet.
 
- 
setTitleDescription copied from interface:JmeContextSets the title of the display (if available). This does nothing for fullscreen, headless, or canvas contexts.- Specified by:
- setTitlein interface- JmeContext
- Parameters:
- title- The new title of the display.
 
- 
isCreatedpublic boolean isCreated()- Specified by:
- isCreatedin interface- JmeContext
- Returns:
- True if the context has been created but not yet destroyed.
 
- 
setAutoFlushFramespublic void setAutoFlushFrames(boolean enabled) - Specified by:
- setAutoFlushFramesin interface- JmeContext
- Parameters:
- enabled- If enabled, the context will automatically flush frames to the video card (swap buffers) after an update cycle.
 
- 
onSurfaceChangedpublic void onSurfaceChanged(javax.microedition.khronos.opengles.GL10 gl, int width, int height) - Specified by:
- onSurfaceChangedin interface- android.opengl.GLSurfaceView.Renderer
 
- 
onDrawFramepublic void onDrawFrame(javax.microedition.khronos.opengles.GL10 gl) - Specified by:
- onDrawFramein interface- android.opengl.GLSurfaceView.Renderer
 
- 
isRenderablepublic boolean isRenderable()- Specified by:
- isRenderablein interface- JmeContext
- Returns:
- True if the context contains a valid render surface,
 if any of the rendering methods in Rendererare called while this isfalse, then the result is undefined.
 
- 
createpublic void create(boolean waitFor) Description copied from interface:JmeContextCreates the context and makes it active.- Specified by:
- createin interface- JmeContext
- Parameters:
- waitFor- If true, will wait until context has initialized.
 
- 
createpublic void create()
- 
restartpublic void restart()Description copied from interface:JmeContextDestroys and then re-creates the context. This should be called after the display settings have been changed.- Specified by:
- restartin interface- JmeContext
 
- 
destroypublic void destroy(boolean waitFor) Description copied from interface:JmeContextDestroys the context completely, making it inactive.- Specified by:
- destroyin interface- JmeContext
- Parameters:
- waitFor- If true, will wait until the context is destroyed fully.
 
- 
destroypublic void destroy()
- 
waitForprotected void waitFor(boolean createdVal) 
- 
requestDialogpublic void requestDialog(int id, String title, String initialValue, SoftTextDialogInputListener listener) - Specified by:
- requestDialogin interface- SoftTextDialogInput
 
- 
getOpenCLContext- Specified by:
- getOpenCLContextin interface- JmeContext
- Returns:
- The OpenCL context if available.
 
- 
getFramebufferHeightpublic int getFramebufferHeight()Returns the height of the input surface.- Specified by:
- getFramebufferHeightin interface- JmeContext
- Returns:
- the height (in pixels)
 
- 
getFramebufferWidthpublic int getFramebufferWidth()Returns the width of the input surface.- Specified by:
- getFramebufferWidthin interface- JmeContext
- Returns:
- the width (in pixels)
 
- 
getWindowXPositionpublic int getWindowXPosition()Returns the screen X coordinate of the left edge of the content area.- Specified by:
- getWindowXPositionin interface- JmeContext
- Returns:
- the screen X coordinate
- Throws:
- UnsupportedOperationException
 
- 
getWindowYPositionpublic int getWindowYPosition()Returns the screen Y coordinate of the top edge of the content area.- Specified by:
- getWindowYPositionin interface- JmeContext
- Returns:
- the screen Y coordinate
- Throws:
- UnsupportedOperationException
 
- 
getDisplaysDescription copied from interface:JmeContextThis call will return a list of Monitors that glfwGetMonitors() returns and information about the monitor, like width, height, and refresh rate.- Specified by:
- getDisplaysin interface- JmeContext
- Returns:
- returns a list of monitors and their information.
 
- 
getPrimaryDisplaypublic int getPrimaryDisplay()Description copied from interface:JmeContextUse this to get the positional number of the primary monitor from the glfwGetMonitors() function call.- Specified by:
- getPrimaryDisplayin interface- JmeContext
- Returns:
- the position of the value in the arraylist of the primary monitor.
 
 
-