3D Game Builder SDK

SDK Functions

3dgamebuilder.h

Description

This is the include file to access the functions in the 3D Game Builder SDK.

Notes

Always #include this file to access the SDK functions.

The File

// Copyright (c) 2008 TheyerGFX Pty Ltd
#ifndef GAME_BUILDER_H
#define GAME_BUILDER_H

/*
 * includes
 */

#include <stdio.h>
#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>

/*
 * macros
 */

#define DLL_EXPORT __declspec(dllexport)

/*
 * typedefs
 */

// pad buttons
#define PAD_ANY_BUTTON			0x00003FFF
#define PAD_BUTTON_RIGHT		0x00000001
#define PAD_BUTTON_LEFT			0x00000002
#define PAD_BUTTON_UP			0x00000004
#define PAD_BUTTON_DOWN			0x00000008
#define PAD_BUTTON_START		0x00000010
#define PAD_BUTTON_SELECT		0x00000020
#define PAD_BUTTON_A			0x00000040 
#define PAD_BUTTON_B			0x00000080
#define PAD_BUTTON_C			0x00000100
#define PAD_BUTTON_D			0x00000200
#define PAD_BUTTON_LEFT_1		0x00000400
#define PAD_BUTTON_LEFT_2		0x00000800
#define PAD_BUTTON_RIGHT_1		0x00001000
#define PAD_BUTTON_RIGHT_2		0x00002000

/*
 * prototypes
 */

#ifdef __cplusplus
extern "C" {
#endif

// create this function in your game DLL
extern DLL_EXPORT int  gameLoop( void );

// game messaging
extern DLL_EXPORT void gameMessage( char * msg );
extern DLL_EXPORT void gameHideMessages( void );
extern DLL_EXPORT void gameShowMessages( void );

// call these at the start and end of frame drawing...
extern DLL_EXPORT void gameStartRender();
extern DLL_EXPORT void gameEndRender();

// font drawing
extern DLL_EXPORT int  gameCreateFont( int id, char * name, int height );
extern DLL_EXPORT void gameDrawFont( char * message );
extern DLL_EXPORT void gameSetFontPosition( float x, float y, float z );
extern DLL_EXPORT void gameSetFontColor( float r, float g, float b, float a );
extern DLL_EXPORT int  gameSelectFont( int id );
extern DLL_EXPORT void gameCloseFont( int id );

// game pad control
extern DLL_EXPORT void gamePadRead();
extern DLL_EXPORT int  gamePadAttached( int n );
extern DLL_EXPORT int  gamePadButtonDown( int n, int button );
extern DLL_EXPORT int  gamePadButtonPressed( int n, int button );

// random number generator
extern DLL_EXPORT float gameRandom( float mini, float maxi );

// timer value
extern DLL_EXPORT float gameTick( void );

// return sin and cos for an angle
extern DLL_EXPORT float gameSin( float angle );
extern DLL_EXPORT float gameCos( float angle );

// texture load and bind
extern DLL_EXPORT int gameValidateTGA( char * name );
extern DLL_EXPORT int gameOpenTGA( char * name );
extern DLL_EXPORT int gameCloseTGA( int id );
extern DLL_EXPORT int gameSetAdditiveBlendTGA( int id, int set );
extern DLL_EXPORT int gameSetSmoothTGA( int id, int set );
extern DLL_EXPORT int gameSetInvisibleColorTGA( int id, float r, float g, float b );
extern DLL_EXPORT int gameSetTransparencyTGA( int id_base, int id_alpha );
extern DLL_EXPORT int gameBindTexture( int id );

// model functions
extern DLL_EXPORT int  gameOpenModel( char * name );
extern DLL_EXPORT void gameDrawModel( int id );
extern DLL_EXPORT void gameFlushModels();
extern DLL_EXPORT void gameSetModelLighting( int on );

#ifdef __cplusplus
}
#endif

#endif // GAME_BUILDER_H

See Also

(no related functions)

Go Back

SDK Functions