com.threerings.opengl
Class GlDisplayApp

java.lang.Object
  extended by com.threerings.expr.DynamicScope
      extended by com.threerings.opengl.GlApp
          extended by com.threerings.opengl.GlDisplayApp
All Implemented Interfaces:
EditorContext, Scope, ScopeUpdateListener, AlContext, Enqueueable, GlContext

public abstract class GlDisplayApp
extends GlApp

A base class for applications that use LWJGL's Display class.


Field Summary
protected  Root _displayRoot
          Our root.
 
Fields inherited from class com.threerings.opengl.GlApp
_at, _billboardRotation, _camhand, _cfgmgr, _clipprov, _colorpos, _compatibilityMode, _compositor, _epoch, _imgcache, _msgmgr, _now, _renderEffects, _renderer, _renderScheme, _rsrcmgr, _shadcache, _soundmgr, _streamGain, _up, _viewTransform, _viewTransformState, _worldTransform, PIXEL_FORMATS
 
Fields inherited from class com.threerings.expr.DynamicScope
_compoundDepth, _listeners, _owner, _parentScope, _scopeName, _symbols, INVALID_SCOPE
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
GlDisplayApp()
           
 
Method Summary
protected  boolean attemptCreateDisplay()
          Tries each pixel format in sequence until we find one that works.
protected  boolean createDisplay()
          Creates the display with one of the supported pixel formats.
 Root createRoot()
          Creates a user interface root appropriate for this application.
 DisplayMode[] getAvailableDisplayModes()
          Returns an array containing the available display modes.
 RunQueue getRunQueue()
          Returns a reference to the application's run queue.
protected  void init()
          Initializes the view once the OpenGL context is available.
protected  void initRenderer()
          Initializes the renderer.
 void makeCurrent()
          Makes the OpenGL context current.
 void setDisplayMode(DisplayMode mode)
          Sets the display mode and updates the viewport if the display is created.
 void setDisplayModeAndFullscreen(DisplayMode mode)
          Sets the display mode and fullscreen setting at the same time.
 void setFullscreen(boolean fullscreen)
          Sets the fullscreen mode.
 void setIcon(String... paths)
          Sets the display icon.
 void shutdown()
          Shuts down the application.
 void startup()
          Starts up the application.
protected  void updateFrame()
          Updates and renders a single frame.
protected  void willShutdown()
          Override to perform cleanup before the application exits.
 
Methods inherited from class com.threerings.opengl.GlApp
compositeView, createCameraHandler, createSnapshot, didInit, enqueue, getApp, getCameraHandler, getClipProvider, getColorPository, getCompatibilityMode, getCompositor, getConfigManager, getImageCache, getMessageManager, getRenderEffects, getRenderer, getRenderScheme, getResourceManager, getScope, getShaderCache, getSoundManager, getStreamGain, initSharedManagers, renderView, setCameraHandler, setCompatibilityMode, setRenderEffects, setRenderer, setRenderScheme, shouldCheckTimestamps, updateView, updateView, xlate
 
Methods inherited from class com.threerings.expr.DynamicScope
addListener, dispose, endCompoundUpdate, get, getParentScope, getScopeName, put, remove, removeListener, scopeUpdated, setParentScope, startCompoundUpdate, wasUpdated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_displayRoot

protected Root _displayRoot
Our root.

Constructor Detail

GlDisplayApp

public GlDisplayApp()
Method Detail

getAvailableDisplayModes

public DisplayMode[] getAvailableDisplayModes()
Returns an array containing the available display modes.


setDisplayModeAndFullscreen

public void setDisplayModeAndFullscreen(DisplayMode mode)
Sets the display mode and fullscreen setting at the same time.


setDisplayMode

public void setDisplayMode(DisplayMode mode)
Sets the display mode and updates the viewport if the display is created.


setFullscreen

public void setFullscreen(boolean fullscreen)
Sets the fullscreen mode.


setIcon

public void setIcon(String... paths)
Sets the display icon.

Parameters:
paths - the resource paths of the icons to set.

makeCurrent

public void makeCurrent()
Description copied from interface: GlContext
Makes the OpenGL context current.


getRunQueue

public RunQueue getRunQueue()
Description copied from class: GlApp
Returns a reference to the application's run queue.

Specified by:
getRunQueue in class GlApp

createRoot

public Root createRoot()
Description copied from class: GlApp
Creates a user interface root appropriate for this application.

Specified by:
createRoot in class GlApp

startup

public void startup()
Description copied from class: GlApp
Starts up the application.

Specified by:
startup in class GlApp

shutdown

public void shutdown()
Description copied from class: GlApp
Shuts down the application.

Specified by:
shutdown in class GlApp

init

protected void init()
Description copied from class: GlApp
Initializes the view once the OpenGL context is available.

Overrides:
init in class GlApp

willShutdown

protected void willShutdown()
Description copied from class: GlApp
Override to perform cleanup before the application exits.

Overrides:
willShutdown in class GlApp

initRenderer

protected void initRenderer()
Description copied from class: GlApp
Initializes the renderer.

Specified by:
initRenderer in class GlApp

createDisplay

protected boolean createDisplay()
Creates the display with one of the supported pixel formats.

Returns:
true if successful, false if we couldn't find a valid pixel format.

attemptCreateDisplay

protected boolean attemptCreateDisplay()
Tries each pixel format in sequence until we find one that works.

Returns:
true if successful, false if we couldn't find a valid pixel format.

updateFrame

protected void updateFrame()
Updates and renders a single frame.