2 * Copyright (C) 2003 Robert Kooima
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.
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.
19 #include "solid_base.h"
20 #include "solid_vary.h"
23 * Rendered solid data.
26 /*---------------------------------------------------------------------------*/
42 /*---------------------------------------------------------------------------*/
46 const struct b_mtrl *base;
48 GLuint d; /* 32-bit diffuse color cache */
49 GLuint a; /* 32-bit ambient color cache */
50 GLuint s; /* 32-bit specular color cache */
51 GLuint e; /* 32-bit emissive color cache */
52 GLuint h; /* 32-bit specular exponent cache */
53 GLuint o; /* OpenGL texture object */
58 const struct d_mtrl *mp;
60 GLuint vbo; /* Vertex buffer object */
61 GLuint ebo; /* Element buffer object */
62 GLuint ebc; /* Element buffer count */
67 const struct b_body *base;
77 const struct s_base *base;
78 const struct s_vary *vary;
92 /*---------------------------------------------------------------------------*/
95 * This structure holds rendering state shared between separate
96 * SOLs. I am aware that the name leaves much to be desired.
101 const struct d_mtrl *mp;
104 /*---------------------------------------------------------------------------*/
106 int sol_load_draw(struct s_draw *, const struct s_vary *, int);
107 void sol_free_draw(struct s_draw *);
109 void sol_draw_enable(struct s_rend *);
110 void sol_draw_disable(struct s_rend *);
112 void sol_load_mtrl(struct d_mtrl *, const struct b_mtrl *);
113 void sol_free_mtrl(struct d_mtrl *);
115 void sol_apply_mtrl(const struct d_mtrl *, struct s_rend *);
117 void sol_back(const struct s_draw *, struct s_rend *, float, float, float);
118 void sol_refl(const struct s_draw *, struct s_rend *);
119 void sol_draw(const struct s_draw *, struct s_rend *, int, int);
120 void sol_bill(const struct s_draw *, struct s_rend *, const float *, float);
122 void sol_fade(const struct s_draw *, float);
124 /*---------------------------------------------------------------------------*/
133 int sol_load_full(struct s_full *, const char *, int);
134 void sol_free_full(struct s_full *);
136 /*---------------------------------------------------------------------------*/