30d1583f61793172b497d96471e7d4418289cea6
[neverball] / share / solid_draw.h
1 /*
2  * Copyright (C) 2003 Robert Kooima
3  *
4  * NEVERBALL is  free software; you can redistribute  it and/or modify
5  * it under the  terms of the GNU General  Public License as published
6  * by the Free  Software Foundation; either version 2  of the License,
7  * or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT  ANY  WARRANTY;  without   even  the  implied  warranty  of
11  * MERCHANTABILITY or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU
12  * General Public License for more details.
13  */
14
15 #ifndef SOLID_DRAW_H
16 #define SOLID_DRAW_H
17
18 #include "solid_base.h"
19 #include "solid_vary.h"
20
21 /*
22  * Rendered solid data.
23  */
24
25 /*---------------------------------------------------------------------------*/
26
27 struct d_mtrl
28 {
29     const struct b_mtrl *base;
30
31     GLuint o;                                  /* OpenGL texture object      */
32 };
33
34 struct d_body
35 {
36     const struct b_body *base;
37
38     GLuint ol;                                 /* opaque geometry list       */
39     GLuint tl;                                 /* transparent geometry list  */
40     GLuint rl;                                 /* reflective geometry list   */
41     GLuint sl;                                 /* shadowed geometry list     */
42 };
43
44 struct s_draw
45 {
46     const struct s_base *base;
47     const struct s_vary *vary;
48
49     int mc;
50     int bc;
51
52     struct d_mtrl *mv;
53     struct d_body *bv;
54
55     int reflective;
56 };
57
58 /*---------------------------------------------------------------------------*/
59
60 int  sol_load_draw(struct s_draw *, const struct s_vary *, int);
61 void sol_free_draw(struct s_draw *);
62
63 void sol_back(const struct s_draw *, float, float, float);
64 void sol_refl(const struct s_draw *);
65 void sol_draw(const struct s_draw *, int, int);
66 void sol_bill(const struct s_draw *, const float *, float);
67 void sol_shad(const struct s_draw *, int);
68
69 /*---------------------------------------------------------------------------*/
70
71 struct s_full
72 {
73     struct s_base base;
74     struct s_vary vary;
75     struct s_draw draw;
76 };
77
78 int  sol_load_full(struct s_full *, const char *, int);
79 void sol_free_full(struct s_full *);
80
81 /*---------------------------------------------------------------------------*/
82
83 #endif