GLLib: GLLib : Core System.

GLLib

GLLib : Core System.
[GLLib]

all low level phone integration More...

Functions

void CheckAndDumpConfig ()
void Game_Run () throws Exception
 Function to be implemented in every game.
abstract void Game_update () throws Exception
 Function to be implemented in every game.
Image GetSoftwareDoubleBuffer ()
Graphics GetSoftwareDoubleBufferGraphics ()
 GLLib (Object application, Object display)
 Constructor.
void hideNotify ()
 Override of Canvas.hideNotify().
void Init ()
 Initialize and start the game engine.
void paint (Graphics _g)
 Standard rendering function.
void Pause ()
 Pause the game engine.
void Quit ()
 Request to quit the game engine.
void Resume ()
 Resume the game engine.
void run ()
 Game engine main loop/thread.
static void SetupDefaultKey ()
 Setup the default key association for this device.
void SetupDisplay ()
 Setup the display.
void showNotify ()
 Override of Canvas.showNotify().
void sizeChanged (int w, int h)
 Called when the drawable area has been changed.
void UnInit ()
 Quit game engine, free all memory and object.

Variables

static javax.microedition.lcdui.Graphics g = null
 Graphics context where all rendering operation will happen.
static javax.microedition.midlet.MIDlet s_application
 Reference to the application. Usually its a reference to a midlet (or IApplication for doja).
static Display s_display
 reference to the display
static int s_game_currentFrameNB
 Current frame number. Increased every frame.
static int s_game_FPSAverage
 Average fps * 100.
static int s_game_frameDT
 Delta time between the previous frame and this one.
static boolean s_game_interruptNotify
 Interrupt notifier. Set to true when an interrupt occured.
static boolean s_game_isPaused
 Pause state of the game. True if the game is paused.
static long s_game_lastFrameTime
 Similar to s_game_timeWhenFrameStart but internally used for GLLibConfig.useFakeInterruptHandling.
static int s_game_state
 Current game state.
static long s_game_timeWhenFrameStart
 Current time when the frame started.
static int s_game_totalExecutionTime
 Total game execution time.
static GLLib s_gllib_instance
 The only instance of this GLLib class.

Detailed Description

all low level phone integration


Function Documentation

void CheckAndDumpConfig (  )  [package, inherited]

void Game_Run (  )  throws Exception [inherited]

Function to be implemented in every game.

This is where you put the code of your game. This function will be called once per frame, You have to do the game specific run code from whitin. The method is not abstract because overriding it should not be mandatory and should not affect existing projects This function is called from the run call of the main thread.

abstract void Game_update (  )  throws Exception [package, pure virtual, inherited]

Function to be implemented in every game.

This is where you put the code of your game. This function will be called once per frame, You have to do the game Logic/Ai and Painting from whitin. This function is called from the paint call of this canvas.

Image GetSoftwareDoubleBuffer (  )  [protected, inherited]

Graphics GetSoftwareDoubleBufferGraphics (  )  [protected, inherited]

GLLib ( Object  application,
Object  display 
) [inherited]

Constructor.

The constructor, will keep reference to the application and display, it will also setup its display This call wont start the engine of the game, you need to call init to start the game engine.

Parameters:
application Reference on the application (midlet, IApplication, etc...).
display Reference on the display.
See also:
GLLib.init

void hideNotify (  )  [inherited]

Override of Canvas.hideNotify().

Standard devices will call this function when the game is interrupted.

See also:
GLLib.pause

void Init (  )  [protected, inherited]

Initialize and start the game engine.

Allocate basic game variable/structure, launch game thread.

void paint ( Graphics  _g  )  [inherited]

Standard rendering function.

This function is called by the device to enable us to draw on the display. Override of Canvas.paint.

Note:
The game should not call this function, it will be called automaticaly by the device, request are made in GLLib.run. The game drawing code has to go into the abstract function GLLib.Game_update.
See also:
GLLib.Game_update

void Pause (  )  [protected, inherited]

Pause the game engine.

Can be called by the Midlet, GLLib.hideNotify or the game itself.

See also:
GLLib.hideNotify

void Quit (  )  [protected, inherited]

Request to quit the game engine.

When the user select exit/quit (or for any other reason the request quit a game) you should use this function.

void Resume (  )  [protected, inherited]

Resume the game engine.

Can be called by the Midlet or GLLib.showNotify. If the game was not in pause state, nothing happens.

See also:
GLLib.showNotify

void run (  )  [inherited]

Game engine main loop/thread.

Override of Runnable.run.

Note:
The game should not call this function, it will be called automaticaly by the thread. The game code has to go into the abstract function GLLib.Game_update.
See also:
GLLib.Game_update

static void SetupDefaultKey (  )  [static, protected, inherited]

Setup the default key association for this device.

in default key configuration, key2=up, key8=down, key4=left, key6=right and key5=fire
if you want to seperate those association, you need to reset the key configuration (Game_KeyClearKeyCode)
and use Game_keySetKeyCode so set your key code association

See also:
Game_keySetKeyCode

Game_keyClearKeyCode

void SetupDisplay (  )  [protected, inherited]

Setup the display.

Does different thing denpending of the device.
For MIDP20 it will setup the display to this instance of GLLib and put the game in fullscreen.
For NOLIA UI it will setup the display to this instance of GLLib and set the command listener to null.
etc...

void showNotify (  )  [inherited]

Override of Canvas.showNotify().

Standard devices will call this function when the game is made visible on the display.

See also:
GLLib.resume

void sizeChanged ( int  w,
int  h 
) [inherited]

Called when the drawable area has been changed.

void UnInit (  )  [protected, inherited]

Quit game engine, free all memory and object.

This function will be called automaticaly at the end of the game loop.


Variable Documentation

javax.microedition.lcdui.Graphics g = null [static, inherited]

Graphics context where all rendering operation will happen.

this graphic context can be changed/reseted with SetCurrentGraphics

See also:
SetCurrentGraphics

javax.microedition.midlet.MIDlet s_application [static, package, inherited]

Reference to the application. Usually its a reference to a midlet (or IApplication for doja).

Display s_display [static, package, inherited]

reference to the display

int s_game_currentFrameNB [static, package, inherited]

Current frame number. Increased every frame.

int s_game_FPSAverage [static, package, inherited]

Average fps * 100.

Note:
valid only if GLLibConfig.useFrameDT is true.

int s_game_frameDT [static, package, inherited]

Delta time between the previous frame and this one.

Note:
valid only if GLLibConfig.useFrameDT is true.

boolean s_game_interruptNotify [static, package, inherited]

Interrupt notifier. Set to true when an interrupt occured.

boolean s_game_isPaused [static, package, inherited]

Pause state of the game. True if the game is paused.

long s_game_lastFrameTime [static, package, inherited]

Similar to s_game_timeWhenFrameStart but internally used for GLLibConfig.useFakeInterruptHandling.

int s_game_state [static, package, inherited]

Current game state.

long s_game_timeWhenFrameStart [static, package, inherited]

Current time when the frame started.

int s_game_totalExecutionTime [static, package, inherited]

Total game execution time.

Note:
valid only if GLLibConfig.useFrameDT is true.

GLLib s_gllib_instance [static, package, inherited]

The only instance of this GLLib class.


Generated on Tue Sep 23 23:05:30 2008 for GLLib by  doxygen 1.5.2