From 4a72f3da8cbcd6693d58b6308d780cfa06aa9172 Mon Sep 17 00:00:00 2001 From: pixel Date: Thu, 7 Aug 2008 13:57:11 +0000 Subject: compatibility updates... --- include/LuaFTGL.h | 7 +------ lib/dds.c | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/include/LuaFTGL.h b/include/LuaFTGL.h index 48a3016..322d3ea 100644 --- a/include/LuaFTGL.h +++ b/include/LuaFTGL.h @@ -1,12 +1,7 @@ #ifndef __LUAFTGL_H__ #define __LUAFTGL_H__ -#include -#include -#include -#include -#include -#include +#include #include #include diff --git a/lib/dds.c b/lib/dds.c index 8138cd9..066b029 100644 --- a/lib/dds.c +++ b/lib/dds.c @@ -5,8 +5,11 @@ #include #include #include // Your local header file +#ifdef USE_OSMESA +#include +#endif -//PFNGLCOMPRESSEDTEXIMAGE2DARBPROC glCompressedTexImage2DARB; +PFNGLCOMPRESSEDTEXIMAGE2DARBPROC l_glCompressedTexImage2DARB; #define MAKEFOURCC(ch0, ch1, ch2, ch3) \ ((uint32_t)(uint8_t)(ch0) | ((uint32_t)(uint8_t)(ch1) << 8) | \ @@ -279,7 +282,7 @@ int loadCompressedTexture( DDS_IMAGE_DATA *pDDSImageData ) nSize = ((nWidth+3)/4) * ((nHeight+3)/4) * nBlockSize; - glCompressedTexImage2DARB( GL_TEXTURE_2D, + l_glCompressedTexImage2DARB( GL_TEXTURE_2D, i, pDDSImageData->format, nWidth, @@ -310,14 +313,18 @@ int ddsInit() { } else { -// glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)glxGetProcAddress("glCompressedTexImage2DARB"); +#ifdef USE_OSMESA + l_glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)OSMesaGetProcAddress("glCompressedTexImage2DARB"); +#else + l_glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)glxGetProcAddress("glCompressedTexImage2DARB"); +#endif -// if( !glCompressedTexImage2DARB ) -// { + if( !l_glCompressedTexImage2DARB ) + { // MessageBox(NULL,"One or more ARB_texture_compression functions were not found", // "ERROR",MB_OK|MB_ICONEXCLAMATION); -// return -2; -// } + return -2; + } } return 0; -- cgit v1.2.3