version 1.7 | | version 1.8 |
---|
| | |
#include <GL/gl.h> | | #include <GL/gl.h> |
| | |
extern int gl_initialized; | | extern int gl_initialized; |
| | extern int GL_texmagfilt,GL_texminfilt,GL_needmipmaps; |
| | |
extern int GL_TEXTURE_2D_enabled; | | extern int GL_TEXTURE_2D_enabled; |
extern int GL_texclamp_enabled; | | extern int GL_texclamp_enabled; |
| | extern int GL_TEXTURE_ENV_MODE_state,GL_TEXTURE_MAG_FILTER_state,GL_TEXTURE_MIN_FILTER_state; |
#define OGL_ENABLE2(a,f) {if (a ## _enabled!=1) {f;a ## _enabled=1;}} | | #define OGL_ENABLE2(a,f) {if (a ## _enabled!=1) {f;a ## _enabled=1;}} |
#define OGL_DISABLE2(a,f) {if (a ## _enabled!=0) {f;a ## _enabled=0;}} | | #define OGL_DISABLE2(a,f) {if (a ## _enabled!=0) {f;a ## _enabled=0;}} |
| | |
#define OGL_ENABLE(a) OGL_ENABLE2(a,glEnable(a)) | | #define OGL_ENABLE(a) OGL_ENABLE2(a,glEnable(a)) |
#define OGL_DISABLE(a) OGL_DISABLE2(a,glDisable(a)) | | #define OGL_DISABLE(a) OGL_DISABLE2(a,glDisable(a)) |
| | |
#define OGL_TEXCLAMP() OGL_ENABLE2(GL_texclamp,glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);) | | #define OGL_TEXCLAMP() OGL_ENABLE2(GL_texclamp,glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);) |
#define OGL_TEXREPEAT() OGL_DISABLE2(GL_texclamp,glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);) | | #define OGL_TEXREPEAT() OGL_DISABLE2(GL_texclamp,glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);) |
| | |
| | #define OGL_SETSTATE(a,s,f) {if (a ## _state!=s) {f;a ## _state=s;}} |
| | |
| | #define OGL_TEXENV(p,m) OGL_SETSTATE(p,m,glTexEnvi(GL_TEXTURE_ENV, p,m)); |
| | #define OGL_TEXPARAM(p,m) OGL_SETSTATE(p,m,glTexParameteri(GL_TEXTURE_2D,p,m)); |
| | |
extern int last_width,last_height; | | extern int last_width,last_height; |
#define OGL_VIEWPORT(x,y,w,h){if (w!=last_width || h!=last_height){glViewport(x,y,w,h);last_width=w;last_height=h;}} | | #define OGL_VIEWPORT(x,y,w,h){if (w!=last_width || h!=last_height){glViewport(x,y,w,h);last_width=w;last_height=h;}} |
| | |
void ogl_close(void);//one time shutdown | | void ogl_close(void);//one time shutdown |
| | |
//generic funcs | | //generic funcs |
| | void ogl_loadbmtexture_m(grs_bitmap *bm,int domipmap); |
void ogl_loadbmtexture(grs_bitmap *bm); | | void ogl_loadbmtexture(grs_bitmap *bm); |
void ogl_loadtexture(unsigned char * data, int width, int height, int *texid,float *u,float *v); | | void ogl_loadtexture(unsigned char * data, int width, int height, int *texid,float *u,float *v,int domipmap); |
void ogl_do_palfx(void); | | void ogl_do_palfx(void); |
| | bool ogl_ubitmapm_c(int x, int y,grs_bitmap *bm,int c); |
| | bool ogl_ubitmapm(int x, int y,grs_bitmap *bm); |
| | |
| | |
//whee | | //whee |