Class LwjglWindowVR

All Implemented Interfaces:
JmeContext, Runnable
Direct Known Subclasses:

public abstract class LwjglWindowVR extends LwjglContextVR implements Runnable
A wrapper class over the GLFW framework in LWJGL 3.
  • Field Details

    • needClose

      protected AtomicBoolean needClose
    • needRestart

      protected final AtomicBoolean needRestart
    • wasActive

      protected boolean wasActive
    • autoFlush

      protected boolean autoFlush
    • allowSwapBuffers

      protected boolean allowSwapBuffers
  • Constructor Details

    • LwjglWindowVR

      public LwjglWindowVR(JmeContext.Type type)
      Create a new wrapper class over the GLFW framework in LWJGL 3.
      type - the type of the display.
  • Method Details

    • getType

      public JmeContext.Type getType()
      Specified by:
      getType in interface JmeContext
      Type.Display or Type.Canvas
    • setTitle

      public void setTitle(String title)
      Set the title if it's a windowed display
      Specified by:
      setTitle in interface JmeContext
      title - the title to set
    • restart

      public void restart()
      Restart if it's a windowed or full-screen display.
      Specified by:
      restart in interface JmeContext
    • createContext

      protected void createContext(AppSettings settings)
      Apply the settings, changing resolution, etc.
      settings - the settings to apply when creating the context.
    • destroyContext

      protected void destroyContext()
      Destroy the context.
    • create

      public void create(boolean waitFor)
      Description copied from interface: JmeContext
      Creates the context and makes it active.
      Specified by:
      create in interface JmeContext
      waitFor - If true, will wait until context has initialized.
    • initInThread

      protected boolean initInThread()
      Does LWJGL display initialization in the OpenGL thread
    • runLoop

      protected void runLoop()
      execute one iteration of the render loop in the OpenGL thread
    • deinitInThread

      protected void deinitInThread()
      De-initialize in the OpenGL thread.
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • getJoyInput

      public JoyInput getJoyInput()
      Specified by:
      getJoyInput in interface JmeContext
      Joystick input implementation. May be null if not available.
    • getMouseInput

      public MouseInput getMouseInput()
      Specified by:
      getMouseInput in interface JmeContext
      Mouse input implementation. May be null if not available.
    • getKeyInput

      public KeyInput getKeyInput()
      Specified by:
      getKeyInput in interface JmeContext
      Keyboard input implementation. May be null if not available.
    • getTouchInput

      public TouchInput getTouchInput()
      Specified by:
      getTouchInput in interface JmeContext
      Touch device input implementation. May be null if not available.
    • setAutoFlushFrames

      public void setAutoFlushFrames(boolean enabled)
      Specified by:
      setAutoFlushFrames in interface JmeContext
      enabled - If enabled, the context will automatically flush frames to the video card (swap buffers) after an update cycle.
    • destroy

      public void destroy(boolean waitFor)
      Description copied from interface: JmeContext
      Destroys the context completely, making it inactive.
      Specified by:
      destroy in interface JmeContext
      waitFor - If true, will wait until the context is destroyed fully.
    • getWindowHandle

      public long getWindowHandle()
      Get the window handle.
      the window handle as an internal GLFW identifier.
    • getFramebufferHeight

      public int getFramebufferHeight()
      Returns the height of the framebuffer.
      Specified by:
      getFramebufferHeight in interface JmeContext
      the height (in pixels)
    • getFramebufferWidth

      public int getFramebufferWidth()
      Returns the width of the framebuffer.
      Specified by:
      getFramebufferWidth in interface JmeContext
      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 JmeContext
      the screen X coordinate
    • getWindowYPosition

      public int getWindowYPosition()
      Returns the screen Y coordinate of the top edge of the content area.
      Specified by:
      getWindowYPosition in interface JmeContext
      the screen Y coordinate