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 Object implements com.jme3.system.JmeContext, android.opengl.GLSurfaceView.Renderer, com.jme3.input.SoftTextDialogInput
  • Field Details

    • created

      protected final AtomicBoolean created
    • renderable

      protected final AtomicBoolean renderable
    • needClose

      protected final 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
  • Constructor Details

    • OGLESContext

      public OGLESContext()
  • Method Details

    • getType

      public com.jme3.system.JmeContext.Type getType()
      Specified by:
      getType in interface com.jme3.system.JmeContext
    • createView

      public 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.

      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:
      onSurfaceCreated in interface android.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:
      setSettings in interface com.jme3.system.JmeContext
    • getSystemListener

      public com.jme3.system.SystemListener getSystemListener()
      Accesses the listener that receives events related to this context.
      Specified by:
      getSystemListener in interface com.jme3.system.JmeContext
      Returns:
      the pre-existing instance
    • setSystemListener

      public void setSystemListener(com.jme3.system.SystemListener listener)
      Specified by:
      setSystemListener in interface com.jme3.system.JmeContext
    • getSettings

      public com.jme3.system.AppSettings getSettings()
      Specified by:
      getSettings in interface com.jme3.system.JmeContext
    • getRenderer

      public com.jme3.renderer.Renderer getRenderer()
      Specified by:
      getRenderer in interface com.jme3.system.JmeContext
    • getMouseInput

      public com.jme3.input.MouseInput getMouseInput()
      Specified by:
      getMouseInput in interface com.jme3.system.JmeContext
    • getKeyInput

      public com.jme3.input.KeyInput getKeyInput()
      Specified by:
      getKeyInput in interface com.jme3.system.JmeContext
    • getJoyInput

      public com.jme3.input.JoyInput getJoyInput()
      Specified by:
      getJoyInput in interface com.jme3.system.JmeContext
    • getTouchInput

      public com.jme3.input.TouchInput getTouchInput()
      Specified by:
      getTouchInput in interface com.jme3.system.JmeContext
    • getTimer

      public com.jme3.system.Timer getTimer()
      Specified by:
      getTimer in interface com.jme3.system.JmeContext
    • setTitle

      public void setTitle(String title)
      Specified by:
      setTitle in interface com.jme3.system.JmeContext
    • isCreated

      public boolean isCreated()
      Specified by:
      isCreated in interface com.jme3.system.JmeContext
    • setAutoFlushFrames

      public void setAutoFlushFrames(boolean enabled)
      Specified by:
      setAutoFlushFrames in interface com.jme3.system.JmeContext
    • onSurfaceChanged

      public void onSurfaceChanged(javax.microedition.khronos.opengles.GL10 gl, int width, int height)
      Specified by:
      onSurfaceChanged in interface android.opengl.GLSurfaceView.Renderer
    • onDrawFrame

      public void onDrawFrame(javax.microedition.khronos.opengles.GL10 gl)
      Specified by:
      onDrawFrame in interface android.opengl.GLSurfaceView.Renderer
    • isRenderable

      public boolean isRenderable()
      Specified by:
      isRenderable in interface com.jme3.system.JmeContext
    • create

      public void create(boolean waitFor)
      Specified by:
      create in interface com.jme3.system.JmeContext
    • create

      public void create()
    • restart

      public void restart()
      Specified by:
      restart in interface com.jme3.system.JmeContext
    • destroy

      public void destroy(boolean waitFor)
      Specified by:
      destroy in interface com.jme3.system.JmeContext
    • destroy

      public void destroy()
    • waitFor

      protected void waitFor(boolean createdVal)
    • requestDialog

      public void requestDialog(int id, String title, String initialValue, com.jme3.input.controls.SoftTextDialogInputListener listener)
      Specified by:
      requestDialog in interface com.jme3.input.SoftTextDialogInput
    • getOpenCLContext

      public com.jme3.opencl.Context getOpenCLContext()
      Specified by:
      getOpenCLContext in interface com.jme3.system.JmeContext
    • getFramebufferHeight

      public int getFramebufferHeight()
      Returns the height of the input surface.
      Specified by:
      getFramebufferHeight in interface com.jme3.system.JmeContext
      Returns:
      the height (in pixels)
    • getFramebufferWidth

      public int getFramebufferWidth()
      Returns the width of the input surface.
      Specified by:
      getFramebufferWidth in interface com.jme3.system.JmeContext
      Returns:
      the width (in pixels)
    • getWindowXPosition

      public int getWindowXPosition()
      Returns the screen X coordinate of the left edge of the content area.
      Specified by:
      getWindowXPosition in interface com.jme3.system.JmeContext
      Throws:
      UnsupportedOperationException
    • getWindowYPosition

      public int getWindowYPosition()
      Returns the screen Y coordinate of the top edge of the content area.
      Specified by:
      getWindowYPosition in interface com.jme3.system.JmeContext
      Throws:
      UnsupportedOperationException
    • getDisplays

      public com.jme3.system.Displays getDisplays()
      Specified by:
      getDisplays in interface com.jme3.system.JmeContext
    • getPrimaryDisplay

      public int getPrimaryDisplay()
      Specified by:
      getPrimaryDisplay in interface com.jme3.system.JmeContext