next up previous contents
Next: Per Fragment Operations Up: KGL API Previous: KGL API   Contents

Subsections

KGL DC-specific APIs


int glKosInit()

The function to intialize KGL. This must be called after KOS and the PVR are intialized. KGL will inherit the active lists specified as parameters to pvr_init. Currently KGL supports the opaque, transparent and punchthru polygon lists. Returns 0 if successful, -1 if no lists are found to be active.


\begin{algorithm}
% latex2html id marker 51\par\caption{DC specific API exmapl...
......
\par ~~~~glKosShutdown();
\par ~~~~return~0;
\par\}\end{list}\end{algorithm}

void glKosShutdown()

Call after finishing with KGL. See code example [*], page [*].

void glKosGetScreenSize(GLfloat *x, GLfloat *y)

Get the current video screen size.

void glKosBeginFrame();

Begin frame sequence. See code example [*], page [*].

void glKosFinishFrame()

Finish frame sequence. See code example [*], page [*].

void glKosFinishList()

Finish with the current list. See code example [*], page [*]. XXX - describe lists.

void glKosMatrixIdent()(DR)

Set the DC's matrix regs to identity.

void glKosMatrixDirty()(DR)

Set matrix regs as dirtied. You should do this if you've done any tinkering with the DC's matrix registers outside of using GL calls.

void glKosPolyHdrDirty()(DR)

Set poly header context as dirtied. Similar to the matrix call above, but this one is for the case where you've sent your own primitive headers to the DCPVR2's TA.

void glKosMatrixApply(GLenum mode)(DR)

Apply one of the GL matrices to the DC's matrix regs.

mode
GL_KOS_SCREENVIEW
GL_MODELVIEW
GL_PROJECTION

void glKosSendPolyHdr()(DR)

This function bypasses the normal glBegin( ) / glEnd( ) paradigm and sends the currently defined polygon header to the hardware. Where defined polygon header is simply the current GL states encapsulated in a pvr_poly_hdr_t structure that apply to the object about to be rendered. e.g.: fog, culling, blend functions, texture, current polygon list, etc. Your optimized drawing function is responsible for filling and sending the verticies (pvr_vertex_t) for the object to be rendered by the DCPVR2 hardware.


next up previous contents
Next: Per Fragment Operations Up: KGL API Previous: KGL API   Contents
Dan Potter 2002-07-29