2004-05-16 00:45:25 +00:00
|
|
|
/* interface to OpenGL functions
|
|
|
|
* Added 9/15/99 Matthew Mueller
|
|
|
|
* Got rid of OpenGL-internal stuff 2004-5-16 Martin Schaffner
|
|
|
|
*/
|
|
|
|
|
2001-01-19 03:30:16 +00:00
|
|
|
#ifndef _OGL_INIT_H_
|
|
|
|
#define _OGL_INIT_H_
|
|
|
|
|
2003-11-27 00:21:04 +00:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
# undef MAC // dirty feckin hack
|
2001-01-19 03:30:16 +00:00
|
|
|
#include <windows.h>
|
|
|
|
#include <stddef.h>
|
2003-11-27 00:21:04 +00:00
|
|
|
# define MAC(x)
|
2001-01-19 03:30:16 +00:00
|
|
|
#endif
|
|
|
|
|
2003-11-27 00:21:04 +00:00
|
|
|
//#ifdef _WIN32
|
2001-01-19 03:30:16 +00:00
|
|
|
//#define OGL_RUNTIME_LOAD
|
|
|
|
//#endif
|
|
|
|
|
|
|
|
#ifdef OGL_RUNTIME_LOAD
|
|
|
|
#include "loadgl.h"
|
|
|
|
int ogl_init_load_library(void);
|
|
|
|
#else
|
2003-04-11 23:53:15 +00:00
|
|
|
#if defined(__APPLE__) && defined(__MACH__)
|
2002-07-22 02:17:10 +00:00
|
|
|
#include <OpenGL/gl.h>
|
|
|
|
#else
|
2001-01-19 03:30:16 +00:00
|
|
|
#include <GL/gl.h>
|
2002-07-22 02:17:10 +00:00
|
|
|
#endif
|
2001-10-09 03:00:08 +00:00
|
|
|
//######hack, since multi texture support is not working
|
|
|
|
#undef GL_ARB_multitexture
|
|
|
|
#undef GL_SGIS_multitexture
|
2001-01-19 03:30:16 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef GL_VERSION_1_1
|
|
|
|
#ifdef GL_EXT_texture
|
|
|
|
#define GL_INTENSITY4 GL_INTENSITY4_EXT
|
|
|
|
#define GL_INTENSITY8 GL_INTENSITY8_EXT
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "gr.h"
|
|
|
|
#include "palette.h"
|
|
|
|
#include "pstypes.h"
|
|
|
|
|
2004-05-16 00:45:25 +00:00
|
|
|
/* we need to export ogl_texture for 2d/font.c */
|
2001-01-19 03:30:16 +00:00
|
|
|
typedef struct _ogl_texture {
|
2002-07-30 21:21:02 +00:00
|
|
|
GLuint handle;
|
2001-01-19 03:30:16 +00:00
|
|
|
GLint internalformat;
|
|
|
|
GLenum format;
|
|
|
|
int w,h,tw,th,lw;
|
|
|
|
int bytesu;
|
|
|
|
int bytes;
|
|
|
|
GLfloat u,v;
|
|
|
|
GLfloat prio;
|
|
|
|
int wrapstate;
|
|
|
|
fix lastrend;
|
2003-12-08 22:32:56 +00:00
|
|
|
unsigned long numrend;
|
2001-01-19 03:30:16 +00:00
|
|
|
char wantmip;
|
|
|
|
} ogl_texture;
|
|
|
|
|
2004-05-16 00:45:25 +00:00
|
|
|
extern ogl_texture* ogl_get_free_texture();
|
2001-01-19 03:30:16 +00:00
|
|
|
|
|
|
|
extern int ogl_alttexmerge;//merge textures by just printing the seperate textures?
|
|
|
|
extern int ogl_rgba_format;
|
|
|
|
extern int ogl_intensity4_ok;
|
|
|
|
extern int ogl_luminance4_alpha4_ok;
|
|
|
|
extern int ogl_rgba2_ok;
|
|
|
|
extern int ogl_readpixels_ok;
|
2001-10-09 03:00:08 +00:00
|
|
|
extern int ogl_gettexlevelparam_ok;
|
2001-01-19 03:30:16 +00:00
|
|
|
|
|
|
|
extern int gl_initialized;
|
|
|
|
extern int GL_texmagfilt,GL_texminfilt,GL_needmipmaps;
|
|
|
|
extern int gl_reticle;
|
|
|
|
|
2003-11-27 09:32:38 +00:00
|
|
|
int ogl_check_mode(int x, int y); // check if mode is valid
|
2001-01-19 03:30:16 +00:00
|
|
|
int ogl_init_window(int x, int y);//create a window/switch modes/etc
|
|
|
|
void ogl_destroy_window(void);//destroy window/etc
|
|
|
|
void ogl_init(void);//one time initialization
|
|
|
|
void ogl_close(void);//one time shutdown
|
|
|
|
|
|
|
|
void ogl_loadbmtexture_m(grs_bitmap *bm,int domipmap);
|
|
|
|
void ogl_freebmtexture(grs_bitmap *bm);
|
2004-05-16 00:45:25 +00:00
|
|
|
|
2004-05-19 03:29:04 +00:00
|
|
|
void ogl_start_offscreen_render(int x, int y, int w, int h);
|
|
|
|
void ogl_end_offscreen_render(void);
|
2001-01-19 03:30:16 +00:00
|
|
|
void ogl_start_frame(void);
|
|
|
|
void ogl_end_frame(void);
|
|
|
|
void ogl_swap_buffers(void);
|
|
|
|
void ogl_set_screen_mode(void);
|
|
|
|
void ogl_cache_level_textures(void);
|
|
|
|
|
2004-05-16 00:45:25 +00:00
|
|
|
void ogl_urect(int left, int top, int right, int bot);
|
|
|
|
bool ogl_ubitmapm_c(int x, int y, grs_bitmap *bm, int c);
|
|
|
|
bool ogl_ubitmapm(int x, int y, grs_bitmap *bm);
|
|
|
|
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);
|
|
|
|
bool ogl_ubitblt(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
|
|
|
|
bool ogl_ubitblt_tolinear(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
|
|
|
|
bool ogl_ubitblt_copy(int w, int h, int dx, int dy, int sx, int sy, grs_bitmap * src, grs_bitmap * dest);
|
2001-01-19 03:30:16 +00:00
|
|
|
void ogl_upixelc(int x, int y, int c);
|
2004-05-16 00:45:25 +00:00
|
|
|
void ogl_ulinec(int left, int top, int right, int bot, int c);
|
2001-01-19 03:30:16 +00:00
|
|
|
|
|
|
|
#include "3d.h"
|
2004-05-16 00:45:25 +00:00
|
|
|
bool g3_draw_tmap_2(int nv,g3s_point **pointlist,g3s_uvl *uvl_list,grs_bitmap *bmbot,grs_bitmap *bm, int orient);
|
2001-01-19 03:30:16 +00:00
|
|
|
|
2004-05-16 00:45:25 +00:00
|
|
|
void ogl_draw_reticle(int cross, int primary, int secondary);
|
|
|
|
|
2004-05-19 03:29:04 +00:00
|
|
|
#endif /* _OGL_INIT_H_ */
|