5 #define MAX_TEXTUREUNITS 8
7 #define POLYGONELEMENTS_MAXPOINTS 258
8 extern int polygonelements[768];
10 void GL_DrawRangeElements(int firstvert, int endvert, int indexcount, int *index);
12 void GL_SetupView_ViewPort (int x, int y, int width, int height);
13 void GL_SetupView_Orientation_Identity (void);
14 void GL_SetupView_Orientation_FromEntity (vec3_t origin, vec3_t angles);
15 void GL_SetupView_Mode_Perspective (double aspect, double fovx, double fovy, double zNear, double zFar);
16 void GL_SetupView_Mode_Ortho (double x1, double y1, double x2, double y2, double zNear, double zFar);
17 void GL_DepthFunc(int value);
18 void GL_ClearDepth(void);
20 extern cvar_t gl_lockarrays;
22 extern int c_meshelements, c_meshs;
24 //input to R_Mesh_State
27 int depthwrite; // force depth writing enabled even if polygon is not opaque
28 int depthdisable; // disable depth read/write entirely
32 int tex[MAX_TEXTUREUNITS];
33 int texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
37 // overbright rendering scale for the current state
38 extern float mesh_colorscale;
39 extern float *varray_vertex;
40 extern float *varray_color;
41 extern float *varray_texcoord[MAX_TEXTUREUNITS];
42 extern int mesh_maxverts;
44 // adds console variables and registers the render module (only call from GL_Init)
45 void gl_backend_init(void);
47 // starts mesh rendering for the frame
48 void R_Mesh_Start(void);
50 // ends mesh rendering for the frame
51 // (only valid after R_Mesh_Start)
52 void R_Mesh_Finish(void);
54 // sets up the requested transform matrix
55 void R_Mesh_Matrix(const matrix4x4_t *matrix);
57 // sets up the requested state
58 void R_Mesh_State(const rmeshstate_t *m);
60 // enlarges vertex arrays if they are too small
61 #define R_Mesh_ResizeCheck(numverts) if ((numverts) > mesh_maxverts) _R_Mesh_ResizeCheck(numverts);
62 void _R_Mesh_ResizeCheck(int numverts);
64 // renders the mesh in the varray_* buffers
65 void R_Mesh_Draw(int numverts, int numtriangles, int *elements);
67 // saves a section of the rendered frame to a .tga file
68 qboolean SCR_ScreenShot(char *filename, int x, int y, int width, int height);
69 // used by R_Envmap_f and internally in backend, clears the frame
70 void R_ClearScreen(void);
71 // invoke refresh of frame
72 void SCR_UpdateScreen (void);