|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface GameIface
This interface needs to be implemented by any abstract game class which is a base class for a concrete game.
| Method Summary | |
|---|---|
void |
draw(javax.media.opengl.GL gl)
This method is used to draw the scene and its content. |
void |
enableBackFaceCulling()
Enables back face culling for a (possibly) slight performance boost. |
javax.swing.JFrame |
getMainFrame()
Returns the main window (main frame) of the game |
javax.media.opengl.GLCanvas |
getOGLCanvas()
Returns the component that is the OpenGL canvas. |
void |
initCamera(float camX,
float camY,
float camZ,
float rotX,
float rotY,
float near,
float far)
This method needs to be called before the start() method. |
void |
initResources(javax.media.opengl.GLDrawable gld,
javax.media.opengl.GL gl,
int width,
int height)
This method is used to initialize all the objects and resources that are neccessary at startup of the game. |
boolean |
isSetDisplayFPS()
Determines whether or not the framerate is set to be displayed on screen. |
void |
resetElapsedTime()
Resets the calculation of the elapsed time between two frames. |
void |
setDisplayFPS(boolean enable)
Sets whethter or not the framerate (frames per second) ought to be displayed. |
void |
setDisplayMode(EngineDisplayMode mode)
Sets the display mode of the game window. |
void |
start(GameIface game)
Call this method to start the game after every other method that influences the game startup has been called. |
void |
stop()
This method is used to savely stop the game. |
void |
update(long elapsedTime)
This method is used to update the scene and its content. |
| Methods inherited from interface javax.media.opengl.GLEventListener |
|---|
display, displayChanged, init, reshape |
| Method Detail |
|---|
javax.media.opengl.GLCanvas getOGLCanvas()
javax.swing.JFrame getMainFrame()
void setDisplayMode(EngineDisplayMode mode)
mode - display modevoid setDisplayFPS(boolean enable)
enable - display fps --> true=yes, false=noboolean isSetDisplayFPS()
void enableBackFaceCulling()
void initCamera(float camX,
float camY,
float camZ,
float rotX,
float rotY,
float near,
float far)
camX - camera's x coordinatecamY - camera's y coordinatecamZ - camera's z coordinaterotX - camera's rotation around x axis (up/down)rotY - camera's rotation around y axis (left/right)near - near clipping plane distancefar - far clipping plane distance
void initResources(javax.media.opengl.GLDrawable gld,
javax.media.opengl.GL gl,
int width,
int height)
gld - GLDrawable objectgl - GL objectwidth - window width (important viewport initialisation)height - window height (important viewport initialisation)void update(long elapsedTime)
elapsedTime - time between two framesvoid draw(javax.media.opengl.GL gl)
gl - void start(GameIface game)
game - game objectvoid stop()
void resetElapsedTime()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||