Class LwjglContext

All Implemented Interfaces:
Direct Known Subclasses:
LwjglAbstractDisplay, LwjglOffscreenBuffer, LwjglWindow

public abstract class LwjglContext extends Object implements JmeContext
A LWJGL implementation of a graphics context.
  • Field Details

  • Constructor Details

    • LwjglContext

      public LwjglContext()
  • Method Details

    • getSystemListener

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

      public void setSystemListener(SystemListener listener)
      Description copied from interface: JmeContext
      Sets the listener that will receive events relating to context creation, update, and destroy.
      Specified by:
      setSystemListener in interface JmeContext
      listener - the desired listener
    • printContextInitInfo

      protected void printContextInitInfo()
    • getGLVersion

      protected int[] getGLVersion(String renderer)
    • createContextAttribs

      protected org.lwjgl.opengl.ContextAttribs createContextAttribs()
    • determineMaxSamples

      protected int determineMaxSamples(int requestedSamples)
    • loadNatives

      protected void loadNatives()
    • getNumSamplesToUse

      protected int getNumSamplesToUse()
    • reinitContext

      protected void reinitContext()
      Reinitializes the relevant details of the context. For internal use only.
    • initContextFirstTime

      protected void initContextFirstTime()
      Initializes the LWJGL renderer and input for the first time. For internal use only.
    • initOpenCL

      protected void initOpenCL()
    • internalDestroy

      public void internalDestroy()
    • internalCreate

      public void internalCreate()
    • create

      public void create()
    • destroy

      public void destroy()
    • waitFor

      protected void waitFor(boolean createdVal)
    • isCreated

      public boolean isCreated()
      Specified by:
      isCreated in interface JmeContext
      True if the context has been created but not yet destroyed.
    • isRenderable

      public boolean isRenderable()
      Specified by:
      isRenderable in interface JmeContext
      True if the context contains a valid render surface, if any of the rendering methods in Renderer are called while this is false, then the result is undefined.
    • setSettings

      public void setSettings(AppSettings settings)
      Specified by:
      setSettings in interface JmeContext
      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.
    • getSettings

      public AppSettings getSettings()
      Specified by:
      getSettings in interface JmeContext
      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

      public Renderer getRenderer()
      Specified by:
      getRenderer in interface JmeContext
      The renderer for this context, or null if not created yet.
    • getTimer

      public Timer getTimer()
      Specified by:
      getTimer in interface JmeContext
      The timer for this context, or null if not created yet.
    • getOpenCLContext

      public Context getOpenCLContext()
      Specified by:
      getOpenCLContext in interface JmeContext
      The OpenCL context if available.
    • 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