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_UseColorArray(void);
18 void GL_Color(float cr, float cg, float cb, float ca);
19 void GL_DepthFunc(int value);
20 void GL_ClearDepth(void);
22 extern cvar_t gl_lockarrays;
24 extern int c_meshelements, c_meshs;
26 //input to R_Mesh_State
29 int depthwrite; // force depth writing enabled even if polygon is not opaque
30 int depthdisable; // disable depth read/write entirely
34 int tex[MAX_TEXTUREUNITS];
35 int texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
39 // overbright rendering scale for the current state
40 extern int r_lightmapscalebit;
41 extern float r_colorscale;
42 extern float *varray_vertex;
43 extern float *varray_color;
44 extern float *varray_texcoord[MAX_TEXTUREUNITS];
45 extern int mesh_maxverts;
47 // adds console variables and registers the render module (only call from GL_Init)
48 void gl_backend_init(void);
50 // starts mesh rendering for the frame
51 void R_Mesh_Start(void);
53 // ends mesh rendering for the frame
54 // (only valid after R_Mesh_Start)
55 void R_Mesh_Finish(void);
57 // sets up the requested transform matrix
58 void R_Mesh_Matrix(const matrix4x4_t *matrix);
60 // sets up the requested state
61 void R_Mesh_State(const rmeshstate_t *m);
63 // sets up the requested main state
64 void R_Mesh_MainState(const rmeshstate_t *m);
66 // sets up the requested texture state
67 void R_Mesh_TextureState(const rmeshstate_t *m);
69 // enlarges vertex arrays if they are too small
70 #define R_Mesh_ResizeCheck(numverts) if ((numverts) > mesh_maxverts) _R_Mesh_ResizeCheck(numverts);
71 void _R_Mesh_ResizeCheck(int numverts);
73 // renders the mesh in the varray_* buffers
74 void R_Mesh_Draw(int numverts, int numtriangles, int *elements);
76 // saves a section of the rendered frame to a .tga file
77 qboolean SCR_ScreenShot(char *filename, int x, int y, int width, int height);
78 // used by R_Envmap_f and internally in backend, clears the frame
79 void R_ClearScreen(void);
80 // invoke refresh of frame
81 void SCR_UpdateScreen (void);