1 /* interface to OpenGL functions
2 * Added 9/15/99 Matthew Mueller
3 * Got rid of OpenGL-internal stuff 2004-5-16 Martin Schaffner
10 # undef MAC // dirty feckin hack
17 //#define OGL_RUNTIME_LOAD
20 #ifdef OGL_RUNTIME_LOAD
22 int ogl_init_load_library(void);
24 #define GL_GLEXT_LEGACY
25 #undef GL_ARB_multitexture
26 #if defined(__APPLE__) && defined(__MACH__)
27 #include <OpenGL/gl.h>
29 #define GL_GLEXT_PROTOTYPES
34 #ifndef GL_VERSION_1_1
36 #define GL_INTENSITY4 GL_INTENSITY4_EXT
37 #define GL_INTENSITY8 GL_INTENSITY8_EXT
45 /* we need to export ogl_texture for 2d/font.c */
46 typedef struct _ogl_texture {
57 unsigned long numrend;
61 extern ogl_texture* ogl_get_free_texture();
63 extern int ogl_alttexmerge;//merge textures by just printing the seperate textures?
64 extern int ogl_rgba_format;
65 extern int ogl_setgammaramp_ok;
66 extern int ogl_intensity4_ok;
67 extern int ogl_luminance4_alpha4_ok;
68 extern int ogl_rgba2_ok;
69 extern int ogl_readpixels_ok;
70 extern int ogl_gettexlevelparam_ok;
72 #ifndef EXT_texture_env_combine
73 #define EXT_texture_env_combine 1
74 #define GL_COMBINE_RGB_EXT 0x8571
75 #define GL_COMBINE_ALPHA_EXT 0x8572
76 #define GL_PRIMARY_COLOR_EXT 0x8577
77 #define GL_PREVIOUS_EXT 0x8578
78 #define GL_SOURCE0_RGB_EXT 0x8580
79 #define GL_SOURCE1_RGB_EXT 0x8581
80 #define GL_SOURCE2_RGB_EXT 0x8582
81 #define GL_SOURCE0_ALPHA_EXT 0x8588
82 #define GL_SOURCE1_ALPHA_EXT 0x8589
83 #define GL_SOURCE2_ALPHA_EXT 0x858A
84 #define GL_OPERAND0_RGB_EXT 0x8590
85 #define GL_OPERAND1_RGB_EXT 0x8591
86 #define GL_OPERAND2_RGB_EXT 0x8592
87 #define GL_OPERAND0_ALPHA_EXT 0x8598
88 #define GL_OPERAND1_ALPHA_EXT 0x8599
89 #define GL_OPERAND2_ALPHA_EXT 0x859A
92 #ifndef GL_NV_texture_env_combine4
93 #define GL_NV_texture_env_combine4 1
94 #define GL_COMBINE4_NV 0x8503
95 #define GL_SOURCE3_RGB_NV 0x8583
96 #define GL_SOURCE3_ALPHA_NV 0x858B
97 #define GL_OPERAND3_RGB_NV 0x8593
98 #define GL_OPERAND3_ALPHA_NV 0x859B
100 extern int ogl_nv_texture_env_combine4_ok;
102 #ifndef GL_EXT_texture_filter_anisotropic
103 #define GL_EXT_texture_filter_anisotropic 1
104 #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
105 #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
107 extern int ogl_ext_texture_filter_anisotropic_ok;
109 #ifndef GL_EXT_shared_texture_palette
110 #define GL_EXT_shared_texture_palette 1
111 #define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
114 #ifdef GL_EXT_paletted_texture
115 extern int ogl_paletted_texture_ok;
116 extern int ogl_shared_palette_ok;
118 void ogl_init_shared_palette(void);
120 extern int gl_initialized;
121 extern int GL_texmagfilt,GL_texminfilt,GL_needmipmaps;
122 extern float GL_texanisofilt;
123 extern int gl_reticle;
125 extern int active_texture_unit;
126 void ogl_setActiveTexture(int t);
128 int ogl_check_mode(int x, int y); // check if mode is valid
129 int ogl_init_window(int x, int y);//create a window/switch modes/etc
130 void ogl_destroy_window(void);//destroy window/etc
131 void ogl_init(void);//one time initialization
132 void ogl_close(void);//one time shutdown
134 void ogl_loadbmtexture_m(grs_bitmap *bm,int domipmap);
135 void ogl_freebmtexture(grs_bitmap *bm);
137 void ogl_start_offscreen_render(int x, int y, int w, int h);
138 void ogl_end_offscreen_render(void);
139 void ogl_start_frame(void);
140 void ogl_end_frame(void);
141 void ogl_swap_buffers(void);
142 void ogl_set_screen_mode(void);
143 void ogl_cache_level_textures(void);
145 void ogl_urect(int left, int top, int right, int bot);
146 bool ogl_ubitmapm_c(int x, int y, grs_bitmap *bm, int c);
147 bool ogl_ubitmapm(int x, int y, grs_bitmap *bm);
148 bool ogl_ubitblt_i(int dw, int dh, int dx, int dy, int sw, int sh, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
149 bool ogl_ubitblt(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
150 bool ogl_ubitblt_tolinear(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
151 bool ogl_ubitblt_copy(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
152 void ogl_upixelc(int x, int y, int c);
153 void ogl_ulinec(int left, int top, int right, int bot, int c);
156 bool g3_draw_tmap_2(int nv,g3s_point **pointlist,g3s_uvl *uvl_list,grs_bitmap *bmbot,grs_bitmap *bm, int orient);
158 void ogl_draw_reticle(int cross, int primary, int secondary);
160 #endif /* _OGL_INIT_H_ */