]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - gl_backend.h
changed most #define macros to use (,,,) format instead of {;;;} so they will gobble...
[xonotic/darkplaces.git] / gl_backend.h
1
2 #define MAX_TEXTUREUNITS 4
3
4 extern int c_meshtris;
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 numverts;
16         float *vertex;
17         int vertexstep;
18         float *color;
19         int colorstep;
20         // if color is NULL, these are used for all vertices
21         float cr, cg, cb, ca;
22         int tex[MAX_TEXTUREUNITS];
23         float *texcoords[MAX_TEXTUREUNITS];
24         int texcoordstep[MAX_TEXTUREUNITS];
25         float texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
26 }
27 rmeshinfo_t;
28
29 // adds console variables and registers the render module (only call from GL_Init)
30 void gl_backend_init(void);
31 // sets up mesh renderer for the frame
32 void R_Mesh_Clear(void);
33 // renders queued meshs
34 void R_Mesh_Render(void);
35 // queues a mesh to be rendered (invokes Render if queue is full)
36 void R_Mesh_Draw(const rmeshinfo_t *m);
37 // renders the queued transparent meshs
38 void R_Mesh_AddTransparent(void);
39 // ease-of-use frontend to R_Mesh_Draw, set up meshinfo, except for index and numtriangles and numverts, then call this
40 void R_Mesh_DrawPolygon(rmeshinfo_t *m, int numverts);
41 // faster hardwired version of R_Mesh_Draw specifically for decals (has close ties to decal code)
42 void R_Mesh_DrawDecal(const rmeshinfo_t *m);