Package com.jme3.system.lwjgl
Class LwjglAbstractDisplay
java.lang.Object
com.jme3.system.lwjgl.LwjglContext
com.jme3.system.lwjgl.LwjglAbstractDisplay
- All Implemented Interfaces:
JmeContext
,Runnable
- Direct Known Subclasses:
LwjglCanvas
,LwjglDisplay
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jme3.system.JmeContext
JmeContext.Type
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected boolean
protected int
protected AtomicBoolean
protected boolean
Fields inherited from class com.jme3.system.lwjgl.LwjglContext
clContext, clPlatform, created, createdLock, joyInput, keyInput, listener, mouseInput, renderable, renderer, settings, THREAD_NAME, timer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
protected abstract void
createContext
(AppSettings settings) Apply the settings, changing resolution, etc.protected void
De-initialize in the OpenGL thread.void
destroy
(boolean waitFor) Destroys the context completely, making it inactive.protected abstract void
Destroy the context.abstract JmeContext.Type
getType()
protected boolean
Does LWJGL display initialization in the OpenGL threadabstract void
restart()
Restart if it's a windowed or full-screen display.void
run()
protected void
runLoop()
execute one iteration of the render loop in the OpenGL threadvoid
setAutoFlushFrames
(boolean enabled) abstract void
Set the title if it's a windowed displayMethods inherited from class com.jme3.system.lwjgl.LwjglContext
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
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
-
Field Details
-
needClose
-
wasActive
protected boolean wasActive -
frameRate
protected int frameRate -
autoFlush
protected boolean autoFlush -
allowSwapBuffers
protected boolean allowSwapBuffers
-
-
Constructor Details
-
LwjglAbstractDisplay
public LwjglAbstractDisplay()
-
-
Method Details
-
getType
- Specified by:
getType
in interfaceJmeContext
- Returns:
- Type.Display or Type.Canvas
-
setTitle
Set the title if it's a windowed display- Specified by:
setTitle
in interfaceJmeContext
- Parameters:
title
- the desired title
-
restart
public abstract void restart()Restart if it's a windowed or full-screen display.- Specified by:
restart
in interfaceJmeContext
-
createContext
Apply the settings, changing resolution, etc.- Parameters:
settings
- the AppSettings to apply- Throws:
org.lwjgl.LWJGLException
- for various error conditions
-
destroyContext
protected abstract void destroyContext()Destroy the context. -
initInThread
protected boolean initInThread()Does LWJGL display initialization in the OpenGL thread- Returns:
- true if successful, otherwise false
-
checkGLError
protected boolean checkGLError() -
runLoop
protected void runLoop()execute one iteration of the render loop in the OpenGL thread -
deinitInThread
protected void deinitInThread()De-initialize in the OpenGL thread. -
run
public void run() -
getJoyInput
- Specified by:
getJoyInput
in interfaceJmeContext
- Returns:
- Joystick input implementation. May be null if not available.
-
getMouseInput
- Specified by:
getMouseInput
in interfaceJmeContext
- Returns:
- Mouse input implementation. May be null if not available.
-
getKeyInput
- Specified by:
getKeyInput
in interfaceJmeContext
- Returns:
- Keyboard input implementation. May be null if not available.
-
getTouchInput
- Specified by:
getTouchInput
in interfaceJmeContext
- Returns:
- Touch device input implementation. May be null if not available.
-
setAutoFlushFrames
public void setAutoFlushFrames(boolean enabled) - Specified by:
setAutoFlushFrames
in interfaceJmeContext
- Parameters:
enabled
- If enabled, the context will automatically flush frames to the video card (swap buffers) after an update cycle.
-
destroy
public void destroy(boolean waitFor) Description copied from interface:JmeContext
Destroys the context completely, making it inactive.- Specified by:
destroy
in interfaceJmeContext
- Parameters:
waitFor
- If true, will wait until the context is destroyed fully.
-