Class 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
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.jme3.system.JmeContext

        com.jme3.system.JmeContext.Type
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected AndroidInputHandler androidInput  
      protected boolean autoFlush  
      protected java.util.concurrent.atomic.AtomicBoolean created  
      protected long lastUpdateTime  
      protected com.jme3.system.SystemListener listener  
      protected long minFrameDuration  
      protected java.util.concurrent.atomic.AtomicBoolean needClose  
      protected java.util.concurrent.atomic.AtomicBoolean renderable  
      protected com.jme3.renderer.opengl.GLRenderer renderer  
      protected com.jme3.system.AppSettings settings  
      protected com.jme3.system.Timer timer  
      • Fields inherited from interface com.jme3.input.SoftTextDialogInput

        NUMERIC_ENTRY_DIALOG, NUMERIC_KEYPAD_DIALOG, TEXT_ENTRY_DIALOG
    • Constructor Summary

      Constructors 
      Constructor Description
      OGLESContext()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void create()  
      void create​(boolean waitFor)  
      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)  
      com.jme3.input.JoyInput getJoyInput()  
      com.jme3.input.KeyInput getKeyInput()  
      com.jme3.input.MouseInput getMouseInput()  
      com.jme3.opencl.Context getOpenCLContext()  
      com.jme3.renderer.Renderer getRenderer()  
      com.jme3.system.AppSettings getSettings()  
      com.jme3.system.Timer getTimer()  
      com.jme3.input.TouchInput getTouchInput()  
      com.jme3.system.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, com.jme3.input.controls.SoftTextDialogInputListener listener)  
      void restart()  
      void setAutoFlushFrames​(boolean enabled)  
      void setSettings​(com.jme3.system.AppSettings settings)  
      void setSystemListener​(com.jme3.system.SystemListener listener)  
      void setTitle​(java.lang.String title)  
      protected void waitFor​(boolean createdVal)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
      • minFrameDuration

        protected long minFrameDuration
      • lastUpdateTime

        protected long lastUpdateTime
    • Constructor Detail

      • OGLESContext

        public OGLESContext()
    • Method Detail

      • 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
      • 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​(java.lang.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,
                                  java.lang.String title,
                                  java.lang.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