]> icculus.org git repositories - divverent/darkplaces.git/blob - gl_backend.h
you can now (try to) play in maps you don't have, and models you don't have are shown...
[divverent/darkplaces.git] / gl_backend.h
1
2 #ifndef GL_BACKEND_H
3 #define GL_BACKEND_H
4
5 #define MAX_TEXTUREUNITS 8
6
7 extern int c_meshtris, c_meshs, c_transtris, c_transmeshs;
8
9 typedef struct
10 {
11         //input to R_Mesh_Draw_GetBuffer
12         int depthwrite; // force depth writing enabled even if polygon is not opaque
13         int depthdisable; // disable depth read/write entirely
14         int blendfunc1;
15         int blendfunc2;
16         int numtriangles;
17         int numverts;
18         int tex[MAX_TEXTUREUNITS];
19         int texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
20         matrix4x4_t matrix; // model to world transform matrix
21
22         // output
23         int *index;
24         float *vertex;
25         float *color;
26         float colorscale;
27         float *texcoords[MAX_TEXTUREUNITS];
28 }
29 rmeshbufferinfo_t;
30
31 // adds console variables and registers the render module (only call from GL_Init)
32 void gl_backend_init(void);
33
34 // starts mesh rendering for the frame
35 void R_Mesh_Start(float farclip);
36
37 // ends mesh rendering for the frame
38 // (only valid after R_Mesh_Start)
39 void R_Mesh_Finish(void);
40
41 // clears depth buffer, used for masked sky rendering
42 // (only valid between R_Mesh_Start and R_Mesh_Finish)
43 void R_Mesh_ClearDepth(void);
44
45 // renders current batch of meshs
46 // (only valid between R_Mesh_Start and R_Mesh_Finish)
47 void R_Mesh_Render(void);
48
49 // allocates space in geometry buffers, and fills in pointers to the buffers in passsed struct
50 // (it is up to the caller to fill in the geometry data)
51 // (make sure you scale your colors by the colorscale field)
52 // (only valid between R_Mesh_Start and R_Mesh_Finish)
53 int R_Mesh_Draw_GetBuffer(rmeshbufferinfo_t *m, int wantoverbright);
54
55 // saves a section of the rendered frame to a .tga file
56 qboolean SCR_ScreenShot(char *filename, int x, int y, int width, int height);
57 // used by R_Envmap_f and internally in backend, clears the frame
58 void R_ClearScreen(void);
59 // invoke refresh of frame
60 void SCR_UpdateScreen (void);
61
62 #endif
63