PS2GL
OpenGL*-like API for the PS2
|
Functions | |
void | glutInit (int *argcp, char **argv) |
void | glutDisplayFunc (void(*func)(void)) |
void | glutReshapeFunc (void(*func)(int width, int height)) |
void | glutKeyboardFunc (void(*func)(unsigned char key, int x, int y)) |
void | glutVisibilityFunc (void(*func)(int state)) |
void | glutIdleFunc (void(*func)(void)) |
void | glutSpecialFunc (void(*func)(int key, int x, int y)) |
void | glutMainLoop (void) |
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.
void glutInit | ( | int * | argcp, |
char ** | argv | ||
) |
#include <glut/src/ps2glut.cpp>
Initialize the ps2glut library, also the ps2gl library and gs memory if not already initialized by the app. (Remember that the app must reset the machine and graphics mode before calling pglInit!)
argcp | a pointer to the number of elements in argv |
argvp | command line args. |
Definition at line 104 of file ps2glut.cpp.
References pglHasGsMemBeenInitted(), pglHasLibraryBeenInitted(), and pglInit().
void glutDisplayFunc | ( | void(*)(void) | func | ) |
#include <glut/src/ps2glut.cpp>
Set the display function callback. The callback will be called once per frame.
Definition at line 140 of file ps2glut.cpp.
void glutReshapeFunc | ( | void(*)(int width, int height) | func | ) |
#include <glut/src/ps2glut.cpp>
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 150 of file ps2glut.cpp.
void glutKeyboardFunc | ( | void(*)(unsigned char key, int x, int y) | func | ) |
#include <glut/src/ps2glut.cpp>
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 160 of file ps2glut.cpp.
void glutVisibilityFunc | ( | void(*)(int state) | func | ) |
#include <glut/src/ps2glut.cpp>
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 170 of file ps2glut.cpp.
void glutIdleFunc | ( | void(*)(void) | func | ) |
#include <glut/src/ps2glut.cpp>
Set the idle function callback. The callback will be called once per frame, after the display callback.
Definition at line 179 of file ps2glut.cpp.
void glutSpecialFunc | ( | void(*)(int key, int x, int y) | func | ) |
#include <glut/src/ps2glut.cpp>
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 189 of file ps2glut.cpp.
void glutMainLoop | ( | void | ) |
#include <glut/src/ps2glut.cpp>
Enter the main loop. Since this is the ps2 and not a pc, this function will not return.
Definition at line 198 of file ps2glut.cpp.