#ifndef GL_BACKEND_H
#define GL_BACKEND_H
-#define MAX_TEXTUREUNITS 16
+// how many texture units to track state on (backendunits/backendimageunits/backendarrayunits are limited to this value)
+#define MAX_TEXTUREUNITS 64
#define POLYGONELEMENTS_MAXPOINTS 258
extern int polygonelements[(POLYGONELEMENTS_MAXPOINTS-2)*3];
extern int quadelements[QUADELEMENTS_MAXQUADS*6];
void GL_SetupView_Orientation_Identity(void);
-void GL_SetupView_Orientation_FromEntity(matrix4x4_t *matrix);
+void GL_SetupView_Orientation_FromEntity(const matrix4x4_t *matrix);
void GL_SetupView_Mode_Perspective(double frustumx, double frustumy, double zNear, double zFar);
void GL_SetupView_Mode_PerspectiveInfiniteFarClip(double frustumx, double frustumy, double zNear);
void GL_SetupView_Mode_Ortho(double x1, double y1, double x2, double y2, double zNear, double zFar);
void GL_BlendFunc(int blendfunc1, int blendfunc2);
void GL_DepthMask(int state);
void GL_DepthTest(int state);
+void GL_CullFace(int state);
+void GL_AlphaTest(int state);
void GL_ColorMask(int r, int g, int b, int a);
void GL_Color(float cr, float cg, float cb, float ca);
-void GL_ShowTrisColor(float cr, float cg, float cb, float ca);
void GL_TransformToScreen(const vec4_t in, vec4_t out);
void GL_LockArrays(int first, int count);
void GL_ActiveTexture(unsigned int num);
extern cvar_t gl_paranoid;
extern cvar_t gl_printcheckerror;
-//input to R_Mesh_State
+//input to R_Mesh_TextureState
typedef struct rmeshstate_s
{
// textures
// pointers
const float *pointer_texcoord[MAX_TEXTUREUNITS]; // 2D
const float *pointer_texcoord3f[MAX_TEXTUREUNITS]; // 3D
-
- // other state set by this
- const float *pointer_vertex;
- const float *pointer_color;
}
rmeshstate_t;
void R_Mesh_TexMatrix(unsigned int unitnum, const matrix4x4_t *matrix);
// sets the combine state for a texenv unit
void R_Mesh_TexCombine(unsigned int unitnum, int combinergb, int combinealpha, int rgbscale, int alphascale);
-// set up the requested entire rendering state
-void R_Mesh_State(const rmeshstate_t *m);
+// set up the requested texture state
+void R_Mesh_TextureState(const rmeshstate_t *m);
+// set up a blank texture state (faster/easier specialized version of R_Mesh_TextureState)
+void R_Mesh_ResetTextureState(void);
// renders a mesh
void R_Mesh_Draw(int firstvertex, int numvertices, int numtriangles, const int *elements);
// invoke refresh of frame
void SCR_UpdateScreen(void);
// invoke refresh of loading plaque (nothing else seen)
-void SCR_UpdateLoadingScreen(void);
-
-extern float varray_vertex3f[65536*3];
-extern float varray_svector3f[65536*3];
-extern float varray_tvector3f[65536*3];
-extern float varray_normal3f[65536*3];
-extern float varray_color4f[65536*4];
-extern float varray_texcoord3f[65536*3];
-extern float varray_vertex3f2[65536*3];
+void SCR_UpdateLoadingScreen(qboolean clear);
#endif