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 #if defined(__APPLE__) && defined(__MACH__)
25 #include <OpenGL/gl.h>
29 //######hack, since multi texture support is not working
30 #undef GL_ARB_multitexture
31 #undef GL_SGIS_multitexture
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_intensity4_ok;
66 extern int ogl_luminance4_alpha4_ok;
67 extern int ogl_rgba2_ok;
68 extern int ogl_readpixels_ok;
69 extern int ogl_gettexlevelparam_ok;
71 extern int gl_initialized;
72 extern int GL_texmagfilt,GL_texminfilt,GL_needmipmaps;
73 extern int gl_reticle;
75 int ogl_check_mode(int x, int y); // check if mode is valid
76 int ogl_init_window(int x, int y);//create a window/switch modes/etc
77 void ogl_destroy_window(void);//destroy window/etc
78 void ogl_init(void);//one time initialization
79 void ogl_close(void);//one time shutdown
81 void ogl_loadbmtexture_m(grs_bitmap *bm,int domipmap);
82 void ogl_freebmtexture(grs_bitmap *bm);
84 void ogl_start_offscreen_render(int x, int y, int w, int h);
85 void ogl_end_offscreen_render(void);
86 void ogl_start_frame(void);
87 void ogl_end_frame(void);
88 void ogl_swap_buffers(void);
89 void ogl_set_screen_mode(void);
90 void ogl_cache_level_textures(void);
92 void ogl_urect(int left, int top, int right, int bot);
93 bool ogl_ubitmapm_c(int x, int y, grs_bitmap *bm, int c);
94 bool ogl_ubitmapm(int x, int y, grs_bitmap *bm);
95 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);
96 bool ogl_ubitblt(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
97 bool ogl_ubitblt_tolinear(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
98 bool ogl_ubitblt_copy(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
99 void ogl_upixelc(int x, int y, int c);
100 void ogl_ulinec(int left, int top, int right, int bot, int c);
103 bool g3_draw_tmap_2(int nv,g3s_point **pointlist,g3s_uvl *uvl_list,grs_bitmap *bmbot,grs_bitmap *bm, int orient);
105 void ogl_draw_reticle(int cross, int primary, int secondary);
107 #endif /* _OGL_INIT_H_ */