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, wasActive
clContext, 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, setAutoFlushFrames
create, 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, waitFor
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy, getFramebufferHeight, getFramebufferWidth, getJoyInput, getKeyInput, getMouseInput, getOpenCLContext, getRenderer, getSettings, getSystemListener, getTimer, getTouchInput, getWindowXPosition, getWindowYPosition, isCreated, isRenderable, setAutoFlushFrames, setSettings, setSystemListener
protected 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 JmeContext
getType
in class LwjglAbstractDisplay
public void create(boolean waitFor)
JmeContext
create
in interface JmeContext
waitFor
- If true, will wait until context has initialized.public void setTitle(java.lang.String title)
LwjglAbstractDisplay
setTitle
in interface JmeContext
setTitle
in class LwjglAbstractDisplay
title
- the desired titlepublic void restart()
LwjglAbstractDisplay
restart
in interface JmeContext
restart
in class LwjglAbstractDisplay
public java.awt.Canvas getCanvas()
getCanvas
in interface JmeCanvasContext
protected void runLoop()
LwjglAbstractDisplay
runLoop
in class LwjglAbstractDisplay
protected 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 LwjglAbstractDisplay
protected void createContext(AppSettings settings)
createContext
in class LwjglAbstractDisplay
settings
- the AppSettings to apply