com.jme3.system.lwjgl
Class LwjglContext

java.lang.Object
  extended by com.jme3.system.lwjgl.LwjglContext
All Implemented Interfaces:
JmeContext
Direct Known Subclasses:
LwjglAbstractDisplay, LwjglOffscreenBuffer

public abstract class LwjglContext
extends java.lang.Object
implements JmeContext

A LWJGL implementation of a graphics context.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jme3.system.JmeContext
JmeContext.Type
 
Field Summary
protected  java.util.concurrent.atomic.AtomicBoolean created
           
protected  java.lang.Object createdLock
           
protected  JInputJoyInput joyInput
           
protected  LwjglKeyInput keyInput
           
protected  SystemListener listener
           
protected  LwjglMouseInput mouseInput
           
protected  java.util.concurrent.atomic.AtomicBoolean renderable
           
protected  Renderer renderer
           
protected  AppSettings settings
           
protected  Timer timer
           
 
Constructor Summary
LwjglContext()
           
 
Method Summary
 void create()
           
protected  org.lwjgl.opengl.ContextAttribs createContextAttribs()
           
 void destroy()
           
 Renderer getRenderer()
           
 AppSettings getSettings()
           
 Timer getTimer()
           
protected  void initContextFirstTime()
           
 void internalCreate()
           
 void internalDestroy()
           
 boolean isCreated()
           
 boolean isRenderable()
           
protected  void printContextInitInfo()
           
 void setSettings(AppSettings settings)
           
 void setSystemListener(SystemListener listener)
          Sets the listener that will receive events relating to context creation, update, and destroy.
protected  void waitFor(boolean createdVal)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jme3.system.JmeContext
create, destroy, getJoyInput, getKeyInput, getMouseInput, getTouchInput, getType, restart, setAutoFlushFrames, setTitle
 

Field Detail

created

protected java.util.concurrent.atomic.AtomicBoolean created

renderable

protected java.util.concurrent.atomic.AtomicBoolean renderable

createdLock

protected final java.lang.Object createdLock

settings

protected AppSettings settings

renderer

protected Renderer renderer

keyInput

protected LwjglKeyInput keyInput

mouseInput

protected LwjglMouseInput mouseInput

joyInput

protected JInputJoyInput joyInput

timer

protected Timer timer

listener

protected SystemListener listener
Constructor Detail

LwjglContext

public LwjglContext()
Method Detail

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

printContextInitInfo

protected void printContextInitInfo()

createContextAttribs

protected org.lwjgl.opengl.ContextAttribs createContextAttribs()

initContextFirstTime

protected void initContextFirstTime()

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.