com.jme3.system
Interface JmeContext

All Known Subinterfaces:
JmeCanvasContext
All Known Implementing Classes:
AwtPanelsContext, LwjglAbstractDisplay, LwjglCanvas, LwjglContext, LwjglDisplay, LwjglOffscreenBuffer, NullContext, OGLESContext

public interface JmeContext

Represents a rendering context within the engine.


Nested Class Summary
static class JmeContext.Type
          The type of context.
 
Method Summary
 void create(boolean waitFor)
          Creates the context and makes it active.
 void destroy(boolean waitFor)
          Destroys the context completely, making it inactive.
 JoyInput getJoyInput()
           
 KeyInput getKeyInput()
           
 MouseInput getMouseInput()
           
 Renderer getRenderer()
           
 AppSettings getSettings()
           
 Timer getTimer()
           
 TouchInput getTouchInput()
           
 JmeContext.Type getType()
           
 boolean isCreated()
           
 boolean isRenderable()
           
 void restart()
          Destroys and then re-creates the context.
 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).
 

Method Detail

getType

JmeContext.Type getType()
Returns:
The type of the context.

setSettings

void setSettings(AppSettings settings)
Parameters:
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.

setSystemListener

void setSystemListener(SystemListener listener)
Sets the listener that will receive events relating to context creation, update, and destroy.


getSettings

AppSettings getSettings()
Returns:
The current display settings. Note that they might be different from the ones set with setDisplaySettings() if the context was restarted or the settings changed internally.

getRenderer

Renderer getRenderer()
Returns:
The renderer for this context, or null if not created yet.

getMouseInput

MouseInput getMouseInput()
Returns:
Mouse input implementation. May be null if not available.

getKeyInput

KeyInput getKeyInput()
Returns:
Keyboard input implementation. May be null if not available.

getJoyInput

JoyInput getJoyInput()
Returns:
Joystick input implementation. May be null if not available.

getTouchInput

TouchInput getTouchInput()
Returns:
Touch device input implementation. May be null if not available.

getTimer

Timer getTimer()
Returns:
The timer for this context, or null if not created yet.

setTitle

void setTitle(java.lang.String title)
Sets the title of the display (if available). This does nothing for fullscreen, headless, or canvas contexts.

Parameters:
title - The new title of the display.

isCreated

boolean isCreated()
Returns:
True if the context has been created but not yet destroyed.

isRenderable

boolean isRenderable()
Returns:
True if the context contains a valid render surface, if any of the rendering methods in Renderer are called while this is false, then the result is undefined.

setAutoFlushFrames

void setAutoFlushFrames(boolean enabled)
Parameters:
enabled - If enabled, the context will automatically flush frames to the video card (swap buffers) after an update cycle.

create

void create(boolean waitFor)
Creates the context and makes it active.

Parameters:
waitFor - If true, will wait until context has initialized.

restart

void restart()
Destroys and then re-creates the context. This should be called after the display settings have been changed.


destroy

void destroy(boolean waitFor)
Destroys the context completely, making it inactive.

Parameters:
waitFor - If true, will wait until the context is destroyed fully.