5 #define MAX_TEXTUREUNITS 8
7 extern int c_meshtris, c_meshs, c_transtris, c_transmeshs;
12 int depthwrite; // force depth writing enabled even if polygon is not opaque
13 int depthdisable; // disable depth read/write entirely
23 float cr, cg, cb, ca; // if color is NULL, these are used for all vertices
24 int tex[MAX_TEXTUREUNITS];
25 float *texcoords[MAX_TEXTUREUNITS];
26 int texcoordstep[MAX_TEXTUREUNITS];
27 int texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
33 //input to R_Mesh_Draw_GetBuffer
35 int depthwrite; // force depth writing enabled even if polygon is not opaque
36 int depthdisable; // disable depth read/write entirely
41 int tex[MAX_TEXTUREUNITS];
42 int texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
49 float *texcoords[MAX_TEXTUREUNITS];
53 // adds console variables and registers the render module (only call from GL_Init)
54 void gl_backend_init(void);
56 // starts mesh rendering for the frame
57 void R_Mesh_Start(void);
59 // ends mesh rendering for the frame
60 // (only valid after R_Mesh_Start)
61 void R_Mesh_Finish(void);
63 // clears depth buffer, used for masked sky rendering
64 // (only valid between R_Mesh_Start and R_Mesh_Finish)
65 void R_Mesh_ClearDepth(void);
67 // renders current batch of meshs
68 // (only valid between R_Mesh_Start and R_Mesh_Finish)
69 void R_Mesh_Render(void);
71 // queues a mesh to be rendered (invokes Render if queue is full)
72 // (only valid between R_Mesh_Start and R_Mesh_Finish)
73 void R_Mesh_Draw(const rmeshinfo_t *m);
75 // renders the queued transparent meshs
76 // (only valid between R_Mesh_Start and R_Mesh_Finish)
77 void R_Mesh_AddTransparent(void);
79 // ease-of-use frontend to R_Mesh_Draw, set up meshinfo, except for index and numtriangles and numverts, then call this
80 // (only valid between R_Mesh_Start and R_Mesh_Finish)
81 void R_Mesh_DrawPolygon(rmeshinfo_t *m, int numverts);
83 // same as normal, except for harsh format restrictions (vertex must be 4 float, color must be 4 float, texcoord must be 2 float, flat color not supported)
84 // (only valid between R_Mesh_Start and R_Mesh_Finish)
85 void R_Mesh_Draw_NativeOnly(const rmeshinfo_t *m);
87 // allocates space in geometry buffers, and fills in pointers to the buffers in passsed struct
88 // (this is used for very high speed rendering, no copying)
89 // (only valid between R_Mesh_Start and R_Mesh_Finish)
90 int R_Mesh_Draw_GetBuffer(rmeshbufferinfo_t *m);
92 // saves a section of the rendered frame to a .tga file
93 qboolean SCR_ScreenShot(char *filename, int x, int y, int width, int height);
94 // used by R_Envmap_f and internally in backend, clears the frame
95 void R_ClearScreen(void);
96 // invoke refresh of frame
97 void SCR_UpdateScreen (void);