3D Game Builder SDK

SDK Functions

gameStartRender( void )

Description

Always call this function before you start drawing to the screen. It prepares the screen for drawing to a new frame. Think of it as creating a blank canvas for you to draw on.

Specification

void gameStartRender( void )

return value

= void (nothing)

Notes

Always call the gameEndRender( void ) function when you have finished drawing the current frame.

So for every frame you draw use:

// start of frame drawing
gameStartRender();

// (draw stuff here)
myDrawFrame();

// end of frame drawing
gameEndRender();

For Example

#include "3dgamebuilder.h"

// exported game function
DLL_EXPORT int gameLoop(void)
{
	while(1)
	{
		// read the controller
		gamePadRead();

		// start drawing
		gameStartRender();

		// do some drawing
		glMatrixMode( GL_PROJECTION );
		glLoadIdentity();
		glMatrixMode( GL_MODELVIEW );
		glLoadIdentity();
		glBegin( GL_TRIANGLES );

			glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
			glVertex2f( -0.5f, -0.5f );
			glVertex2f(  0.0f,  0.5f );
			glVertex2f(  0.5f, -0.5f );

		glEnd();

		// end of drawing
		gameEndRender();
	}
}

See Also

gameStartRender( void )
gameEndRender( void )

Go Back

SDK Functions