2 RetroRay - integrated standalone vintage modeller/renderer
3 Copyright (C) 2023 John Tsiombikas <nuclear@mutantstargoat.com>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>.
18 #ifndef GRAPHICS_API_WRAPPER_H_
19 #define GRAPHICS_API_WRAPPER_H_
80 GAW_ONE_MINUS_SRC_ALPHA
100 void gaw_viewport(int x, int y, int w, int h);
101 void gaw_get_viewport(int *vp);
103 void gaw_matrix_mode(int mode);
104 void gaw_load_identity(void);
105 void gaw_load_matrix(const float *m);
106 void gaw_mult_matrix(const float *m);
107 void gaw_push_matrix(void);
108 void gaw_pop_matrix(void);
109 void gaw_get_modelview(float *m);
110 void gaw_get_projection(float *m);
112 void gaw_translate(float x, float y, float z);
113 void gaw_rotate(float angle, float x, float y, float z);
114 void gaw_scale(float sx, float sy, float sz);
115 void gaw_ortho(float l, float r, float b, float t, float n, float f);
116 void gaw_frustum(float l, float r, float b, float t, float n, float f);
117 void gaw_perspective(float vfov, float aspect, float znear, float zfar);
120 void gaw_restore(void);
121 void gaw_enable(int st);
122 void gaw_disable(int st);
124 void gaw_depth_func(int func);
125 void gaw_blend_func(int src, int dest);
126 void gaw_alpha_func(int func, float ref);
128 void gaw_zoffset(float offs);
130 void gaw_clear_color(float r, float g, float b, float a);
131 void gaw_clear(unsigned int flags);
132 void gaw_depth_mask(int mask);
134 void gaw_vertex_array(int nelem, int stride, const void *ptr);
135 void gaw_normal_array(int stride, const void *ptr);
136 void gaw_texcoord_array(int nelem, int stride, const void *ptr);
137 void gaw_color_array(int nelem, int stride, const void *ptr);
138 void gaw_draw(int prim, int nverts);
139 void gaw_draw_indexed(int prim, const unsigned int *idxarr, int nidx);
141 void gaw_begin(int prim);
143 void gaw_color3f(float r, float g, float b);
144 void gaw_color4f(float r, float g, float b, float a);
145 void gaw_color3ub(int r, int g, int b);
146 void gaw_normal(float x, float y, float z);
147 void gaw_texcoord1f(float u);
148 void gaw_texcoord2f(float u, float v);
149 void gaw_vertex2f(float x, float y);
150 void gaw_vertex3f(float x, float y, float z);
151 void gaw_vertex4f(float x, float y, float z, float w);
153 void gaw_rect(float x1, float y1, float x2, float y2);
155 void gaw_pointsize(float sz);
156 void gaw_linewidth(float w);
158 int gaw_compile_begin(void);
159 void gaw_compile_end(void);
160 void gaw_draw_compiled(int id);
161 void gaw_free_compiled(int id);
163 void gaw_mtl_diffuse(float r, float g, float b, float a);
164 void gaw_mtl_specular(float r, float g, float b, float shin);
165 void gaw_mtl_emission(float r, float g, float b);
166 void gaw_texenv_sphmap(int enable);
168 unsigned int gaw_create_tex1d(int texfilter);
169 unsigned int gaw_create_tex2d(int texfilter);
170 void gaw_destroy_tex(unsigned int tex);
172 void gaw_bind_tex1d(int tex);
173 void gaw_bind_tex2d(int tex);
175 void gaw_texfilter1d(int texfilter);
176 void gaw_texfilter2d(int texfilter);
178 void gaw_texwrap1d(int wrap);
179 void gaw_texwrap2d(int uwrap, int vwrap);
181 void gaw_tex1d(int ifmt, int xsz, int fmt, void *pix);
182 void gaw_tex2d(int ifmt, int xsz, int ysz, int fmt, void *pix);
183 void gaw_subtex2d(int lvl, int x, int y, int xsz, int ysz, int fmt, void *pix);
185 void gaw_set_tex1d(unsigned int texid);
186 void gaw_set_tex2d(unsigned int texid);
188 void gaw_ambient(float r, float g, float b);
189 void gaw_light_dir(int idx, float x, float y, float z);
190 void gaw_light_color(int idx, float r, float g, float b, float s);
191 void gaw_lighting_fast(void);
193 void gaw_fog_color(float r, float g, float b);
194 void gaw_fog_linear(float z0, float z1);
195 void gaw_fog_fast(void);
197 void gaw_poly_wire(void);
198 void gaw_poly_flat(void);
199 void gaw_poly_gouraud(void);
201 #endif /* GRAPHICS_API_WRAPPER_H_ */