From 396270225abff2ef8ed5d63743ac672b4d18b62e Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Tue, 30 Jul 2002 21:21:02 +0000 Subject: [PATCH] OSX OGL fixes --- arch/ogl/gr.c | 1 + arch/ogl/ogl.c | 10 ++++++---- configure.ac | 12 ++++++------ include/ogl_init.h | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/arch/ogl/gr.c b/arch/ogl/gr.c index b8dcb190..e7593848 100644 --- a/arch/ogl/gr.c +++ b/arch/ogl/gr.c @@ -50,6 +50,7 @@ #include "ogl_init.h" #ifdef __MACOSX__ #include +#undef GL_ARB_multitexture // hack! #else #include #endif diff --git a/arch/ogl/ogl.c b/arch/ogl/ogl.c index eb5103d4..544e9942 100644 --- a/arch/ogl/ogl.c +++ b/arch/ogl/ogl.c @@ -55,7 +55,7 @@ #define M_PI 3.14159 #endif -#if defined(__WINDOWS__) || defined(__MINGW32__) +#if defined(__WINDOWS__) || defined(__MINGW32__) || defined(__MACOSX__) #define cosf(a) cos(a) #define sinf(a) sin(a) #endif @@ -895,6 +895,7 @@ bool g3_draw_bitmap(vms_vector *pos,fix width,fix height,grs_bitmap *bm, int ori return 0; } + bool ogl_ubitmapm_c(int x, int y,grs_bitmap *bm,int c) { GLfloat xo,yo,xf,yf; @@ -1215,7 +1216,7 @@ int tex_format_supported(int iformat,int format){ if (!ogl_rgba2_ok) return 0; break; } if (ogl_gettexlevelparam_ok){ - int internalFormat; + GLint internalFormat; glTexImage2D(GL_PROXY_TEXTURE_2D, 0, iformat, 64, 64, 0, format, GL_UNSIGNED_BYTE, texbuf);//NULL? glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, @@ -1337,9 +1338,10 @@ void tex_set_size1(ogl_texture *tex,int dbits,int bits,int w, int h){ glmprintf((0,"tex_set_size1: %ix%i, %ib(%i) %iB\n",w,h,bits,dbits,tex->bytes)); } void tex_set_size(ogl_texture *tex){ - int w,h,bi=16,a=0; + GLint w,h; + int bi=16,a=0; if (ogl_gettexlevelparam_ok){ - int t; + GLint t; glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_WIDTH,&w); glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_HEIGHT,&h); glGetTexLevelParameteriv(GL_TEXTURE_2D,0,GL_TEXTURE_LUMINANCE_SIZE,&t);a+=t; diff --git a/configure.ac b/configure.ac index 9bc9d93b..90882db9 100644 --- a/configure.ac +++ b/configure.ac @@ -57,6 +57,8 @@ esac AM_CONDITIONAL(MINGW32, test x$MINGW32 = xyes) if test x$MINGW32 = xyes; then GL_LIBS="opengl32 glu32" +elif test x$MACOSX = xyes; then + GL_LIBS="" else GL_LIBS="GL GLU" fi @@ -146,7 +148,6 @@ else # Check for OpenGL AC_ARG_WITH(opengl, [ --with-opengl Build OpenGL support ],,) - if test x$with_opengl = xyes -a x$MACOSX != xyes; then for lib in $GL_LIBS; do AC_CHECK_LIB($lib, main, OGL_LIBS="${OGL_LIBS} -l$lib", @@ -154,11 +155,10 @@ else opengl=false], ${OGL_LIBS} ) - done - AC_DEFINE(OGL,,[Define if you want an OpenGL build]) - TARGETS=d2x-gl - D2X_ARCH_SUBDIRS="ogl ${D2X_ARCH_SUBDIRS}" - fi + done + AC_DEFINE(OGL,,[Define if you want an OpenGL build]) + TARGETS=d2x-gl + D2X_ARCH_SUBDIRS="ogl ${D2X_ARCH_SUBDIRS}" AC_SUBST(OGL_LIBS) AM_CONDITIONAL(USE_OPENGL, test x$with_opengl = xyes) diff --git a/include/ogl_init.h b/include/ogl_init.h index 53782101..f67c3f71 100644 --- a/include/ogl_init.h +++ b/include/ogl_init.h @@ -41,7 +41,7 @@ int ogl_init_load_library(void); #define OGL_TEXTURE_LIST_SIZE 2000 typedef struct _ogl_texture { - int handle; + GLuint handle; GLint internalformat; GLenum format; int w,h,tw,th,lw; -- 2.39.2