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_version;
44 extern int GL_viewport_x;
45 extern int GL_viewport_y;
46 extern int GL_viewport_w;
47 extern int GL_viewport_h;
48 extern float GL_viewport_scale_w;
49 extern float GL_viewport_scale_h;
50 extern int GL_min_texture_width;
51 extern int GL_max_texture_width;
52 extern int GL_min_texture_height;
53 extern int GL_max_texture_height;
56 void opengl_set_variables();
57 void opengl_init_viewport();
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 void gr_opengl_print_screen(const char *filename);
79 uint gr_opengl_lock();
80 void gr_opengl_unlock();
81 void gr_opengl_zbias(int bias);
82 void gr_opengl_set_cull(int cull);
83 void gr_opengl_activate(int active);
85 #endif // _OPENGLINTERNAL_H