|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.GameContainer org.newdawn.slick.AppGameContainer
public class AppGameContainer
A game container that will display the game as an stand alone application.
Field Summary | |
---|---|
protected boolean |
alphaSupport
Alpha background supported |
protected org.lwjgl.opengl.DisplayMode |
originalDisplayMode
The original display mode before we tampered with things |
protected org.lwjgl.opengl.DisplayMode |
targetDisplayMode
The display mode we're going to try and use |
protected boolean |
updateOnlyOnVisible
True if we should update the game only when the display is visible |
Fields inherited from class org.newdawn.slick.GameContainer |
---|
alwaysRender, clearEachFrame, forceExit, fps, game, GL, height, input, lastFPS, lastFrame, lastGame, maximumLogicInterval, minimumLogicInterval, paused, recordedFPS, running, samples, SHARED_DRAWABLE, smoothDeltas, stencil, storedDelta, supportsMultiSample, targetFPS, vsync, width |
Constructor Summary | |
---|---|
AppGameContainer(Game game)
Create a new container wrapping a game |
|
AppGameContainer(Game game,
int width,
int height,
boolean fullscreen)
Create a new container wrapping a game |
Method Summary | |
---|---|
void |
destroy()
Destroy the app game container |
protected void |
gameLoop()
Strategy for overloading game loop context handling |
int |
getScreenHeight()
Get the height of the standard screen resolution |
int |
getScreenWidth()
Get the width of the standard screen resolution |
boolean |
hasFocus()
Check if the game currently has focus |
boolean |
isFullscreen()
Check if the display is in fullscreen mode |
boolean |
isMouseGrabbed()
Check if the mouse cursor is current grabbed. |
boolean |
isUpdatingOnlyWhenVisible()
Check if this game is only updating when visible to the user (default = true) |
void |
reinit()
Renitialise the game and the context in which it's being rendered |
void |
setDefaultMouseCursor()
Set the default mouse cursor - i.e. |
void |
setDisplayMode(int width,
int height,
boolean fullscreen)
Set the display mode to be used |
void |
setFullscreen(boolean fullscreen)
Indicate whether we want to be in fullscreen mode. |
void |
setIcon(java.lang.String ref)
Set the icon to be displayed if possible in this type of container |
void |
setIcons(java.lang.String[] refs)
Set the icons to be used for this application. |
void |
setMouseCursor(org.lwjgl.input.Cursor cursor,
int hotSpotX,
int hotSpotY)
Set the mouse cursor to be displayed - this is a hardware cursor and hence shouldn't have any impact on FPS. |
void |
setMouseCursor(ImageData data,
int hotSpotX,
int hotSpotY)
Set the mouse cursor to be displayed - this is a hardware cursor and hence shouldn't have any impact on FPS. |
void |
setMouseCursor(Image image,
int hotSpotX,
int hotSpotY)
Set the mouse cursor based on the contents of the image. |
void |
setMouseCursor(java.lang.String ref,
int hotSpotX,
int hotSpotY)
Set the mouse cursor to be displayed - this is a hardware cursor and hence shouldn't have any impact on FPS. |
void |
setMouseGrabbed(boolean grabbed)
Indicate whether mouse cursor should be grabbed or not |
void |
setTitle(java.lang.String title)
Set the title of the window |
protected void |
setup()
Setup the environment |
void |
setUpdateOnlyWhenVisible(boolean updateOnlyWhenVisible)
Indicate if the display should update only when the game is visible (the default is true) |
void |
start()
Start running the game |
boolean |
supportsAlphaInBackBuffer()
Check if the display created supported alpha in the back buffer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.lwjgl.opengl.DisplayMode originalDisplayMode
protected org.lwjgl.opengl.DisplayMode targetDisplayMode
protected boolean updateOnlyOnVisible
protected boolean alphaSupport
Constructor Detail |
---|
public AppGameContainer(Game game) throws SlickException
game
- The game to be wrapped
SlickException
- Indicates a failure to initialise the displaypublic AppGameContainer(Game game, int width, int height, boolean fullscreen) throws SlickException
game
- The game to be wrappedwidth
- The width of the display requiredheight
- The height of the display requiredfullscreen
- True if we want fullscreen mode
SlickException
- Indicates a failure to initialise the displayMethod Detail |
---|
public boolean supportsAlphaInBackBuffer()
public void setTitle(java.lang.String title)
title
- The title to set on the windowpublic void setDisplayMode(int width, int height, boolean fullscreen) throws SlickException
width
- The width of the display requiredheight
- The height of the display requiredfullscreen
- True if we want fullscreen mode
SlickException
- Indicates a failure to initialise the displaypublic boolean isFullscreen()
isFullscreen
in class GameContainer
public void setFullscreen(boolean fullscreen) throws SlickException
setFullscreen
in class GameContainer
fullscreen
- True if we want to be in fullscreen mode
SlickException
- Indicates we failed to change the display modepublic void setMouseCursor(java.lang.String ref, int hotSpotX, int hotSpotY) throws SlickException
GameContainer
setMouseCursor
in interface GUIContext
setMouseCursor
in class GameContainer
ref
- The location of the image to be loaded for the cursorhotSpotX
- The x coordinate of the hotspot within the cursor imagehotSpotY
- The y coordinate of the hotspot within the cursor image
SlickException
- Indicates a failure to load the cursor image or create the hardware cursorGameContainer.setMouseCursor(java.lang.String, int, int)
public void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY) throws SlickException
GameContainer
setMouseCursor
in interface GUIContext
setMouseCursor
in class GameContainer
data
- The image data from which the cursor can be construtedhotSpotX
- The x coordinate of the hotspot within the cursor imagehotSpotY
- The y coordinate of the hotspot within the cursor image
SlickException
- Indicates a failure to load the cursor image or create the hardware cursorGameContainer.setMouseCursor(org.newdawn.slick.opengl.ImageData, int, int)
public void setMouseCursor(org.lwjgl.input.Cursor cursor, int hotSpotX, int hotSpotY) throws SlickException
GameContainer
setMouseCursor
in interface GUIContext
setMouseCursor
in class GameContainer
cursor
- The cursor to usehotSpotX
- The x coordinate of the hotspot within the cursor imagehotSpotY
- The y coordinate of the hotspot within the cursor image
SlickException
- Indicates a failure to load the cursor image or create the hardware cursorGameContainer.setMouseCursor(org.lwjgl.input.Cursor, int, int)
public void setMouseCursor(Image image, int hotSpotX, int hotSpotY) throws SlickException
GameContainer
setMouseCursor
in class GameContainer
image
- The image to use as the cursorhotSpotX
- The x coordinate of the hotspot within the cursor imagehotSpotY
- The y coordinate of the hotspot within the cursor image
SlickException
- Indicates a failure to load the cursor image or create the hardware cursorGameContainer.setMouseCursor(org.newdawn.slick.Image, int, int)
public void reinit() throws SlickException
GameContainer
reinit
in class GameContainer
SlickException
- Indicates a failure rerun initialisation routinesGameContainer.reinit()
public void start() throws SlickException
SlickException
- Indicates a failure to initialise the systemprotected void setup() throws SlickException
SlickException
- Indicates a failureprotected void gameLoop() throws SlickException
SlickException
- Indicates a game failurepublic void setUpdateOnlyWhenVisible(boolean updateOnlyWhenVisible)
GameContainer
setUpdateOnlyWhenVisible
in class GameContainer
updateOnlyWhenVisible
- True if we should updated only when the display is visibleGameContainer.setUpdateOnlyWhenVisible(boolean)
public boolean isUpdatingOnlyWhenVisible()
GameContainer
isUpdatingOnlyWhenVisible
in class GameContainer
GameContainer.isUpdatingOnlyWhenVisible()
public void setIcon(java.lang.String ref) throws SlickException
GameContainer
setIcon
in class GameContainer
ref
- The reference to the icon to be displayed
SlickException
- Indicates a failure to load the iconGameContainer.setIcon(java.lang.String)
public void setMouseGrabbed(boolean grabbed)
GameContainer
setMouseGrabbed
in class GameContainer
grabbed
- True if mouse cursor should be grabbedGameContainer.setMouseGrabbed(boolean)
public boolean isMouseGrabbed()
GameContainer
isMouseGrabbed
in class GameContainer
GameContainer.isMouseGrabbed()
public boolean hasFocus()
GameContainer
hasFocus
in class GameContainer
GameContainer.hasFocus()
public int getScreenHeight()
GameContainer
getScreenHeight
in interface GUIContext
getScreenHeight
in class GameContainer
GameContainer.getScreenHeight()
public int getScreenWidth()
GameContainer
getScreenWidth
in interface GUIContext
getScreenWidth
in class GameContainer
GameContainer.getScreenWidth()
public void destroy()
public void setIcons(java.lang.String[] refs) throws SlickException
GameContainer
setIcons
in class GameContainer
refs
- The reference to the icon to be displayed
SlickException
- Indicates a failure to load the iconGameContainer.setIcons(java.lang.String[])
public void setDefaultMouseCursor()
GameContainer
setDefaultMouseCursor
in interface GUIContext
setDefaultMouseCursor
in class GameContainer
GameContainer.setDefaultMouseCursor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |