|
||||||||||
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.jogl.JOGLDisplaySystem
public class JOGLDisplaySystem
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 | |
---|---|
JOGLDisplaySystem()
|
Method Summary | |
---|---|
void |
close()
close shutdowns and destroys any window contexts. |
JMECanvas |
createCanvas(int width,
int height)
createCanvas should create a canvas object with the
desired settings. |
JMECanvas |
createCanvas(int width,
int height,
java.lang.String type,
java.util.HashMap<java.lang.String,java.lang.Object> props)
createCanvas should create a canvas object with the desired
settings. |
static JOGLAWTCanvas |
createGLCanvas()
|
void |
createHeadlessWindow(int w,
int h,
int bpp)
createHeadlessWindow creates a headless window with the
desired settings. |
TextureRenderer |
createTextureRenderer(int width,
int height,
TextureRenderer.Target target)
Create a TextureRenderer using the underlying system. |
void |
createWindow(int width,
int height,
int bpp,
int frq,
boolean fs)
createWindow creates a window with the desired settings. |
java.lang.String |
getAdapter()
getAdapter returns the name of the underlying system's
graphics adapter for debugging / display purposes. |
RenderContext<GLContext> |
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. |
JOGLRenderer |
getRenderer()
getRenderer returns the Renderer
implementation that is compatible with the chosen
DisplaySystem . |
void |
initForCanvas(int width,
int height)
This will be called from a GLEventListener, meaning that the Component will have been realized and the
GLContext will already have been made current. |
boolean |
isActive()
isActive returns true if the display is active. |
boolean |
isClosing()
isClosing notifies if the window is currently closing. |
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 recreates a window with the desired
settings. |
RenderContext<GLContext> |
removeContext(GLContext contextKey)
|
void |
reset()
reset cleans up the display system for closing or
restarting. |
void |
setIcon(Image[] iconImages)
Sets one or more icons for the DisplaySystem. |
void |
setRenderer(Renderer renderer)
setRenderer sets the Renderer object that
is to be used by this display. |
void |
setTitle(java.lang.String title)
Sets the title of the display system. |
void |
setVSyncEnabled(boolean enabled)
setVSyncEnabled attempts to enable or disable monitor
vertical synchronization. |
RenderContext<GLContext> |
switchContext(GLContext 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 |
---|
JOGLDisplaySystem()
Method Detail |
---|
public void createWindow(int width, int height, int bpp, int frq, boolean fs)
DisplaySystem
createWindow
creates a window with the desired settings.
The width and height defined by w and h define the size of the window if
fullscreen is false, otherwise it defines the resolution of the
fullscreen display. The color depth is defined by bpp. The implementing
class should only allow 16, 24, and 32. The monitor frequency is defined
by the frq parameter and should not exceed the capabilities of the
connected hardware, the implementing class should attempt to assure this
does not happen. Lastly, the boolean flag fs determines if the display
should be windowed or fullscreen. If false, windowed is chosen. This
window will be placed in the center of the screen initially. If true
fullscreen mode will be entered with the appropriate settings.
createWindow
in class DisplaySystem
width
- the width/horizontal resolution of the display.height
- 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.public JMECanvas createCanvas(int width, int height)
DisplaySystem
createCanvas
should create a canvas object with the
desired settings. The width and height defined by w and h define the size
of the canvas. Makes an AWT canvas by default.
createCanvas
in class DisplaySystem
width
- the width/horizontal resolution of the display.height
- the height/vertical resolution of the display.public JMECanvas createCanvas(int width, int height, java.lang.String type, java.util.HashMap<java.lang.String,java.lang.Object> props)
DisplaySystem
createCanvas
should create a canvas object with the desired
settings. The width and height defined by w and h define the size of the
canvas.
createCanvas
in class DisplaySystem
width
- the width/horizontal resolution of the display.height
- 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.public void createHeadlessWindow(int w, int h, int bpp)
DisplaySystem
createHeadlessWindow
creates a headless window with the
desired settings. A headless window is a rendering target that is not
shown on screen. It is useful for doing offline rendering, integration
and so forth. You can not have a regular and headless window at the same
time. The width and height defined by w and h define the size of the
window. The color depth is defined by bpp.
createHeadlessWindow
in class DisplaySystem
w
- the width/horizontal resolution of the display.h
- the height/vertical resolution of the display.bpp
- the color depth of the display.public TextureRenderer createTextureRenderer(int width, int height, TextureRenderer.Target target)
DisplaySystem
createTextureRenderer
in class DisplaySystem
width
- width of textureheight
- height of texture
public static JOGLAWTCanvas createGLCanvas()
public JOGLRenderer getRenderer()
DisplaySystem
getRenderer
returns the Renderer
implementation that is compatible with the chosen
DisplaySystem
. For example, if
LWJGLDisplaySystem
is used, the returned
Renderer
will be LWJGLRenderer.
getRenderer
in class DisplaySystem
Renderer
implementation that is
compatible with the used DisplaySystem
.Renderer
public void setTitle(java.lang.String title)
DisplaySystem
setTitle
in class DisplaySystem
title
- The new display title.public java.lang.String getAdapter()
DisplaySystem
getAdapter
returns the name of the underlying system's
graphics adapter for debugging / display purposes.
getAdapter
in class DisplaySystem
public RenderContext<GLContext> getCurrentContext()
getCurrentContext
in class DisplaySystem
public java.lang.String getDisplayAPIVersion()
DisplaySystem
getDisplayAPIVersion
returns the API version supported
getDisplayAPIVersion
in class DisplaySystem
public java.lang.String getDisplayRenderer()
DisplaySystem
getDisplayRenderer
returns details of the adapter
getDisplayRenderer
in class DisplaySystem
public java.lang.String getDisplayVendor()
DisplaySystem
getDisplayVendor
returns the vendor of the graphics
adapter
getDisplayVendor
in class DisplaySystem
public java.lang.String getDriverVersion()
DisplaySystem
getDriverVersion
returns a string representing the version
of driver installed on the underlying system.
getDriverVersion
in class DisplaySystem
public void initForCanvas(int width, int height)
Component
will have been realized and the
GLContext
will already have been made current.
public boolean isActive()
DisplaySystem
isActive
returns true if the display is active.
isActive
in class DisplaySystem
public boolean isClosing()
DisplaySystem
isClosing
notifies if the window is currently closing.
This could be caused via the application itself or external interrupts
such as alt-f4 etc.
isClosing
in class DisplaySystem
public boolean isValidDisplayMode(int width, int height, int bpp, int freq)
DisplaySystem
isValidDisplayMode
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 DisplaySystem
width
- 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).public void moveWindowTo(int locX, int locY)
DisplaySystem
moveWindowTo
in class DisplaySystem
public void recreateWindow(int w, int h, int bpp, int frq, boolean fs)
DisplaySystem
recreateWindow
recreates a window with the desired
settings.
recreateWindow
in class DisplaySystem
w
- 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.public void reset()
DisplaySystem
reset
cleans up the display system for closing or
restarting.
reset
in class DisplaySystem
public void setIcon(Image[] iconImages)
DisplaySystem
As 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 DisplaySystem
iconImages
- Array of Images to be used as icons.public void setRenderer(Renderer renderer)
DisplaySystem
setRenderer
sets the Renderer
object that
is to be used by this display. The implementing class should take
measures to insure that the given Renderer is compatible with the
Display.
setRenderer
in class DisplaySystem
renderer
- the Renderer to set for this display.public void setVSyncEnabled(boolean enabled)
DisplaySystem
setVSyncEnabled
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 dependant on OS.
setVSyncEnabled
in class DisplaySystem
enabled
- true
to synchronize, false
to
ignore synchronizationprotected void updateDisplayBGC()
DisplaySystem
updateDisplayBGC
in class DisplaySystem
public void close()
DisplaySystem
close
shutdowns and destroys any window contexts.
close
in class DisplaySystem
public RenderContext<GLContext> switchContext(GLContext contextKey)
contextKey
- key identifier
public RenderContext<GLContext> removeContext(GLContext contextKey)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |