]> icculus.org git repositories - theoddone33/hhexen.git/blob - include/ogl_rl.h
Drop in SDL
[theoddone33/hhexen.git] / include / ogl_rl.h
1 #ifndef __OGL_REND_LIST_H__
2 #define __OGL_REND_LIST_H__
3
4 // Rendquad flags.
5 #define RQF_FLAT                        0x1             // This is a flat triangle.
6 #define RQF_MASKED                      0x2             // Use the special list for masked textures.
7 #define RQF_MISSING_WALL        0x4             // Originally this surface had no texture.
8 #define RQF_SKY_MASK            0x8             // A sky mask triangle.
9 #define RQF_SKY_MASK_WALL       0x10    // A sky mask wall (with skyfix).
10 #define RQF_LIGHT                       0x20    // A dynamic light.
11 #define RQF_FLOOR_FACING        0x40    // Used for flats, the quad faces upwards.
12
13 typedef struct
14 {
15         float   v1[2], v2[2];           // Two vertices.
16         float   top;                            // Top height.
17         union _quadTri {
18                 struct _quad {
19                         float bottom;           // Bottom height.
20                         float len;                      // Length of the quad.
21                 } q;
22                 float v3[2];                    // Third vertex for flats.
23         } u;
24         float   light;                          // Light level, as in 0 = black, 1 = fullbright.
25         float   texoffx;                        // Texture coordinates for left/top (in real texcoords).
26         float   texoffy;                        
27         short   flags;                          // RQF_*.
28         GLuint  masktex;                        // Texture name for masked textures.
29         unsigned short texw, texh;      // Size of the texture.
30         float   dist[3];                        // Distances to the vertices.
31 } rendquad_t; // Or flat triangle.
32
33 typedef struct
34 {
35         GLuint  tex;                            // The name of the texture for this list.
36         int             numquads;                       // Number of quads in the list.
37         int             listsize;                       // Absolute size of the list.
38         rendquad_t *quads;                      // The list of quads.   
39 } rendlist_t;
40
41
42 // ogl_rl.c
43
44 void RL_Init();
45 void RL_ClearLists();
46 void RL_DeleteLists();
47 void RL_AddQuad(rendquad_t *quad, GLuint quadtex);
48 void RL_AddFlatQuads(rendquad_t *base, GLuint quadtex, int numvrts, fvertex_t *vrts, int dir);
49 void RL_RenderAllLists();
50 void SetVertexColor(float light, float dist, float alpha);
51
52 #endif
53