Package com.jme3.system.lwjgl
Class LwjglCanvas
java.lang.Object
com.jme3.system.lwjgl.LwjglContext
com.jme3.system.lwjgl.LwjglAbstractDisplay
com.jme3.system.lwjgl.LwjglCanvas
- All Implemented Interfaces:
- JmeCanvasContext,- JmeContext,- Runnable
- 
Nested Class SummaryNested classes/interfaces inherited from interface com.jme3.system.JmeContextJmeContext.Type
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final intprotected static final intprotected static final booleanFields inherited from class com.jme3.system.lwjgl.LwjglAbstractDisplayallowSwapBuffers, autoFlush, frameRate, needClose, wasActiveFields inherited from class com.jme3.system.lwjgl.LwjglContextclContext, clPlatform, created, createdLock, joyInput, keyInput, listener, mouseInput, renderable, renderer, settings, THREAD_NAME, timer
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected org.lwjgl.opengl.PixelFormatacquirePixelFormat(boolean forPbuffer) It seems it is best to use one pixel format for all shared contexts.voidcreate(boolean waitFor) Creates the context and makes it active.protected voidcreateContext(AppSettings settings) This is called: 1) When the context thread starts 2) Any time the canvas becomes displayable again.protected voidThis is called: 1) When the context thread ends 2) Any time the canvas becomes non-displayableprotected voidThis call will return a list of Monitors that glfwGetMonitors() returns and information about the monitor, like width, height, and refresh rate.intUse this to get the positional number of the primary monitor from the glfwGetMonitors() function call.getType()protected voidMakes sure the pbuffer is available and ready for usevoidrestart()Restart if it's a windowed or full-screen display.protected voidrunLoop()execute one iteration of the render loop in the OpenGL threadvoidSet the title if it's a windowed displayMethods inherited from class com.jme3.system.lwjgl.LwjglAbstractDisplaycheckGLError, deinitInThread, destroy, getJoyInput, getKeyInput, getMouseInput, getTouchInput, initInThread, run, setAutoFlushFramesMethods inherited from class com.jme3.system.lwjgl.LwjglContextcreate, createContextAttribs, destroy, determineMaxSamples, getFramebufferHeight, getFramebufferWidth, getGLVersion, getNumSamplesToUse, getOpenCLContext, getRenderer, getSettings, getSystemListener, getTimer, getWindowXPosition, getWindowYPosition, initContextFirstTime, initOpenCL, internalCreate, internalDestroy, isCreated, isRenderable, loadNatives, printContextInitInfo, reinitContext, setSettings, setSystemListener, waitForMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jme3.system.JmeContextdestroy, getFramebufferHeight, getFramebufferWidth, getJoyInput, getKeyInput, getMouseInput, getOpenCLContext, getRenderer, getSettings, getSystemListener, getTimer, getTouchInput, getWindowXPosition, getWindowYPosition, isCreated, isRenderable, setAutoFlushFrames, setSettings, setSystemListener
- 
Field Details- 
TASK_NOTHINGprotected static final int TASK_NOTHING- See Also:
 
- 
TASK_DESTROY_DISPLAYprotected static final int TASK_DESTROY_DISPLAY- See Also:
 
- 
TASK_CREATE_DISPLAYprotected static final int TASK_CREATE_DISPLAY- See Also:
 
- 
TASK_COMPLETEprotected static final int TASK_COMPLETE- See Also:
 
- 
USE_SHARED_CONTEXTprotected static final boolean USE_SHARED_CONTEXT- See Also:
 
 
- 
- 
Constructor Details- 
LwjglCanvaspublic LwjglCanvas()
 
- 
- 
Method Details- 
getType- Specified by:
- getTypein interface- JmeContext
- Specified by:
- getTypein class- LwjglAbstractDisplay
- Returns:
- Type.Display or Type.Canvas
 
- 
createpublic void create(boolean waitFor) Description copied from interface:JmeContextCreates the context and makes it active.- Specified by:
- createin interface- JmeContext
- Parameters:
- waitFor- If true, will wait until context has initialized.
 
- 
setTitleDescription copied from class:LwjglAbstractDisplaySet the title if it's a windowed display- Specified by:
- setTitlein interface- JmeContext
- Specified by:
- setTitlein class- LwjglAbstractDisplay
- Parameters:
- title- the desired title
 
- 
restartpublic void restart()Description copied from class:LwjglAbstractDisplayRestart if it's a windowed or full-screen display.- Specified by:
- restartin interface- JmeContext
- Specified by:
- restartin class- LwjglAbstractDisplay
 
- 
getCanvas- Specified by:
- getCanvasin interface- JmeCanvasContext
 
- 
runLoopprotected void runLoop()Description copied from class:LwjglAbstractDisplayexecute one iteration of the render loop in the OpenGL thread- Overrides:
- runLoopin class- LwjglAbstractDisplay
 
- 
acquirePixelFormatprotected org.lwjgl.opengl.PixelFormat acquirePixelFormat(boolean forPbuffer) It seems it is best to use one pixel format for all shared contexts.- Parameters:
- forPbuffer- true→zero samples, false→correct number of samples
- Returns:
- a new instance
- See Also:
 
- 
makePbufferAvailableprotected void makePbufferAvailable() throws org.lwjgl.LWJGLExceptionMakes sure the pbuffer is available and ready for use- Throws:
- org.lwjgl.LWJGLException- if the buffer can't be made current
 
- 
destroyPbufferprotected void destroyPbuffer()
- 
destroyContextprotected void destroyContext()This is called: 1) When the context thread ends 2) Any time the canvas becomes non-displayable- Specified by:
- destroyContextin class- LwjglAbstractDisplay
 
- 
createContextThis is called: 1) When the context thread starts 2) Any time the canvas becomes displayable again. In the first call of this method, OpenGL context is not ready yet. Therefore, OpenCL context cannot be created. The second call of this method is done after "simpleInitApp" is called. Therefore, OpenCL won't be available in "simpleInitApp" if Canvas/Swing is used. To use OpenCL with Canvas/Swing, you need to use OpenCL in the rendering loop "simpleUpdate" and check for "context.getOpenCLContext()!=null".- Specified by:
- createContextin class- LwjglAbstractDisplay
- Parameters:
- settings- the AppSettings to apply
 
- 
getDisplaysDescription copied from interface:JmeContextThis call will return a list of Monitors that glfwGetMonitors() returns and information about the monitor, like width, height, and refresh rate.- Specified by:
- getDisplaysin interface- JmeContext
- Returns:
- returns a list of monitors and their information.
 
- 
getPrimaryDisplaypublic int getPrimaryDisplay()Description copied from interface:JmeContextUse this to get the positional number of the primary monitor from the glfwGetMonitors() function call.- Specified by:
- getPrimaryDisplayin interface- JmeContext
- Returns:
- the position of the value in the arraylist of the primary monitor.
 
 
-