mirror of
https://github.com/tribes2/engine.git
synced 2026-01-20 03:34:48 +00:00
116 lines
3 KiB
C
116 lines
3 KiB
C
|
|
//-----------------------------------------------------------------------------
|
||
|
|
// V12 Engine
|
||
|
|
//
|
||
|
|
// Copyright (c) 2001 GarageGames.Com
|
||
|
|
// Portions Copyright (c) 2001 by Sierra Online, Inc.
|
||
|
|
//-----------------------------------------------------------------------------
|
||
|
|
|
||
|
|
#ifndef _PLATFORMGL_H_
|
||
|
|
#define _PLATFORMGL_H_
|
||
|
|
|
||
|
|
#include <gl.h>
|
||
|
|
#include <glu.h>
|
||
|
|
|
||
|
|
|
||
|
|
bool QGL_EXT_Init();
|
||
|
|
|
||
|
|
|
||
|
|
struct GLState
|
||
|
|
{
|
||
|
|
bool suppARBMultitexture;
|
||
|
|
bool suppPackedPixels;
|
||
|
|
bool suppLockedArrays;
|
||
|
|
bool suppTextureEnvCombine;
|
||
|
|
bool suppVertexArrayRange;
|
||
|
|
bool suppFogCoord;
|
||
|
|
bool suppEdgeClamp;
|
||
|
|
};
|
||
|
|
|
||
|
|
extern GLState gGLState;
|
||
|
|
#define UNSIGNED_SHORT_5_6_5 0x8363
|
||
|
|
#define UNSIGNED_SHORT_5_6_5_REV 0x8364
|
||
|
|
|
||
|
|
extern bool gOpenGLDisableCVA;
|
||
|
|
extern bool gOpenGLDisableTEC;
|
||
|
|
extern bool gOpenGLDisableARBMT;
|
||
|
|
extern bool gOpenGLDisableFC;
|
||
|
|
|
||
|
|
inline bool dglDoesSupportCompiledVertexArray()
|
||
|
|
{
|
||
|
|
return gGLState.suppLockedArrays && (gOpenGLDisableCVA == false);
|
||
|
|
}
|
||
|
|
|
||
|
|
inline bool dglDoesSupportTextureEnvCombine()
|
||
|
|
{
|
||
|
|
return gGLState.suppTextureEnvCombine && (gOpenGLDisableTEC == false);
|
||
|
|
}
|
||
|
|
|
||
|
|
inline bool dglDoesSupportARBMultitexture()
|
||
|
|
{
|
||
|
|
return gGLState.suppARBMultitexture && (gOpenGLDisableARBMT == false);
|
||
|
|
}
|
||
|
|
|
||
|
|
inline bool dglDoesSupportVertexArrayRange()
|
||
|
|
{
|
||
|
|
return gGLState.suppVertexArrayRange;
|
||
|
|
}
|
||
|
|
|
||
|
|
inline bool dglDoesSupportFogCoord()
|
||
|
|
{
|
||
|
|
return gGLState.suppFogCoord && (gOpenGLDisableFC == false);
|
||
|
|
}
|
||
|
|
|
||
|
|
inline bool dglDoesSupportEdgeClamp()
|
||
|
|
{
|
||
|
|
return gGLState.suppEdgeClamp;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
//
|
||
|
|
// until Apple exposes some extensions we'll need to stub them here
|
||
|
|
//
|
||
|
|
|
||
|
|
/* EXT_combine */
|
||
|
|
#define GL_COMBINE_EXT 0x8570
|
||
|
|
#define GL_COMBINE_RGB_EXT 0x8571
|
||
|
|
#define GL_COMBINE_ALPHA_EXT 0x8572
|
||
|
|
#define GL_SOURCE0_RGB_EXT 0x8580
|
||
|
|
#define GL_SOURCE1_RGB_EXT 0x8581
|
||
|
|
#define GL_SOURCE2_RGB_EXT 0x8582
|
||
|
|
#define GL_SOURCE0_ALPHA_EXT 0x8588
|
||
|
|
#define GL_SOURCE1_ALPHA_EXT 0x8589
|
||
|
|
#define GL_SOURCE2_ALPHA_EXT 0x858A
|
||
|
|
#define GL_OPERAND0_RGB_EXT 0x8590
|
||
|
|
#define GL_OPERAND1_RGB_EXT 0x8591
|
||
|
|
#define GL_OPERAND2_RGB_EXT 0x8592
|
||
|
|
#define GL_OPERAND0_ALPHA_EXT 0x8598
|
||
|
|
#define GL_OPERAND1_ALPHA_EXT 0x8599
|
||
|
|
#define GL_OPERAND2_ALPHA_EXT 0x859A
|
||
|
|
#define GL_RGB_SCALE_EXT 0x8573
|
||
|
|
#define GL_ADD_SIGNED_EXT 0x8574
|
||
|
|
#define GL_INTERPOLATE_EXT 0x8575
|
||
|
|
#define GL_CONSTANT_EXT 0x8576
|
||
|
|
#define GL_PRIMARY_COLOR_EXT 0x8577
|
||
|
|
#define GL_PREVIOUS_EXT 0x8578
|
||
|
|
|
||
|
|
/* EXT_fog_coord */
|
||
|
|
#define GL_FOG_COORDINATE_SOURCE_EXT -1
|
||
|
|
#define GL_FOG_COORDINATE_EXT -1
|
||
|
|
#define GL_FRAGMENT_DEPTH_EXT -1
|
||
|
|
#define GL_FOG_COORDINATE_ARRAY_EXT -1
|
||
|
|
|
||
|
|
/* EXT_texture_edge_clamp */
|
||
|
|
#define GL_CLAMP_TO_EDGE_EXT 0x812F
|
||
|
|
|
||
|
|
// stubbed unsupported extensions
|
||
|
|
inline void glFogCoordfEXT(GLfloat ) {}
|
||
|
|
inline void glFogCoordPointerEXT(GLenum, GLsizei, void *) {}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
#endif // _PLATFORMGL_H_
|