Package com.jme3.system.lwjgl
Class LwjglContext
java.lang.Object
com.jme3.system.lwjgl.LwjglContext
- All Implemented Interfaces:
- JmeContext
- Direct Known Subclasses:
- LwjglAbstractDisplay,- LwjglOffscreenBuffer,- LwjglWindow
A LWJGL implementation of a graphics context.
- 
Nested Class SummaryNested classes/interfaces inherited from interface com.jme3.system.JmeContextJmeContext.Type
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected LwjglContextprotected LwjglPlatformprotected AtomicBooleanprotected final Objectprotected JInputJoyInputprotected LwjglKeyInputprotected SystemListenerprotected LwjglMouseInputprotected AtomicBooleanprotected Rendererprotected AppSettingsprotected static final Stringprotected Timer
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcreate()protected org.lwjgl.opengl.ContextAttribsvoiddestroy()protected intdetermineMaxSamples(int requestedSamples) intReturns the height of the framebuffer.intReturns the width of the framebuffer.protected int[]getGLVersion(String renderer) protected intAccesses the listener that receives events related to this context.getTimer()intReturns the screen X coordinate of the left edge of the content area.intReturns the screen Y coordinate of the top edge of the content area.protected voidInitializes the LWJGL renderer and input for the first time.protected voidvoidvoidbooleanbooleanprotected voidprotected voidprotected voidReinitializes the relevant details of the context.voidsetSettings(AppSettings settings) voidsetSystemListener(SystemListener listener) Sets the listener that will receive events relating to context creation, update, and destroy.protected voidwaitFor(boolean createdVal) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jme3.system.JmeContextcreate, destroy, getDisplays, getJoyInput, getKeyInput, getMouseInput, getPrimaryDisplay, getTouchInput, getType, restart, setAutoFlushFrames, setTitle
- 
Field Details- 
THREAD_NAME- See Also:
 
- 
created
- 
renderable
- 
createdLock
- 
settings
- 
renderer
- 
keyInput
- 
mouseInput
- 
joyInput
- 
timer
- 
listener
- 
clPlatform
- 
clContext
 
- 
- 
Constructor Details- 
LwjglContextpublic LwjglContext()
 
- 
- 
Method Details- 
getSystemListenerAccesses the listener that receives events related to this context.- Specified by:
- getSystemListenerin interface- JmeContext
- Returns:
- the pre-existing instance
 
- 
setSystemListenerDescription copied from interface:JmeContextSets the listener that will receive events relating to context creation, update, and destroy.- Specified by:
- setSystemListenerin interface- JmeContext
- Parameters:
- listener- the desired listener
 
- 
printContextInitInfoprotected void printContextInitInfo()
- 
getGLVersion
- 
createContextAttribsprotected org.lwjgl.opengl.ContextAttribs createContextAttribs()
- 
determineMaxSamplesprotected int determineMaxSamples(int requestedSamples) 
- 
loadNativesprotected void loadNatives()
- 
getNumSamplesToUseprotected int getNumSamplesToUse()
- 
reinitContextprotected void reinitContext()Reinitializes the relevant details of the context. For internal use only.
- 
initContextFirstTimeprotected void initContextFirstTime()Initializes the LWJGL renderer and input for the first time. For internal use only.
- 
initOpenCLprotected void initOpenCL()
- 
internalDestroypublic void internalDestroy()
- 
internalCreatepublic void internalCreate()
- 
createpublic void create()
- 
destroypublic void destroy()
- 
waitForprotected void waitFor(boolean createdVal) 
- 
isCreatedpublic boolean isCreated()- Specified by:
- isCreatedin interface- JmeContext
- Returns:
- True if the context has been created but not yet destroyed.
 
- 
isRenderablepublic boolean isRenderable()- Specified by:
- isRenderablein interface- JmeContext
- Returns:
- True if the context contains a valid render surface,
 if any of the rendering methods in Rendererare called while this isfalse, then the result is undefined.
 
- 
setSettings- Specified by:
- setSettingsin 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- Specified by:
- getSettingsin 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- Specified by:
- getRendererin interface- JmeContext
- Returns:
- The renderer for this context, or null if not created yet.
 
- 
getTimer- Specified by:
- getTimerin interface- JmeContext
- Returns:
- The timer for this context, or null if not created yet.
 
- 
getOpenCLContext- Specified by:
- getOpenCLContextin interface- JmeContext
- Returns:
- The OpenCL context if available.
 
- 
getFramebufferHeightpublic int getFramebufferHeight()Returns the height of the framebuffer.- Specified by:
- getFramebufferHeightin interface- JmeContext
- Returns:
- the height (in pixels)
 
- 
getFramebufferWidthpublic int getFramebufferWidth()Returns the width of the framebuffer.- Specified by:
- getFramebufferWidthin interface- JmeContext
- Returns:
- the width (in pixels)
 
- 
getWindowXPositionpublic int getWindowXPosition()Returns the screen X coordinate of the left edge of the content area.- Specified by:
- getWindowXPositionin interface- JmeContext
- Returns:
- the screen X coordinate
 
- 
getWindowYPositionpublic int getWindowYPosition()Returns the screen Y coordinate of the top edge of the content area.- Specified by:
- getWindowYPositionin interface- JmeContext
- Returns:
- the screen Y coordinate
 
 
-