]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - gl_backend.h
restructured transparent mesh processing to do conversion from straight index list...
[xonotic/darkplaces.git] / gl_backend.h
1
2 #define MAX_TEXTUREUNITS 4
3
4 extern int c_meshtris, c_meshs, c_transtris, c_transmeshs;
5
6 typedef struct
7 {
8         int transparent;
9         int depthwrite; // force depth writing enabled even if polygon is not opaque
10         int depthdisable; // disable depth read/write entirely
11         int blendfunc1;
12         int blendfunc2;
13         int numtriangles;
14         int *index;
15         int indexbase; // adjustment to add to the index values
16         int numverts;
17         float *vertex;
18         int vertexstep;
19         float *color;
20         int colorstep;
21         // if color is NULL, these are used for all vertices
22         float cr, cg, cb, ca;
23         int tex[MAX_TEXTUREUNITS];
24         float *texcoords[MAX_TEXTUREUNITS];
25         int texcoordstep[MAX_TEXTUREUNITS];
26         float texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
27 }
28 rmeshinfo_t;
29
30 // adds console variables and registers the render module (only call from GL_Init)
31 void gl_backend_init(void);
32 // sets up mesh renderer for the frame
33 void R_Mesh_Clear(void);
34 // renders queued meshs
35 void R_Mesh_Render(void);
36 // queues a mesh to be rendered (invokes Render if queue is full)
37 void R_Mesh_Draw(const rmeshinfo_t *m);
38 // renders the queued transparent meshs
39 void R_Mesh_AddTransparent(void);
40 // ease-of-use frontend to R_Mesh_Draw, set up meshinfo, except for index and numtriangles and numverts, then call this
41 void R_Mesh_DrawPolygon(rmeshinfo_t *m, int numverts);
42 // 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)
43 void R_Mesh_Draw_NativeOnly(const rmeshinfo_t *m);
44 // faster hardwired version of R_Mesh_Draw specifically for decals (has close ties to decal code)
45 //void R_Mesh_DrawDecal(const rmeshinfo_t *m);