]> icculus.org git repositories - btb/d2x.git/blob - include/ogl_init.h
move ogl-internal stuff from ogl interface header to new file internal.h
[btb/d2x.git] / include / ogl_init.h
1 /* interface to OpenGL functions
2  * Added 9/15/99 Matthew Mueller
3  * Got rid of OpenGL-internal stuff 2004-5-16 Martin Schaffner
4  */
5
6 #ifndef _OGL_INIT_H_ 
7 #define _OGL_INIT_H_
8
9 #ifdef _MSC_VER
10 # undef MAC // dirty feckin hack
11 #include <windows.h>
12 #include <stddef.h>
13 # define MAC(x)
14 #endif
15
16 //#ifdef _WIN32
17 //#define OGL_RUNTIME_LOAD
18 //#endif
19
20 #ifdef OGL_RUNTIME_LOAD
21 #include "loadgl.h"
22 int ogl_init_load_library(void);
23 #else
24 #if defined(__APPLE__) && defined(__MACH__)
25 #include <OpenGL/gl.h>
26 #else
27 #include <GL/gl.h>
28 #endif
29 //######hack, since multi texture support is not working
30 #undef GL_ARB_multitexture
31 #undef GL_SGIS_multitexture
32 #endif
33
34 #ifndef GL_VERSION_1_1
35 #ifdef GL_EXT_texture
36 #define GL_INTENSITY4 GL_INTENSITY4_EXT
37 #define GL_INTENSITY8 GL_INTENSITY8_EXT
38 #endif
39 #endif
40
41 #include "gr.h"
42 #include "palette.h"
43 #include "pstypes.h"
44
45 /* we need to export ogl_texture for 2d/font.c */
46 typedef struct _ogl_texture {
47         GLuint handle;
48         GLint internalformat;
49         GLenum format;
50         int w,h,tw,th,lw;
51         int bytesu;
52         int bytes;
53         GLfloat u,v;
54         GLfloat prio;
55         int wrapstate;
56         fix lastrend;
57         unsigned long numrend;
58         char wantmip;
59 } ogl_texture;
60
61 extern ogl_texture* ogl_get_free_texture();
62
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;
70
71 extern int gl_initialized;
72 extern int GL_texmagfilt,GL_texminfilt,GL_needmipmaps;
73 extern int gl_reticle;
74
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
80
81 void ogl_loadbmtexture_m(grs_bitmap *bm,int domipmap);
82 void ogl_freebmtexture(grs_bitmap *bm);
83
84 void ogl_start_frame(void);
85 void ogl_end_frame(void);
86 void ogl_swap_buffers(void);
87 void ogl_set_screen_mode(void);
88 void ogl_cache_level_textures(void);
89
90 void ogl_urect(int left, int top, int right, int bot);
91 bool ogl_ubitmapm_c(int x, int y, grs_bitmap *bm, int c);
92 bool ogl_ubitmapm(int x, int y, grs_bitmap *bm);
93 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);
94 bool ogl_ubitblt(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
95 bool ogl_ubitblt_tolinear(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
96 bool ogl_ubitblt_copy(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
97 void ogl_upixelc(int x, int y, int c);
98 void ogl_ulinec(int left, int top, int right, int bot, int c);
99
100 #include "3d.h"
101 bool g3_draw_tmap_2(int nv,g3s_point **pointlist,g3s_uvl *uvl_list,grs_bitmap *bmbot,grs_bitmap *bm, int orient);
102
103 void ogl_draw_reticle(int cross, int primary, int secondary);
104
105 #endif _OGL_INIT_H_