
//
// opengl.h
//

		/* 4x4 MATRIX INDECIES */
enum
{
	M00	= 0,
	M10,
	M20,
	M30,
	M01,
	M11,
	M21,
	M31,
	M02,
	M12,
	M22,
	M32,
	M03,
	M13,
	M23,
	M33
};

		/* 3x3 MATRIX INDECIES */
enum
{
	N00	= 0,
	N10,
	N20,
	N01,
	N11,
	N21,
	N02,
	N12,
	N22
};



typedef struct
{
	GLfloat	x,y,z;
}OGLPoint3D;

typedef struct
{
	GLfloat	x,y;
}OGLPoint2D;

typedef struct
{
	GLfloat	x,y,z;
}OGLVector3D;

typedef struct
{
	GLfloat	x,y;
}OGLVector2D;

typedef struct
{
	GLfloat	u,v;
}OGLTextureCoord;

typedef struct
{
	GLfloat	r,g,b;
}OGLColorRGB;

typedef struct
{
	GLfloat	r,g,b,a;
}OGLColorRGBA;


typedef union
{
	GLfloat	value[16];
	vector float v[4];
}OGLMatrix4x4;

typedef struct
{
	GLfloat	value[9];
}OGLMatrix3x3;



void OGL_CreateDrawContext(void);
void OGL_DrawScene(void);
void OGL_SetCamera(OGLPoint3D *cameraCoord, OGLPoint3D *lookAtPt, OGLVector3D *upVec);

void OGL_InitFont(void);
void OGL_DrawString(Str255 s, GLint x, GLint y);
void OGL_DrawInt(int f, GLint x, GLint y);

void OGL_PushState(void);
void OGL_PopState(void);
void OGL_EnableLighting(void);
void OGL_DisableLighting(void);
void OGL_EnableDepthTest(void);
void OGL_DisableDepthTest(void);
void OGL_EnableNormalize(void);
void OGL_DisableNormalize(void);
void OGL_EnableBlend(void);
void OGL_DisableBlend(void);
void OGL_EnableTexture2D(void);
void OGL_DisableTexture2D(void);
void OGL_ActiveTextureUnit(u_long texUnit);
void OGL_SetColor4fv(OGLColorRGBA *color);
void OGL_SetColor4f(float r, float g, float b, float a);
void OGL_EnableCullFace(void);
void OGL_DisableCullFace(void);
void OGL_EnableFog(void);
void OGL_DisableFog(void);
void OGL_BlendFunc(GLenum sfactor, GLenum dfactor);
void OGL_DepthMask(Boolean useZbuffer);

void OGLMatrix4x4_Multiply(const OGLMatrix4x4	*mA, const OGLMatrix4x4 *mB, OGLMatrix4x4	*result);
void OGL_Vector3D_NormalizeFast(float x, float y, float z, OGLVector3D *outV);







