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

pgl* API

The pgl* functions affect the behavior of ps2gl and provide access to ps2 features not well-suited to the gl api. More...


Modules

gs memory management
 Functions to initialize, allocate, and free gs memory.


Functions

void pglSetDisplayBuffers (pgl_area_handle_t frame0_mem, pgl_area_handle_t frame1_mem)
 Tell ps2gl what areas in GS ram to display.

void pglSetDrawBuffers (pgl_area_handle_t frame0_mem, pgl_area_handle_t frame1_mem, pgl_area_handle_t depth_mem)
 Set the area(s) in gs mem to draw.

int pglInit (int immBufferVertexSize)
 Initialize the ps2gl library.

int pglHasLibraryBeenInitted (void)
 Has pglInit() been called?

void pglFinish (void)
 Do any necessary clean up when finished using ps2gl.

void pglWaitForVU1 (void)
 Wait for dma transfers to vif1 to end.

void pglWaitForVSync (void)
 Wait for the vertical retrace.

void pglSwapBuffers (void)
 Signals the end of the current rendering loop and swaps anything double-buffered (display, draw buffers).

void pglNormalPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
void pglTextureFromGsMemArea (pgl_area_handle_t tex_area_handle)
 Texture from the given memory area.


Detailed Description

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.


Function Documentation

void pglFinish ( void )
 

Do any necessary clean up when finished using ps2gl.

Definition at line 289 of file glcontext.cpp.

int pglHasLibraryBeenInitted ( void )
 

Has pglInit() been called?

Returns:
1 if pglInit has been called, 0 otherwise

Definition at line 280 of file glcontext.cpp.

Referenced by glutInit().

int pglInit ( int immBufferVertexSize )
 

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.)

Parameters:
immBufferVertexSize   ps2gl uses fixed-size internal buffers to store geometry; this argument tells the library how much space to allocate.

Definition at line 267 of file glcontext.cpp.

void pglNormalPointer ( GLint size,
GLenum type,
GLsizei stride,
const GLvoid * ptr )
 

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 285 of file gmanager.cpp.

void pglSetDisplayBuffers ( pgl_area_handle_t frame0_mem,
pgl_area_handle_t frame1_mem )
 

Tell ps2gl what areas in GS ram to display.

Parameters:
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 80 of file displaycontext.cpp.

void pglSetDrawBuffers ( pgl_area_handle_t frame0_mem,
pgl_area_handle_t frame1_mem,
pgl_area_handle_t depth_mem )
 

Set the area(s) in gs mem to draw.

If two frame buffers are given they will be used as double buffers.

Parameters:
frame0_mem   the first or only buffer
frame1_mem   NULL if single-buffered
depth_mem   the depth buffer; NULL for none

Definition at line 540 of file drawcontext.cpp.

void pglSwapBuffers ( void )
 

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 356 of file glcontext.cpp.

Referenced by glutMainLoop().

void pglTextureFromGsMemArea ( pgl_area_handle_t tex_area_handle )
 

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 637 of file texture.cpp.

void pglWaitForVSync ( void )
 

Wait for the vertical retrace.

Note that this call is required for the interlacing to work properly. (Called by glut.)

Definition at line 344 of file glcontext.cpp.

Referenced by glutMainLoop().

void pglWaitForVU1 ( void )
 

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 303 of file glcontext.cpp.

Referenced by glutMainLoop().


ps2gl version 0.2