public class NullContext extends java.lang.Object implements JmeContext, java.lang.Runnable
JmeContext.Type
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.atomic.AtomicBoolean |
created |
protected java.lang.Object |
createdLock |
protected int |
frameRate |
protected SystemListener |
listener |
protected static java.util.logging.Logger |
logger |
protected java.util.concurrent.atomic.AtomicBoolean |
needClose |
protected NullRenderer |
renderer |
protected AppSettings |
settings |
protected static java.lang.String |
THREAD_NAME |
protected Timer |
timer |
Constructor and Description |
---|
NullContext() |
Modifier and Type | Method and Description |
---|---|
void |
create() |
void |
create(boolean waitFor)
Creates the context and makes it active.
|
protected void |
deinitInThread() |
void |
destroy() |
void |
destroy(boolean waitFor)
Destroys the context completely, making it inactive.
|
JoyInput |
getJoyInput() |
KeyInput |
getKeyInput() |
MouseInput |
getMouseInput() |
Context |
getOpenCLContext() |
Renderer |
getRenderer() |
AppSettings |
getSettings() |
Timer |
getTimer() |
TouchInput |
getTouchInput() |
JmeContext.Type |
getType() |
protected void |
initInThread() |
boolean |
isCreated() |
boolean |
isRenderable() |
void |
restart()
Destroys and then re-creates the context.
|
void |
run() |
void |
setAutoFlushFrames(boolean enabled) |
void |
setSettings(AppSettings settings) |
void |
setSystemListener(SystemListener listener)
Sets the listener that will receive events relating to context
creation, update, and destroy.
|
void |
setTitle(java.lang.String title)
Sets the title of the display (if available).
|
void |
sync(int fps) |
protected void |
waitFor(boolean createdVal) |
protected static final java.util.logging.Logger logger
protected static final java.lang.String THREAD_NAME
protected java.util.concurrent.atomic.AtomicBoolean created
protected java.util.concurrent.atomic.AtomicBoolean needClose
protected final java.lang.Object createdLock
protected int frameRate
protected AppSettings settings
protected Timer timer
protected SystemListener listener
protected NullRenderer renderer
public JmeContext.Type getType()
getType
in interface JmeContext
public void setSystemListener(SystemListener listener)
JmeContext
setSystemListener
in interface JmeContext
protected void initInThread()
protected void deinitInThread()
public void sync(int fps)
public void run()
run
in interface java.lang.Runnable
public void destroy(boolean waitFor)
JmeContext
destroy
in interface JmeContext
waitFor
- If true, will wait until the context is destroyed fully.public void create(boolean waitFor)
JmeContext
create
in interface JmeContext
waitFor
- If true, will wait until context has initialized.public void restart()
JmeContext
restart
in interface JmeContext
public void setAutoFlushFrames(boolean enabled)
setAutoFlushFrames
in interface JmeContext
enabled
- If enabled, the context will automatically flush
frames to the video card (swap buffers) after an update cycle.public MouseInput getMouseInput()
getMouseInput
in interface JmeContext
public KeyInput getKeyInput()
getKeyInput
in interface JmeContext
public JoyInput getJoyInput()
getJoyInput
in interface JmeContext
public TouchInput getTouchInput()
getTouchInput
in interface JmeContext
public void setTitle(java.lang.String title)
JmeContext
setTitle
in interface JmeContext
title
- The new title of the display.public void create()
public void destroy()
protected void waitFor(boolean createdVal)
public boolean isCreated()
isCreated
in interface JmeContext
public void setSettings(AppSettings settings)
setSettings
in interface JmeContext
settings
- the display settings to use for the created context. If
the context has already been created, then restart()
must be called
for the changes to be applied.public AppSettings getSettings()
getSettings
in interface JmeContext
public Renderer getRenderer()
getRenderer
in interface JmeContext
public Timer getTimer()
getTimer
in interface JmeContext
public boolean isRenderable()
isRenderable
in interface JmeContext
Renderer
are called
while this is false
, then the result is undefined.public Context getOpenCLContext()
getOpenCLContext
in interface JmeContext