public class LwjglCanvas extends LwjglAbstractDisplay implements JmeCanvasContext
JmeContext.Type| Modifier and Type | Field and Description |
|---|---|
protected static int |
TASK_COMPLETE |
protected static int |
TASK_CREATE_DISPLAY |
protected static int |
TASK_DESTROY_DISPLAY |
protected static int |
TASK_NOTHING |
protected static boolean |
USE_SHARED_CONTEXT |
allowSwapBuffers, autoFlush, frameRate, needClose, wasActiveclContext, clPlatform, created, createdLock, joyInput, keyInput, listener, mouseInput, renderable, renderer, settings, THREAD_NAME, timer| Constructor and Description |
|---|
LwjglCanvas() |
| Modifier and Type | Method and Description |
|---|---|
protected org.lwjgl.opengl.PixelFormat |
acquirePixelFormat(boolean forPbuffer)
It seems it is best to use one pixel format for all shared contexts.
|
void |
create(boolean waitFor)
Creates the context and makes it active.
|
protected void |
createContext(AppSettings settings)
This is called:
1) When the context thread starts
2) Any time the canvas becomes displayable again.
|
protected void |
destroyContext()
This is called:
1) When the context thread ends
2) Any time the canvas becomes non-displayable
|
protected void |
destroyPbuffer() |
java.awt.Canvas |
getCanvas() |
JmeContext.Type |
getType() |
protected void |
makePbufferAvailable()
Makes sure the pbuffer is available and ready for use
|
void |
restart()
Restart if it's a windowed or full-screen display.
|
protected void |
runLoop()
execute one iteration of the render loop in the OpenGL thread
|
void |
setTitle(java.lang.String title)
Set the title if it's a windowed display
|
checkGLError, deinitInThread, destroy, getJoyInput, getKeyInput, getMouseInput, getTouchInput, initInThread, run, setAutoFlushFramescreate, createContextAttribs, destroy, determineMaxSamples, getGLVersion, getNumSamplesToUse, getOpenCLContext, getRenderer, getSettings, getTimer, initContextFirstTime, initOpenCL, internalCreate, internalDestroy, isCreated, isRenderable, loadNatives, printContextInitInfo, reinitContext, setSettings, setSystemListener, waitForclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroy, getJoyInput, getKeyInput, getMouseInput, getOpenCLContext, getRenderer, getSettings, getTimer, getTouchInput, isCreated, isRenderable, setAutoFlushFrames, setSettings, setSystemListenerprotected static final int TASK_NOTHING
protected static final int TASK_DESTROY_DISPLAY
protected static final int TASK_CREATE_DISPLAY
protected static final int TASK_COMPLETE
protected static final boolean USE_SHARED_CONTEXT
public JmeContext.Type getType()
getType in interface JmeContextgetType in class LwjglAbstractDisplaypublic void create(boolean waitFor)
JmeContextcreate in interface JmeContextwaitFor - If true, will wait until context has initialized.public void setTitle(java.lang.String title)
LwjglAbstractDisplaysetTitle in interface JmeContextsetTitle in class LwjglAbstractDisplaytitle - the desired titlepublic void restart()
LwjglAbstractDisplayrestart in interface JmeContextrestart in class LwjglAbstractDisplaypublic java.awt.Canvas getCanvas()
getCanvas in interface JmeCanvasContextprotected void runLoop()
LwjglAbstractDisplayrunLoop in class LwjglAbstractDisplayprotected org.lwjgl.opengl.PixelFormat acquirePixelFormat(boolean forPbuffer)
forPbuffer - true→zero samples, false→correct number of samplesprotected void makePbufferAvailable()
throws org.lwjgl.LWJGLException
org.lwjgl.LWJGLException - if the buffer can't be made currentprotected void destroyPbuffer()
protected void destroyContext()
destroyContext in class LwjglAbstractDisplayprotected void createContext(AppSettings settings)
createContext in class LwjglAbstractDisplaysettings - the AppSettings to apply