com.jme3.system.lwjgl
Class LwjglAbstractDisplay

java.lang.Object
  extended by com.jme3.system.lwjgl.LwjglContext
      extended by com.jme3.system.lwjgl.LwjglAbstractDisplay
All Implemented Interfaces:
JmeContext, java.lang.Runnable
Direct Known Subclasses:
LwjglCanvas, LwjglDisplay

public abstract class LwjglAbstractDisplay
extends LwjglContext
implements java.lang.Runnable


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jme3.system.JmeContext
JmeContext.Type
 
Field Summary
protected  boolean autoFlush
           
protected  int frameRate
           
protected  java.util.concurrent.atomic.AtomicBoolean needClose
           
protected  boolean wasActive
           
 
Fields inherited from class com.jme3.system.lwjgl.LwjglContext
created, createdLock, joyInput, keyInput, listener, mouseInput, renderable, renderer, settings, timer
 
Constructor Summary
LwjglAbstractDisplay()
           
 
Method Summary
protected  boolean checkGLError()
           
protected abstract  void createContext(AppSettings settings)
          Apply the settings, changing resolution, etc.
protected  void deinitInThread()
          De-initialize in the OpenGL thread.
 void destroy(boolean waitFor)
          Destroys the context completely, making it inactive.
protected abstract  void destroyContext()
          Destroy the context.
 JoyInput getJoyInput()
           
 KeyInput getKeyInput()
           
 MouseInput getMouseInput()
           
 TouchInput getTouchInput()
           
abstract  JmeContext.Type getType()
           
protected  boolean initInThread()
          Does LWJGL display initialization in the OpenGL thread
abstract  void restart()
          Restart if its a windowed or full-screen display.
 void run()
           
protected  void runLoop()
          execute one iteration of the render loop in the OpenGL thread
 void setAutoFlushFrames(boolean enabled)
           
abstract  void setTitle(java.lang.String title)
          Set the title if its a windowed display
 
Methods inherited from class com.jme3.system.lwjgl.LwjglContext
create, createContextAttribs, destroy, getRenderer, getSettings, getTimer, initContextFirstTime, internalCreate, internalDestroy, isCreated, isRenderable, printContextInitInfo, 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 Detail

needClose

protected java.util.concurrent.atomic.AtomicBoolean needClose

wasActive

protected boolean wasActive

frameRate

protected int frameRate

autoFlush

protected boolean autoFlush
Constructor Detail

LwjglAbstractDisplay

public LwjglAbstractDisplay()
Method Detail

getType

public abstract JmeContext.Type getType()
Specified by:
getType in interface JmeContext
Returns:
Type.Display or Type.Canvas

setTitle

public abstract void setTitle(java.lang.String title)
Set the title if its a windowed display

Specified by:
setTitle in interface JmeContext
Parameters:
title -

restart

public abstract void restart()
Restart if its a windowed or full-screen display.

Specified by:
restart in interface JmeContext

createContext

protected abstract void createContext(AppSettings settings)
                               throws org.lwjgl.LWJGLException
Apply the settings, changing resolution, etc.

Parameters:
settings -
Throws:
org.lwjgl.LWJGLException

destroyContext

protected abstract void destroyContext()
Destroy the context.


initInThread

protected boolean initInThread()
Does LWJGL display initialization in the OpenGL thread


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()
Specified by:
run in interface java.lang.Runnable

getJoyInput

public JoyInput getJoyInput()
Specified by:
getJoyInput in interface JmeContext
Returns:
Joystick input implementation. May be null if not available.

getMouseInput

public MouseInput getMouseInput()
Specified by:
getMouseInput in interface JmeContext
Returns:
Mouse input implementation. May be null if not available.

getKeyInput

public KeyInput getKeyInput()
Specified by:
getKeyInput in interface JmeContext
Returns:
Keyboard input implementation. May be null if not available.

getTouchInput

public TouchInput getTouchInput()
Specified by:
getTouchInput in interface JmeContext
Returns:
Touch device input implementation. May be null if not available.

setAutoFlushFrames

public void setAutoFlushFrames(boolean enabled)
Specified by:
setAutoFlushFrames in interface JmeContext
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 interface JmeContext
Parameters:
waitFor - If true, will wait until the context is destroyed fully.