Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

ps2glut API

As the name implies, this is a [very incomplete] glut implementation for the ps2. More...

Functions

void glutInit (int *argcp, char **argv)
 Initialize the ps2glut library, also the ps2gl library and gs memory if not already initialized by the app.

void glutDisplayFunc (void(*func)(void))
 Set the display function callback.

void glutReshapeFunc (void(*func)(int width, int height))
 Set the reshape function callback.

void glutKeyboardFunc (void(*func)(unsigned char key, int x, int y))
 Set the keyboard function callback.

void glutVisibilityFunc (void(*func)(int state))
 Set the visibility function callback.

void glutIdleFunc (void(*func)(void))
 Set the idle function callback.

void glutSpecialFunc (void(*func)(int key, int x, int y))
 Set the special function callback.

void glutMainLoop (void)
 Enter the main loop.


Detailed Description

As the name implies, this is a [very incomplete] glut implementation for the ps2.

In general it does three things: initializes the ps2gl library, provides minimal pad support through the "keyboard" and "special" callback functions, and does a simple double-buffered display loop.

ps2glut was written to help test ps2gl against the many existing glut samples/demos, but might be helpful in writing quick prototypes. Please note that it is not intended for game development.

ps2glut will also do some rough timing of the callback functions (using timer0). Press the 'start' button to display the timings on stdout.


Function Documentation

void glutDisplayFunc ( void(* func)(void) )
 

Set the display function callback.

The callback will be called once per frame.

Definition at line 125 of file ps2glut.cpp.

void glutIdleFunc ( void(* func)(void) )
 

Set the idle function callback.

The callback will be called once per frame, after the display callback.

Definition at line 164 of file ps2glut.cpp.

void glutInit ( int * argcp,
char ** argv )
 

Initialize the ps2glut library, also the ps2gl library and gs memory if not already initialized by the app.

Parameters:
argcp   a pointer to the number of elements in argv
argvp   command line args. ps2glut will look for a string of the form "iop_module_path=<path>" and use <path> as the location of the iop modules (e.g., "iop_module_path=host0:/usr/local/sce/iop/modules"). If none is specified "host0:/usr/local/sce/iop/modules" will be used.

Definition at line 84 of file ps2glut.cpp.

void glutKeyboardFunc ( void(* func)(unsigned char key, int x, int y) )
 

Set the keyboard function callback.

The square, triangle, circle, and x buttons are mapped to the numbers 4, 8, 6, and 2, respectively. The callback is called once per frame while for each button that is held down.

Definition at line 145 of file ps2glut.cpp.

void glutMainLoop ( void )
 

Enter the main loop.

Since this is the ps2 and not a pc, this function will not return.

Definition at line 183 of file ps2glut.cpp.

void glutReshapeFunc ( void(* func)(int width, int height) )
 

Set the reshape function callback.

This will be called once before entering the main loop. (At the moment ps2glut is fixed to set up a full-screen display -- 640x448, interlaced.)

Definition at line 135 of file ps2glut.cpp.

void glutSpecialFunc ( void(* func)(int key, int x, int y) )
 

Set the special function callback.

The left dpad buttons will be mapped to the arrow keys (GLUT_KEY_UP/DOWN/LEFT/RIGHT) and called intermittently, similar to a pc keyboard.

Definition at line 174 of file ps2glut.cpp.

void glutVisibilityFunc ( void(* func)(int state) )
 

Set the visibility function callback.

The callback will be called once before the main loop with the argument 'GLUT_VISIBLE.' For compatibility.

Definition at line 155 of file ps2glut.cpp.


ps2gl version 0.2