Package com.jme3.system.lwjgl
Class LwjglContext
java.lang.Object
com.jme3.system.lwjgl.LwjglContext
- All Implemented Interfaces:
JmeContext
- Direct Known Subclasses:
LwjglWindow
A LWJGL implementation of a graphics context.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jme3.system.JmeContext
JmeContext.Type
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final boolean
protected LwjglContext
protected final AtomicBoolean
protected final Object
protected GlfwJoystickInput
protected GlfwKeyInput
protected SystemListener
protected GlfwMouseInput
protected final AtomicBoolean
protected Renderer
protected final AppSettings
protected Timer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
void
destroy()
protected int
protected int
Accesses the listener that receives events related to this context.getTimer()
protected void
Initializes the LWJGL renderer and input for the first time.protected void
initOpenCL
(long window) void
void
boolean
boolean
protected void
protected void
Reinitializes the relevant details of the context.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, getDisplays, getFramebufferHeight, getFramebufferWidth, getJoyInput, getKeyInput, getMouseInput, getPrimaryDisplay, getTouchInput, getType, getWindowXPosition, getWindowYPosition, restart, setAutoFlushFrames, setTitle
-
Field Details
-
CL_GL_SHARING_POSSIBLE
public static final boolean CL_GL_SHARING_POSSIBLE- See Also:
-
createdLock
-
created
-
renderable
-
settings
-
keyInput
-
mouseInput
-
joyInput
-
timer
-
renderer
-
listener
-
clContext
-
-
Constructor Details
-
LwjglContext
public LwjglContext()
-
-
Method Details
-
getSystemListener
Accesses the listener that receives events related to this context.- Specified by:
getSystemListener
in interfaceJmeContext
- Returns:
- the pre-existing instance
-
setSystemListener
Description copied from interface:JmeContext
Sets the listener that will receive events relating to context creation, update, and destroy.- Specified by:
setSystemListener
in interfaceJmeContext
- Parameters:
listener
- the desired listener
-
printContextInitInfo
protected void printContextInitInfo() -
determineMaxSamples
protected int determineMaxSamples() -
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(long window) -
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 interfaceJmeContext
- Returns:
- True if the context has been created but not yet destroyed.
-
isRenderable
public boolean isRenderable()- Specified by:
isRenderable
in interfaceJmeContext
- Returns:
- True if the context contains a valid render surface,
if any of the rendering methods in
Renderer
are called while this isfalse
, then the result is undefined.
-
setSettings
- Specified by:
setSettings
in interfaceJmeContext
- Parameters:
settings
- the display settings to use for the created context. If the context has already been created, thenrestart()
must be called for the changes to be applied.
-
getSettings
- Specified by:
getSettings
in interfaceJmeContext
- 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
- Specified by:
getRenderer
in interfaceJmeContext
- Returns:
- The renderer for this context, or null if not created yet.
-
getTimer
- Specified by:
getTimer
in interfaceJmeContext
- Returns:
- The timer for this context, or null if not created yet.
-
getOpenCLContext
- Specified by:
getOpenCLContext
in interfaceJmeContext
- Returns:
- The OpenCL context if available.
-