2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
9 #ifndef _OPENGLINTERNAL_H
10 #define _OPENGLINTERNAL_H
15 typedef enum gr_texture_source {
18 TEXTURE_SOURCE_NO_FILTERING,
21 typedef enum gr_alpha_blend {
22 ALPHA_BLEND_NONE, // 1*SrcPixel + 0*DestPixel
23 ALPHA_BLEND_ADDITIVE, // 1*SrcPixel + 1*DestPixel
24 ALPHA_BLEND_ALPHA_ADDITIVE, // Alpha*SrcPixel + 1*DestPixel
25 ALPHA_BLEND_ALPHA_BLEND_ALPHA, // Alpha*SrcPixel + (1-Alpha)*DestPixel
26 ALPHA_BLEND_ALPHA_BLEND_SRC_COLOR, // Alpha*SrcPixel + (1-SrcPixel)*DestPixel
29 typedef enum gr_zbuffer_type {
36 extern volatile int GL_activate;
37 extern volatile int GL_deactivate;
39 extern SDL_Window *GL_window;
40 extern SDL_GLContext GL_context;
42 extern int GL_viewport_x;
43 extern int GL_viewport_y;
44 extern int GL_viewport_w;
45 extern int GL_viewport_h;
46 extern float GL_viewport_scale_w;
47 extern float GL_viewport_scale_h;
48 extern int GL_min_texture_width;
49 extern int GL_max_texture_width;
50 extern int GL_min_texture_height;
51 extern int GL_max_texture_height;
54 void opengl_set_variables();
55 void opengl_init_viewport();
57 void opengl_stuff_fog_value(float z, float *f_val);
59 void opengl_alloc_render_buffer(unsigned int nelems);
60 void opengl_free_render_buffer();
69 extern rb_t *render_buffer;
72 // gr_* pointer functions
73 void gr_opengl_force_fullscreen();
74 void gr_opengl_force_windowed();
75 void gr_opengl_toggle_fullscreen();
76 void gr_opengl_clear();
77 void gr_opengl_reset_clip();
78 uint gr_opengl_lock();
79 void gr_opengl_unlock();
80 void gr_opengl_zbias(int bias);
81 void gr_opengl_set_cull(int cull);
82 void gr_opengl_activate(int active);
84 #endif // _OPENGLINTERNAL_H