Class LwjglContext

java.lang.Object
com.jme3.system.lwjgl.LwjglContext
All Implemented Interfaces:
JmeContext
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
      Returns:
      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
      Parameters:
      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
      Returns:
      True if the context has been created but not yet destroyed.
    • isRenderable

      public boolean isRenderable()
      Specified by:
      isRenderable in interface JmeContext
      Returns:
      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
      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.
    • getSettings

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

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

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

      public Context getOpenCLContext()
      Specified by:
      getOpenCLContext in interface JmeContext
      Returns:
      The OpenCL context if available.
    • getFramebufferHeight

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

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