|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jme.system.DisplaySystem
com.jme.system.lwjgl.LWJGLDisplaySystem
LWJGLDisplaySystem defines an implementation of
DisplaySystem that uses the LWJGL API for window creation and
rendering via OpenGL. LWJGLRenderer is also created that gives
a way of displaying data to the created window.
| Field Summary |
| Fields inherited from class com.jme.system.DisplaySystem |
alphaBits, bpp, created, depthBits, frq, fs, height, rendererNames, samples, stencilBits, width |
| Constructor Summary | |
LWJGLDisplaySystem()
Constructor instantiates a new LWJGLDisplaySystem object. |
|
| Method Summary | |
void |
close()
close shutdowns and destroys any window contexts. |
java.awt.Canvas |
createCanvas(int w,
int h)
createCanvas will create an AWTGLCanvas
context. |
void |
createHeadlessWindow(int w,
int h,
int bpp)
createHeadlessWindow will create a headless LWJGL display
context. |
TextureRenderer |
createTextureRenderer(int width,
int height,
boolean useRGB,
boolean useRGBA,
boolean useDepth,
boolean isRectangle,
int target,
int mipmaps)
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. |
WidgetFont |
getFont(java.lang.String fontName)
|
org.lwjgl.opengl.Pbuffer |
getHeadlessDisplay()
Returns the Pbuffer used for headless display or null if not headless. |
Renderer |
getRenderer()
getRenderer returns the created rendering class for LWJGL (
LWJGLRenderer). |
RendererType |
getRendererType()
getRendererType |
Vector3f |
getScreenCoordinates(Vector3f worldPosition)
getScreenCoordinates translate world to screen coordinates. |
Vector3f |
getScreenCoordinates(Vector3f worldPosition,
Vector3f store)
getScreenCoordinates translate world to screen coordinates. |
Vector3f |
getWorldCoordinates(Vector2f screenPosition,
float zPos)
getWorldCoordinates translate screen to world coordinates. |
Vector3f |
getWorldCoordinates(Vector2f screenPosition,
float zPos,
Vector3f store)
getWorldCoordinates translate screen to world coordinates. |
boolean |
isClosing()
isClosing returns any close requests. |
boolean |
isValidDisplayMode(int width,
int height,
int bpp,
int freq)
isValidDisplayMode determines if the given parameters
constitute a valid display mode on this system. |
void |
recreateWindow(int w,
int h,
int bpp,
int frq,
boolean fs)
recreateWindow will recreate a LWJGL display context. |
void |
reset()
reset prepares the window for closing or restarting. |
void |
setRenderer(Renderer r)
|
void |
setTitle(java.lang.String title)
setTitle sets the window title of the created window. |
void |
setVSyncEnabled(boolean enabled)
setVSyncEnabled attempts to enable or disable monitor
vertical synchronization. |
| Methods inherited from class com.jme.system.DisplaySystem |
getBitDepth, getDisplaySystem, getDisplaySystem, getFrequency, getHeight, getMinAlphaBits, getMinDepthBits, getMinSamples, getMinStencilBits, getWidth, isCreated, isFullScreen, setMinAlphaBits, setMinDepthBits, setMinSamples, setMinStencilBits, updateStates |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public LWJGLDisplaySystem()
LWJGLDisplaySystem object.
During instantiation confirmation is made to determine if the LWJGL API
is installed properly. If not, a JmeException is thrown.
| Method Detail |
public boolean isValidDisplayMode(int width,
int height,
int bpp,
int freq)
DisplaySystemisValidDisplayMode determines if the given parameters
constitute a valid display mode on this system. Returning true does not
necessarily guarantee that the system is capable of running in the
specified display mode, merely that it believes it is possible.
isValidDisplayMode in class DisplaySystemwidth - the width/horizontal resolution of the display.height - the height/vertical resolution of the display.bpp - the bit depth of the display.freq - the frequency of refresh of the display (in Hz).DisplaySystem.isValidDisplayMode(int, int, int, int)public void setVSyncEnabled(boolean enabled)
DisplaySystemsetVSyncEnabled attempts to enable or disable monitor
vertical synchronization. The method is a "best attempt" to change the
monitor vertical refresh synchronization, and is not guaranteed
to be successful.
setVSyncEnabled in class DisplaySystemenabled - true to synchronize, false to
ignore synchronizationDisplaySystem.setVSyncEnabled(boolean)public void setTitle(java.lang.String title)
setTitle sets the window title of the created window.
setTitle in class DisplaySystemtitle - the title.
public void createWindow(int w,
int h,
int bpp,
int frq,
boolean fs)
createWindow will create a LWJGL display context. This
window will be a purely native context as defined by the LWJGL API.
createWindow in class DisplaySystemw - the width/horizontal resolution of the display.h - the height/vertical resolution of the display.bpp - the color depth of the display.frq - the frequency of refresh of the display.fs - flag determining if fullscreen is to be used or not. True will
use fullscreen, false will use windowed mode.DisplaySystem.createWindow(int, int, int, int,
boolean)
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.
createHeadlessWindow in class DisplaySystemw - the width/horizontal resolution of the display.h - the height/vertical resolution of the display.bpp - the color depth of the display.DisplaySystem.createHeadlessWindow(int, int, int)
public java.awt.Canvas createCanvas(int w,
int h)
createCanvas will create an AWTGLCanvas
context. This window will be a purely native context as defined by
the LWJGL API.
createCanvas in class DisplaySystemw - the width/horizontal resolution of the display.h - the height/vertical resolution of the display.DisplaySystem.createCanvas(int, int)public org.lwjgl.opengl.Pbuffer getHeadlessDisplay()
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)
recreateWindow in class DisplaySystemw - the width/horizontal resolution of the display.h - the height/vertical resolution of the display.bpp - the color depth of the display.frq - the frequency of refresh of the display.fs - flag determining if fullscreen is to be used or not. True will
use fullscreen, false will use windowed mode.DisplaySystem.recreateWindow(int, int, int, int,
boolean)public Renderer getRenderer()
getRenderer returns the created rendering class for LWJGL (
LWJGLRenderer). This will give the needed access to
display data to the window.
getRenderer in class DisplaySystemRenderer implementation that is
compatible with the used DisplaySystem.DisplaySystem.getRenderer()public boolean isClosing()
isClosing returns any close requests. True if any exist,
false otherwise.
isClosing in class DisplaySystemDisplaySystem.isClosing()public void reset()
reset prepares the window for closing or restarting.
reset in class DisplaySystemDisplaySystem.reset()public void close()
DisplaySystemclose shutdowns and destroys any window contexts.
close in class DisplaySystempublic WidgetFont getFont(java.lang.String fontName)
getFont in class DisplaySystemfontName - -
name of the font to loaded
public RendererType getRendererType()
getRendererType
getRendererType in class DisplaySystemJmeType
public TextureRenderer createTextureRenderer(int width,
int height,
boolean useRGB,
boolean useRGBA,
boolean useDepth,
boolean isRectangle,
int target,
int mipmaps)
createTextureRenderer builds the renderer used to render
to a texture.
createTextureRenderer in class DisplaySystemwidth - width of textureheight - height of textureuseRGB - if this is true, useRGBA should not beuseRGBA - if this is true, useRGB should not beuseDepth - isRectangle - target - mipmaps -
public Vector3f getScreenCoordinates(Vector3f worldPosition)
getScreenCoordinates translate world to screen coordinates.
Written by Marius, rewritten for LWJGL .9 by Joshua Slack.
getScreenCoordinates in class DisplaySystemworldPosition - the world position to translate.
public Vector3f getScreenCoordinates(Vector3f worldPosition,
Vector3f store)
getScreenCoordinates translate world to screen coordinates.
Written by Marius, rewritten for LWJGL .9 by Joshua Slack.
getScreenCoordinates in class DisplaySystemworldPosition - the world position to translate.store - Vector3f to store the world position in.
public Vector3f getWorldCoordinates(Vector2f screenPosition,
float zPos)
getWorldCoordinates translate screen to world coordinates.
Written by Marius, rewritten for lwjgl .9 by Joshua Slack.
getWorldCoordinates in class DisplaySystemscreenPosition - the screen coordinates to translate.zPos - between 0 and 1.
public Vector3f getWorldCoordinates(Vector2f screenPosition,
float zPos,
Vector3f store)
getWorldCoordinates translate screen to world coordinates.
Written by Marius, rewritten for lwjgl .9 by Jashua Slack.
getWorldCoordinates in class DisplaySystemscreenPosition - the screen coordinates to translate.zPos - between 0 and 1.store - Vector3f The vector to store the result in.
public void setRenderer(Renderer r)
setRenderer in class DisplaySystem
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||