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

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

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

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

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

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

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

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

void glutMainLoop (void)
 Enter the main loop. More...


Variables

int Ps2stuffDeviceFd = -1
bool WaitForVsync = true

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 256 of file linux_glut.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 295 of file linux_glut.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. glut will look for "ntsc" or "vesa0".

Definition at line 174 of file linux_glut.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 276 of file linux_glut.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 314 of file linux_glut.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 266 of file linux_glut.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 305 of file linux_glut.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 286 of file linux_glut.cpp.

int setcrtmode int    argc,
char **    argv,
int    gs_fd
 


Variable Documentation

int Ps2stuffDeviceFd = -1
 

Definition at line 164 of file linux_glut.cpp.

bool WaitForVsync = true
 

Definition at line 165 of file linux_glut.cpp.


ps2gl version cvs