]> icculus.org git repositories - divverent/darkplaces.git/blob - gl_backend.h
remove an unused variable (and kill the one incorrect use of it)
[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 #define POLYGONELEMENTS_MAXPOINTS 258
8 extern int polygonelements[768];
9
10 void GL_SetupView_ViewPort(int x, int y, int width, int height);
11 void GL_SetupView_Orientation_Identity(void);
12 void GL_SetupView_Orientation_FromEntity(vec3_t origin, vec3_t angles);
13 void GL_SetupView_Mode_Perspective(double fovx, double fovy, double zNear, double zFar);
14 void GL_SetupView_Mode_PerspectiveInfiniteFarClip(double fovx, double fovy, double zNear);
15 void GL_SetupView_Mode_Ortho(double x1, double y1, double x2, double y2, double zNear, double zFar);
16 void GL_BlendFunc(int blendfunc1, int blendfunc2);
17 void GL_DepthMask(int state);
18 void GL_DepthTest(int state);
19 void GL_VertexPointer(const float *p);
20 void GL_ColorPointer(const float *p);
21 void GL_Color(float cr, float cg, float cb, float ca);
22 void GL_TransformToScreen(const vec4_t in, vec4_t out);
23 void GL_LockArrays(int first, int count);
24 void GL_ActiveTexture(int num);
25 void GL_ClientActiveTexture(int num);
26
27 extern cvar_t gl_lockarrays;
28 extern cvar_t gl_mesh_copyarrays;
29 extern cvar_t gl_paranoid;
30 extern cvar_t gl_printcheckerror;
31
32 extern int c_meshelements, c_meshs;
33
34 //input to R_Mesh_State
35 typedef struct
36 {
37         // textures
38         int tex1d[MAX_TEXTUREUNITS];
39         int tex[MAX_TEXTUREUNITS];
40         int tex3d[MAX_TEXTUREUNITS];
41         int texcubemap[MAX_TEXTUREUNITS];
42         // texture combine settings
43         int texrgbscale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
44         int texalphascale[MAX_TEXTUREUNITS]; // used only if COMBINE is present
45         int texcombinergb[MAX_TEXTUREUNITS]; // works with or without combine for some operations
46         int texcombinealpha[MAX_TEXTUREUNITS]; // does nothing without combine
47         // pointers
48         const float *pointer_texcoord[MAX_TEXTUREUNITS];
49 }
50 rmeshstate_t;
51
52 // overbright rendering scale for the current state
53 extern int r_lightmapscalebit;
54 extern float r_colorscale;
55
56 // adds console variables and registers the render module (only call from GL_Init)
57 void gl_backend_init(void);
58
59 // starts mesh rendering for the frame
60 void R_Mesh_Start(void);
61
62 // ends mesh rendering for the frame
63 // (only valid after R_Mesh_Start)
64 void R_Mesh_Finish(void);
65
66 // sets up the requested transform matrix
67 void R_Mesh_Matrix(const matrix4x4_t *matrix);
68
69 // sets up the requested transform matrix
70 void R_Mesh_TextureMatrix(int unitnumber, const matrix4x4_t *matrix);
71
72 // set up the requested state
73 void R_Mesh_State_Texture(const rmeshstate_t *m);
74
75 // renders a mesh
76 void R_Mesh_Draw(int numverts, int numtriangles, const int *elements);
77
78 // saves a section of the rendered frame to a .tga or .jpg file
79 qboolean SCR_ScreenShot(char *filename, int x, int y, int width, int height, qboolean jpeg);
80 // used by R_Envmap_f and internally in backend, clears the frame
81 void R_ClearScreen(void);
82 // invoke refresh of frame
83 void SCR_UpdateScreen(void);
84
85 // public structure
86 typedef struct rcachearrayrequest_s
87 {
88         // for use by the code that is requesting the array, these are not
89         // directly used but merely compared to determine if cache items are
90         // identical
91         const void *id_pointer1;
92         const void *id_pointer2;
93         const void *id_pointer3;
94         int id_number1;
95         int id_number2;
96         int id_number3;
97         // size of array data
98         int data_size;
99         // array data pointer
100         void *data;
101 }
102 rcachearrayrequest_t;
103
104 int R_Mesh_CacheArray(rcachearrayrequest_t *r);
105
106 extern float varray_vertex3f[65536*3];
107 extern float varray_color4f[65536*4];
108 extern float varray_texcoord2f[4][65536*2];
109 extern float varray_texcoord3f[4][65536*3];
110 extern float varray_normal3f[65536*3];
111
112 #endif
113