PS2GL
OpenGL*-like API for the PS2
|
Modules | |
gs memory management | |
defining custom renderers, primitive types, and state | |
Functions | |
void | pglSetDisplayBuffers (int interlaced, pgl_area_handle_t frame0_mem, pgl_area_handle_t frame1_mem) |
void | pglSetDrawBuffers (int interlaced, pgl_area_handle_t frame0_mem, pgl_area_handle_t frame1_mem, pgl_area_handle_t depth_mem) |
void | pglSetInterlacingOffset (float yPixels) |
int | pglInit (int immBufferVertexSize, int immDrawBufferQwordSize) |
int | pglHasLibraryBeenInitted (void) |
void | pglFinish (void) |
void | pglWaitForVU1 (void) |
void | pglWaitForVSync (void) |
void | pglSwapBuffers (void) |
void | pglSetRenderingFinishedCallback (void(*cb)(void)) |
void | pglBeginImmediateGeometry (void) |
void | pglEndImmediateGeometry (void) |
void | pglRenderImmediateGeometry (void) |
void | pglFinishRenderingImmediateGeometry (int forceImmediateStop) |
void | pglBeginGeometry (void) |
void | pglEndGeometry (void) |
void | pglRenderGeometry (void) |
void | pglFinishRenderingGeometry (int forceImmediateStop) |
void | pglEnable (GLenum cap) |
void | pglDisable (GLenum cap) |
void | pglNormalPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) |
void | pglDrawIndexedArrays (GLenum primType, int numIndices, const unsigned char *indices, int numVertices) |
void | pglFreeTexture (GLuint texId) |
void | pglBindTextureToSlot (GLuint texId, pgl_slot_handle_t mem_slot) |
void | pglTextureFromGsMemArea (pgl_area_handle_t tex_area_handle) |
The pgl* functions affect the behavior of ps2gl and provide access to ps2 features not well-suited to the gl api.
The recommended way to use the ps2gl library is for the app to use the pgl* functions to configure the library. Alternatively, for a quick start try the [very incomplete] glut implementation, which will set things up using default values.
void pglSetDisplayBuffers | ( | int | interlaced, |
pgl_area_handle_t | frame0_mem, | ||
pgl_area_handle_t | frame1_mem | ||
) |
#include <src/displaycontext.cpp>
Tell ps2gl what areas in GS ram to display.
interlaced | PGL_INTERLACED or PGL_NONINTERLACED |
frame0_mem | the first area if double-buffered, otherwise the only area |
frame1_mem | the second area if double-buffered, otherwise NULL |
Definition at line 89 of file displaycontext.cpp.
void pglSetDrawBuffers | ( | int | interlaced, |
pgl_area_handle_t | frame0_mem, | ||
pgl_area_handle_t | frame1_mem, | ||
pgl_area_handle_t | depth_mem | ||
) |
#include <src/drawcontext.cpp>
Set the area(s) in gs mem to draw. If two frame buffers are given they will be used as double buffers.
interlaced | PGL_INTERLACED or PGL_NONINTERLACED |
frame0_mem | the first or only buffer |
frame1_mem | NULL if single-buffered |
depth_mem | the depth buffer; NULL for none |
Definition at line 926 of file drawcontext.cpp.
void pglSetInterlacingOffset | ( | float | yPixels | ) |
#include <src/drawcontext.cpp>
Definition at line 936 of file drawcontext.cpp.
int pglInit | ( | int | immBufferVertexSize, |
int | immDrawBufferQwordSize | ||
) |
#include <src/glcontext.cpp>
Initialize the ps2gl library. You must call this before any other pgl* or gl* functions! (When using glut, it will be called in glutInit() if the ps2gl library was not initialized by the app previously.) Also, the application is now responsible for resetting the machine, including the display mode (putting the gs into the right output state, i.e., resolution and interlaced), usually this just means calling sceGsResetGraph.
immBufferVertexSize | ps2gl uses fixed-size internal buffers to store geometry; this argument tells the library how much space to allocate. |
Definition at line 495 of file glcontext.cpp.
Referenced by glutInit().
int pglHasLibraryBeenInitted | ( | void | ) |
#include <src/glcontext.cpp>
Has pglInit() been called?
Definition at line 507 of file glcontext.cpp.
Referenced by glutInit().
void pglFinish | ( | void | ) |
#include <src/glcontext.cpp>
Do any necessary clean up when finished using ps2gl.
Definition at line 515 of file glcontext.cpp.
void pglWaitForVU1 | ( | void | ) |
#include <src/glcontext.cpp>
Wait for dma transfers to vif1 to end. Polls cop0, so it should not slow down the transfer, unlike sceGsSyncPath().
This call is for convenience only – there is no need to call it if the app can manage on its own.
Definition at line 529 of file glcontext.cpp.
void pglWaitForVSync | ( | void | ) |
#include <src/glcontext.cpp>
Wait for the vertical retrace. Note that this call is required for the interlacing to work properly. (Called by glut.)
Definition at line 538 of file glcontext.cpp.
void pglSwapBuffers | ( | void | ) |
#include <src/glcontext.cpp>
Signals the end of the current rendering loop and swaps anything double-buffered (display, draw buffers).
Note that this call is required. (Called by glut.)
Definition at line 549 of file glcontext.cpp.
void pglSetRenderingFinishedCallback | ( | void(*)(void) | cb | ) |
#include <src/glcontext.cpp>
Set a function to be called back when rendering finishes. This function will be called from the interrupt handler; be careful!
a | pointer to the callback function or NULL to clear |
Definition at line 561 of file glcontext.cpp.
void pglBeginImmediateGeometry | ( | void | ) |
#include <src/glcontext.cpp>
Definition at line 570 of file glcontext.cpp.
void pglEndImmediateGeometry | ( | void | ) |
#include <src/glcontext.cpp>
Definition at line 574 of file glcontext.cpp.
void pglRenderImmediateGeometry | ( | void | ) |
#include <src/glcontext.cpp>
Definition at line 578 of file glcontext.cpp.
void pglFinishRenderingImmediateGeometry | ( | int | forceImmediateStop | ) |
#include <src/glcontext.cpp>
Definition at line 582 of file glcontext.cpp.
void pglBeginGeometry | ( | void | ) |
#include <src/glcontext.cpp>
Definition at line 591 of file glcontext.cpp.
void pglEndGeometry | ( | void | ) |
#include <src/glcontext.cpp>
Definition at line 595 of file glcontext.cpp.
void pglRenderGeometry | ( | void | ) |
#include <src/glcontext.cpp>
Definition at line 599 of file glcontext.cpp.
void pglFinishRenderingGeometry | ( | int | forceImmediateStop | ) |
#include <src/glcontext.cpp>
Definition at line 603 of file glcontext.cpp.
void pglEnable | ( | GLenum | cap | ) |
#include <src/glcontext.cpp>
Definition at line 612 of file glcontext.cpp.
void pglDisable | ( | GLenum | cap | ) |
#include <src/glcontext.cpp>
Definition at line 623 of file glcontext.cpp.
void pglNormalPointer | ( | GLint | size, |
GLenum | type, | ||
GLsizei | stride, | ||
const GLvoid * | ptr | ||
) |
#include <src/gmanager.cpp>
Specify a normal pointer with either 3 or 4 elements. If 4-element normals are specified, the last element (w) will be ignored.
Definition at line 420 of file gmanager.cpp.
Referenced by glNormalPointer().
void pglDrawIndexedArrays | ( | GLenum | primType, |
int | numIndices, | ||
const unsigned char * | indices, | ||
int | numVertices | ||
) |
#include <src/gmanager.cpp>
Definition at line 437 of file gmanager.cpp.
void pglFreeTexture | ( | GLuint | texId | ) |
#include <src/texture.cpp>
Free the named GL texture object. Note that this only frees any GS ram the texture is using, not main ram.
Definition at line 790 of file texture.cpp.
void pglBindTextureToSlot | ( | GLuint | texId, |
pgl_slot_handle_t | mem_slot | ||
) |
#include <src/texture.cpp>
Bind the named GL texture object to the given GS memory slot. This functions allows the application to bypass the GS memory manager.
Definition at line 802 of file texture.cpp.
void pglTextureFromGsMemArea | ( | pgl_area_handle_t | tex_area_handle | ) |
#include <src/texture.cpp>
Texture from the given memory area. Used in the same context as glTexImage2D(), this call would probably be used with procedural textures.
Definition at line 814 of file texture.cpp.