2 #define MAX_TEXTUREUNITS 8
4 extern int c_meshtris, c_meshs, c_transtris, c_transmeshs;
9 int depthwrite; // force depth writing enabled even if polygon is not opaque
10 int depthdisable; // disable depth read/write entirely
20 float cr, cg, cb, ca; // if color is NULL, these are used for all vertices
21 int tex[MAX_TEXTUREUNITS];
22 float *texcoords[MAX_TEXTUREUNITS];
23 int texcoordstep[MAX_TEXTUREUNITS];
24 float texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
30 //input to R_Mesh_Draw_GetBuffer
32 int depthwrite; // force depth writing enabled even if polygon is not opaque
33 int depthdisable; // disable depth read/write entirely
38 int tex[MAX_TEXTUREUNITS];
39 float texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
46 float *texcoords[MAX_TEXTUREUNITS];
50 // adds console variables and registers the render module (only call from GL_Init)
51 void gl_backend_init(void);
53 // starts mesh rendering for the frame
54 void R_Mesh_Start(void);
56 // ends mesh rendering for the frame
57 // (only valid after R_Mesh_Start)
58 void R_Mesh_Finish(void);
60 // clears depth buffer, used for masked sky rendering
61 // (only valid between R_Mesh_Start and R_Mesh_Finish)
62 void R_Mesh_ClearDepth(void);
64 // renders current batch of meshs
65 // (only valid between R_Mesh_Start and R_Mesh_Finish)
66 void R_Mesh_Render(void);
68 // queues a mesh to be rendered (invokes Render if queue is full)
69 // (only valid between R_Mesh_Start and R_Mesh_Finish)
70 void R_Mesh_Draw(const rmeshinfo_t *m);
72 // renders the queued transparent meshs
73 // (only valid between R_Mesh_Start and R_Mesh_Finish)
74 void R_Mesh_AddTransparent(void);
76 // ease-of-use frontend to R_Mesh_Draw, set up meshinfo, except for index and numtriangles and numverts, then call this
77 // (only valid between R_Mesh_Start and R_Mesh_Finish)
78 void R_Mesh_DrawPolygon(rmeshinfo_t *m, int numverts);
80 // 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)
81 // (only valid between R_Mesh_Start and R_Mesh_Finish)
82 void R_Mesh_Draw_NativeOnly(const rmeshinfo_t *m);
84 // allocates space in geometry buffers, and fills in pointers to the buffers in passsed struct
85 // (this is used for very high speed rendering, no copying)
86 // (only valid between R_Mesh_Start and R_Mesh_Finish)
87 int R_Mesh_Draw_GetBuffer(rmeshbufferinfo_t *m);
89 // saves a section of the rendered frame to a .tga file
90 void SCR_ScreenShot(char *filename, int x, int y, int width, int height);
91 // used by R_Envmap_f and internally in backend, clears the frame
92 void R_ClearScreen(void);
93 // invoke refresh of frame
94 void SCR_UpdateScreen (void);