com.jme.system.lwjgl
Class LWJGLDisplaySystem

java.lang.Object
  extended by com.jme.system.DisplaySystem
      extended by com.jme.system.lwjgl.LWJGLDisplaySystem

public class LWJGLDisplaySystem
extends com.jme.system.DisplaySystem

Modified to use an alternative pixel format constructor which enable stereo when needed.


Constructor Summary
LWJGLDisplaySystem()
          Constructor instantiates a new LWJGLDisplaySystem object.
 
Method Summary
 void close()
          close destroys the LWJGL Display context.
 com.jme.system.canvas.JMECanvas createCanvas(int w, int h)
          createCanvas will create an OpenGL capable Canvas context.
 com.jme.system.canvas.JMECanvas createCanvas(int w, int h, java.lang.String type, java.util.HashMap<java.lang.String,java.lang.Object> props)
          createCanvas will create an OpenGL capable Canvas context.
 void createHeadlessWindow(int w, int h, int bpp)
          createHeadlessWindow will create a headless LWJGL display context.
 com.jme.renderer.TextureRenderer createTextureRenderer(int width, int height, com.jme.renderer.TextureRenderer.Target target)
          createTextureRenderer builds the renderer used to render to a texture.
 void createWindow(int w, int h, int bpp, int frq, boolean fs)
          createWindow will create a LWJGL display context.
 java.lang.String getAdapter()
           
 com.jme.renderer.RenderContext<? extends java.lang.Object> getCurrentContext()
           
 java.lang.String getDisplayAPIVersion()
          getDisplayAPIVersion returns the API version supported.
 java.lang.String getDisplayRenderer()
          getDisplayRenderer returns details of the adapter.
 java.lang.String getDisplayVendor()
          getDisplayVendor returns the vendor of the graphics adapter.
 java.lang.String getDriverVersion()
           
 org.lwjgl.opengl.PixelFormat getFormat()
          Returns a new PixelFormat with the current settings.
 org.lwjgl.opengl.Pbuffer getHeadlessDisplay()
          Returns the Pbuffer used for headless display or null if not headless.
 com.jme.renderer.lwjgl.LWJGLRenderer getRenderer()
          getRenderer returns the created rendering class for LWJGL ( LWJGLRenderer).
 void initForApplet(int w, int h)
          Initializes the displaysystem for use in Applets.
 void initForCanvas(int width, int height)
          Inits the for canvas.
 boolean isActive()
           
 boolean isClosing()
          isClosing returns any close requests.
 boolean isValidDisplayMode(int width, int height, int bpp, int freq)
          Checks if is valid display mode.
 void moveWindowTo(int locX, int locY)
           
 void recreateWindow(int w, int h, int bpp, int frq, boolean fs)
          recreateWindow will recreate a LWJGL display context.
 com.jme.renderer.RenderContext<? extends java.lang.Object> removeContext(java.lang.Object contextKey)
          Switches to another RenderContext identified by the contextKey or to a new RenderContext if none is provided.
 void reset()
          reset prepares the window for closing or restarting.
 void setIcon(com.jme.image.Image[] iconImages)
          Sets the icon.
 void setRenderer(com.jme.renderer.Renderer r)
          setRenderer sets the supplied renderer as this display's renderer.
 void setTitle(java.lang.String title)
          setTitle sets the window title of the created window.
 void setVSyncEnabled(boolean enabled)
          Sets the v sync enabled.
 com.jme.renderer.RenderContext<? extends java.lang.Object> switchContext(java.lang.Object contextKey)
          Switches to another RenderContext identified by the contextKey or to a new RenderContext if none is provided.
 
Methods inherited from class com.jme.system.DisplaySystem
getBitDepth, getBrightness, getContrast, getDisplaySystem, getDisplaySystem, getFrequency, getGamma, getHeight, getMinAlphaBits, getMinDepthBits, getMinSamples, getMinStencilBits, getPickRay, getScreenCoordinates, getScreenCoordinates, getSystemProvider, getSystemProviderIdentifiers, getWidth, getWorldCoordinates, getWorldCoordinates, isCreated, isFullScreen, makeCanvasConstructor, registerCanvasConstructor, resetSystemProvider, setBrightness, setBrightnessGammaContrast, setContrast, setGamma, setHeight, setMinAlphaBits, setMinDepthBits, setMinSamples, setMinStencilBits, setSystemProvider, setWidth, updateStates
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LWJGLDisplaySystem

public LWJGLDisplaySystem()
Constructor instantiates a new LWJGLDisplaySystem object. During instantiation confirmation is made to determine if the LWJGL API is installed properly. If not, a JmeException is thrown.

Method Detail

close

public void close()
close destroys the LWJGL Display context.

Specified by:
close in class com.jme.system.DisplaySystem

createCanvas

public com.jme.system.canvas.JMECanvas createCanvas(int w,
                                                    int h)
createCanvas will create an OpenGL capable Canvas context. This window will be a purely native context as defined by the LWJGL API.

Overrides:
createCanvas in class com.jme.system.DisplaySystem
Parameters:
w - the w
h - the h
Returns:
the JME canvas
See Also:
DisplaySystem.createCanvas(int, int)

createCanvas

public com.jme.system.canvas.JMECanvas createCanvas(int w,
                                                    int h,
                                                    java.lang.String type,
                                                    java.util.HashMap<java.lang.String,java.lang.Object> props)
createCanvas will create an OpenGL capable Canvas context. This window will be a purely native context as defined by the LWJGL API.

Specified by:
createCanvas in class com.jme.system.DisplaySystem
Parameters:
w - the w
h - the h
type - the type
props - the props
Returns:
the JME canvas
See Also:
DisplaySystem.createCanvas(int, int, String, HashMap)

createHeadlessWindow

public void createHeadlessWindow(int w,
                                 int h,
                                 int bpp)
createHeadlessWindow will create a headless LWJGL display context. This window will be a purely native context as defined by the LWJGL API.

Specified by:
createHeadlessWindow in class com.jme.system.DisplaySystem
Parameters:
w - the w
h - the h
bpp - the bpp
See Also:
DisplaySystem.createHeadlessWindow(int, int, int)

createTextureRenderer

public com.jme.renderer.TextureRenderer createTextureRenderer(int width,
                                                              int height,
                                                              com.jme.renderer.TextureRenderer.Target target)
createTextureRenderer builds the renderer used to render to a texture.

Specified by:
createTextureRenderer in class com.jme.system.DisplaySystem
Parameters:
width - the width
height - the height
target - the target
Returns:
the texture renderer

createWindow

public void createWindow(int w,
                         int h,
                         int bpp,
                         int frq,
                         boolean fs)
                  throws com.jme.system.JmeException
createWindow will create a LWJGL display context. This window will be a purely native context as defined by the LWJGL API.

Specified by:
createWindow in class com.jme.system.DisplaySystem
Parameters:
w - the w
h - the h
bpp - the bpp
frq - the frq
fs - the fs
Throws:
com.jme.system.JmeException - the jme exception
See Also:
DisplaySystem.createWindow(int, int, int, int, boolean)

getAdapter

public java.lang.String getAdapter()
Specified by:
getAdapter in class com.jme.system.DisplaySystem

getCurrentContext

public com.jme.renderer.RenderContext<? extends java.lang.Object> getCurrentContext()
Specified by:
getCurrentContext in class com.jme.system.DisplaySystem

getDisplayAPIVersion

public java.lang.String getDisplayAPIVersion()
getDisplayAPIVersion returns the API version supported.

Specified by:
getDisplayAPIVersion in class com.jme.system.DisplaySystem
Returns:
The api version supported

getDisplayRenderer

public java.lang.String getDisplayRenderer()
getDisplayRenderer returns details of the adapter.

Specified by:
getDisplayRenderer in class com.jme.system.DisplaySystem
Returns:
The adapter details

getDisplayVendor

public java.lang.String getDisplayVendor()
getDisplayVendor returns the vendor of the graphics adapter.

Specified by:
getDisplayVendor in class com.jme.system.DisplaySystem
Returns:
The adapter vendor

getDriverVersion

public java.lang.String getDriverVersion()
Specified by:
getDriverVersion in class com.jme.system.DisplaySystem

getFormat

public org.lwjgl.opengl.PixelFormat getFormat()
Returns a new PixelFormat with the current settings.

Returns:
a new PixelFormat with the current settings

getHeadlessDisplay

public org.lwjgl.opengl.Pbuffer getHeadlessDisplay()
Returns the Pbuffer used for headless display or null if not headless.

Returns:
Pbuffer

getRenderer

public com.jme.renderer.lwjgl.LWJGLRenderer getRenderer()
getRenderer returns the created rendering class for LWJGL ( LWJGLRenderer). This will give the needed access to display data to the window.

Specified by:
getRenderer in class com.jme.system.DisplaySystem
Returns:
the renderer
See Also:
DisplaySystem.getRenderer()

initForApplet

public void initForApplet(int w,
                          int h)
Initializes the displaysystem for use in Applets.

Parameters:
w - width of the applet
h - height of the applet

initForCanvas

public void initForCanvas(int width,
                          int height)
Inits the for canvas.

Parameters:
width - the width
height - the height

isActive

public boolean isActive()
Specified by:
isActive in class com.jme.system.DisplaySystem

isClosing

public boolean isClosing()
isClosing returns any close requests. True if any exist, false otherwise.

Specified by:
isClosing in class com.jme.system.DisplaySystem
Returns:
true if a close request is active.
See Also:
DisplaySystem.isClosing()

isValidDisplayMode

public boolean isValidDisplayMode(int width,
                                  int height,
                                  int bpp,
                                  int freq)
Checks if is valid display mode.

Specified by:
isValidDisplayMode in class com.jme.system.DisplaySystem
Parameters:
width - the width
height - the height
bpp - the bpp
freq - the freq
Returns:
true, if is valid display mode
See Also:
DisplaySystem.isValidDisplayMode(int, int, int, int)

moveWindowTo

public void moveWindowTo(int locX,
                         int locY)
Specified by:
moveWindowTo in class com.jme.system.DisplaySystem

recreateWindow

public void recreateWindow(int w,
                           int h,
                           int bpp,
                           int frq,
                           boolean fs)
recreateWindow will recreate a LWJGL display context. This window will be a purely native context as defined by the LWJGL API.

If a window is not already created, it calls createWindow and exits. Other wise it calls reinitDisplay and renderer.reinit(width,height)

Specified by:
recreateWindow in class com.jme.system.DisplaySystem
Parameters:
w - the w
h - the h
bpp - the bpp
frq - the frq
fs - the fs
See Also:
DisplaySystem.recreateWindow(int, int, int, int, boolean)

removeContext

public com.jme.renderer.RenderContext<? extends java.lang.Object> removeContext(java.lang.Object contextKey)
Switches to another RenderContext identified by the contextKey or to a new RenderContext if none is provided.

Parameters:
contextKey - key identifier
Returns:
RenderContext identified by the contextKey or new RenderContext if none provided

reset

public void reset()
reset prepares the window for closing or restarting.

Specified by:
reset in class com.jme.system.DisplaySystem
See Also:
DisplaySystem.reset()

setIcon

public void setIcon(com.jme.image.Image[] iconImages)
Sets the icon.

Specified by:
setIcon in class com.jme.system.DisplaySystem
Parameters:
iconImages - the new icon
See Also:
DisplaySystem.setIcon(com.jme.image.Image[])

setRenderer

public void setRenderer(com.jme.renderer.Renderer r)
setRenderer sets the supplied renderer as this display's renderer. NOTE: If the supplied renderer is not LWJGLRenderer, then it is ignored.

Specified by:
setRenderer in class com.jme.system.DisplaySystem
Parameters:
r - the renderer to set.

setTitle

public void setTitle(java.lang.String title)
setTitle sets the window title of the created window.

Specified by:
setTitle in class com.jme.system.DisplaySystem
Parameters:
title - the title.

setVSyncEnabled

public void setVSyncEnabled(boolean enabled)
Sets the v sync enabled.

Specified by:
setVSyncEnabled in class com.jme.system.DisplaySystem
Parameters:
enabled - the new v sync enabled
See Also:
DisplaySystem.setVSyncEnabled(boolean)

switchContext

public com.jme.renderer.RenderContext<? extends java.lang.Object> switchContext(java.lang.Object contextKey)
Switches to another RenderContext identified by the contextKey or to a new RenderContext if none is provided.

Parameters:
contextKey - key identifier
Returns:
RenderContext identified by the contextKey or new RenderContext if none provided