OSX OGL fixes
This commit is contained in:
parent
ece0b9753d
commit
396270225a
|
@ -50,6 +50,7 @@
|
|||
#include "ogl_init.h"
|
||||
#ifdef __MACOSX__
|
||||
#include <OpenGL/glu.h>
|
||||
#undef GL_ARB_multitexture // hack!
|
||||
#else
|
||||
#include <GL/glu.h>
|
||||
#endif
|
||||
|
|
|
@ -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;
|
||||
|
|
12
configure.ac
12
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)
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue