|
||||||||||
| 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
public class 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, brightness, contrast, created, depthBits, frq, fs, gamma, height, samples, stencilBits, width |
| Constructor Summary | |
|---|---|
LWJGLDisplaySystem()
Constructor instantiates a new LWJGLDisplaySystem object. |
|
| Method Summary | |
|---|---|
void |
close()
close destroys the LWJGL Display context. |
JMECanvas |
createCanvas(int w,
int h)
createCanvas will create an OpenGL capable Canvas context. |
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. |
TextureRenderer |
createTextureRenderer(int width,
int height,
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()
getAdapter returns the name of the underlying system's
graphics adapter for debugging / display purposes. |
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()
getDriverVersion returns a string representing the version
of driver installed on the underlying system. |
PixelFormat |
getFormat()
Returns a new PixelFormat with the current settings. |
Pbuffer |
getHeadlessDisplay()
Returns the Pbuffer used for headless display or null if not headless. |
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)
|
boolean |
isActive()
isActive returns true if the display is active. |
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 |
moveWindowTo(int locX,
int locY)
If running in windowed mode, move the window's position to the given display coordinates. |
void |
recreateWindow(int w,
int h,
int bpp,
int frq,
boolean fs)
recreateWindow will recreate a LWJGL display context. |
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(Image[] iconImages)
Sets one or more icons for the DisplaySystem. |
void |
setRenderer(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)
setVSyncEnabled attempts to enable or disable monitor
vertical synchronization. |
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. |
protected void |
updateDisplayBGC()
Update the display's gamma, brightness and contrast based on the set values. |
| 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. This is dependent on OS.
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)
throws JmeException
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.
JmeExceptionDisplaySystem.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 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.
createCanvas in class DisplaySystemw - the width/horizontal resolution of the display.h - the height/vertical resolution of the display.DisplaySystem.createCanvas(int, int)
public 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.
createCanvas in class DisplaySystemw - the width/horizontal resolution of the display.h - the height/vertical resolution of the display.type - the type of canvas to make. e.g. "AWT", "SWT".props - the properties we want to use (if any) for constructing our
canvas.DisplaySystem.createCanvas(int, int, String, HashMap)public 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 LWJGLRenderer 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 boolean isActive()
DisplaySystemisActive returns true if the display is active.
isActive in class DisplaySystempublic void reset()
reset prepares the window for closing or restarting.
reset in class DisplaySystemDisplaySystem.reset()public void close()
close destroys the LWJGL Display context.
close in class DisplaySystem
public TextureRenderer createTextureRenderer(int width,
int height,
TextureRenderer.Target target)
createTextureRenderer builds the renderer used to render
to a texture.
createTextureRenderer in class DisplaySystemwidth - width of textureheight - height of texture
public void setRenderer(Renderer r)
setRenderer sets the supplied renderer as this display's
renderer. NOTE: If the supplied renderer is not LWJGLRenderer, then it
is ignored.
setRenderer in class DisplaySystemr - the renderer to set.protected void updateDisplayBGC()
updateDisplayBGC in class DisplaySystempublic void setIcon(Image[] iconImages)
DisplaySystemAs a reference for usual platforms on number of icons and their sizes:
Images should be in format RGBA8888. If they are not jME will try to convert them
using ImageUtils. If that fails a JmeException could be thrown.
setIcon in class DisplaySystemiconImages - Array of Images to be used as icons.DisplaySystem.setIcon(com.jme.image.Image[])public java.lang.String getAdapter()
DisplaySystemgetAdapter returns the name of the underlying system's
graphics adapter for debugging / display purposes.
getAdapter in class DisplaySystempublic java.lang.String getDriverVersion()
DisplaySystemgetDriverVersion returns a string representing the version
of driver installed on the underlying system.
getDriverVersion in class DisplaySystempublic java.lang.String getDisplayVendor()
getDisplayVendor returns the vendor of the graphics
adapter
getDisplayVendor in class DisplaySystempublic java.lang.String getDisplayRenderer()
getDisplayRenderer returns details of the adapter
getDisplayRenderer in class DisplaySystempublic java.lang.String getDisplayAPIVersion()
getDisplayAPIVersion returns the API version supported
getDisplayAPIVersion in class DisplaySystempublic PixelFormat getFormat()
public RenderContext<? extends java.lang.Object> getCurrentContext()
getCurrentContext in class DisplaySystempublic RenderContext<? extends java.lang.Object> switchContext(java.lang.Object contextKey)
contextKey - key identifier
public void initForCanvas(int width,
int height)
public RenderContext<? extends java.lang.Object> removeContext(java.lang.Object contextKey)
contextKey - key identifier
public void moveWindowTo(int locX,
int locY)
DisplaySystem
moveWindowTo in class DisplaySystem
public void initForApplet(int w,
int h)
w - width of the appleth - height of the applet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||