update GLew to 1.5.8 Fixes issue 4049

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7073 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman
2011-02-05 04:21:42 +00:00
parent 843e8b5f54
commit ce004d4db9
7 changed files with 271 additions and 166 deletions
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+160 -121
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -258,8 +258,8 @@ typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
#define GLX_DONT_CARE 0xFFFFFFFF
typedef XID GLXFBConfigID;
typedef XID GLXWindow;
typedef XID GLXPbuffer;
typedef XID GLXWindow;
typedef struct __GLXFBConfigRec *GLXFBConfig;
typedef struct {
@@ -1511,7 +1511,7 @@ GLXEW_EXPORT GLboolean __GLXEW_SUN_video_resize;
typedef struct GLXEWContextStruct GLXEWContext;
extern GLenum glxewContextInit (GLXEWContext* ctx);
extern GLboolean glxewContextIsSupported (GLXEWContext* ctx, const char* name);
extern GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name);
#define glxewInit() glxewContextInit(glxewGetContext())
#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x)
+1 -1
View File
@@ -1259,7 +1259,7 @@ WGLEW_EXPORT GLboolean __WGLEW_OML_sync_control;
typedef struct WGLEWContextStruct WGLEWContext;
GLEWAPI GLenum wglewContextInit (WGLEWContext* ctx);
GLEWAPI GLboolean wglewContextIsSupported (WGLEWContext* ctx, const char* name);
GLEWAPI GLboolean wglewContextIsSupported (const WGLEWContext* ctx, const char* name);
#define wglewInit() wglewContextInit(wglewGetContext())
#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x)
+84 -42
View File
@@ -65,6 +65,29 @@
# define GLXEW_CONTEXT_ARG_DEF_LIST void
#endif /* GLEW_MX */
#if defined(__sgi) || defined (__sun) || defined(GLEW_APPLE_GLX)
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
void* dlGetProcAddress (const GLubyte* name)
{
static void* h = NULL;
static void* gpa;
if (h == NULL)
{
if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL;
gpa = dlsym(h, "glXGetProcAddress");
}
if (gpa != NULL)
return ((void*(*)(const GLubyte*))gpa)(name);
else
return dlsym(h, (const char*)name);
}
#endif /* __sgi || __sun || GLEW_APPLE_GLX */
#if defined(__APPLE__)
#include <stdlib.h>
#include <string.h>
@@ -81,7 +104,14 @@ void* NSGLGetProcAddress (const GLubyte *name)
{
image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY);
}
return image ? dlsym(image, (const char*)name) : NULL;
if( !image ) return NULL;
void* addr = dlsym(image, (const char*)name);
if( addr ) return addr;
#ifdef GLEW_APPLE_GLX
return dlGetProcAddress( name ); // try next for glx symbols
#else
return NULL;
#endif
}
#else
@@ -105,34 +135,16 @@ void* NSGLGetProcAddress (const GLubyte *name)
symbol = NSLookupAndBindSymbol(symbolName); */
symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL;
free(symbolName);
return symbol ? NSAddressOfSymbol(symbol) : NULL;
if( symbol ) return NSAddressOfSymbol(symbol);
#ifdef GLEW_APPLE_GLX
return dlGetProcAddress( name ); // try next for glx symbols
#else
return NULL;
#endif
}
#endif /* MAC_OS_X_VERSION_10_3 */
#endif /* __APPLE__ */
#if defined(__sgi) || defined (__sun)
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
void* dlGetProcAddress (const GLubyte* name)
{
static void* h = NULL;
static void* gpa;
if (h == NULL)
{
if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL;
gpa = dlsym(h, "glXGetProcAddress");
}
if (gpa != NULL)
return ((void*(*)(const GLubyte*))gpa)(name);
else
return dlsym(h, (const char*)name);
}
#endif /* __sgi || __sun */
/*
* Define glewGetProcAddress.
*/
@@ -195,12 +207,12 @@ static GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuin
{
GLuint i=0;
while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++;
if(i == nb)
{
*a = *a + nb;
*na = *na - nb;
return GL_TRUE;
}
if(i == nb)
{
*a = *a + nb;
*na = *na - nb;
return GL_TRUE;
}
}
return GL_FALSE;
}
@@ -211,12 +223,12 @@ static GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuin
{
GLuint i=0;
while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++;
if(i == nb)
{
*a = *a + nb;
*na = *na - nb;
return GL_TRUE;
}
if(i == nb)
{
*a = *a + nb;
*na = *na - nb;
return GL_TRUE;
}
}
return GL_FALSE;
}
@@ -2376,6 +2388,7 @@ GLboolean __GLEW_3DFX_tbuffer = GL_FALSE;
GLboolean __GLEW_3DFX_texture_compression_FXT1 = GL_FALSE;
GLboolean __GLEW_AMD_conservative_depth = GL_FALSE;
GLboolean __GLEW_AMD_debug_output = GL_FALSE;
GLboolean __GLEW_AMD_depth_clamp_separate = GL_FALSE;
GLboolean __GLEW_AMD_draw_buffers_blend = GL_FALSE;
GLboolean __GLEW_AMD_name_gen_delete = GL_FALSE;
GLboolean __GLEW_AMD_performance_monitor = GL_FALSE;
@@ -2602,6 +2615,7 @@ GLboolean __GLEW_EXT_texture_object = GL_FALSE;
GLboolean __GLEW_EXT_texture_perturb_normal = GL_FALSE;
GLboolean __GLEW_EXT_texture_rectangle = GL_FALSE;
GLboolean __GLEW_EXT_texture_sRGB = GL_FALSE;
GLboolean __GLEW_EXT_texture_sRGB_decode = GL_FALSE;
GLboolean __GLEW_EXT_texture_shared_exponent = GL_FALSE;
GLboolean __GLEW_EXT_texture_snorm = GL_FALSE;
GLboolean __GLEW_EXT_texture_swizzle = GL_FALSE;
@@ -3235,6 +3249,10 @@ static GLboolean _glewInit_GL_AMD_debug_output (GLEW_CONTEXT_ARG_DEF_INIT)
#endif /* GL_AMD_debug_output */
#ifdef GL_AMD_depth_clamp_separate
#endif /* GL_AMD_depth_clamp_separate */
#ifdef GL_AMD_draw_buffers_blend
static GLboolean _glewInit_GL_AMD_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT)
@@ -6167,6 +6185,10 @@ static GLboolean _glewInit_GL_EXT_texture_perturb_normal (GLEW_CONTEXT_ARG_DEF_I
#endif /* GL_EXT_texture_sRGB */
#ifdef GL_EXT_texture_sRGB_decode
#endif /* GL_EXT_texture_sRGB_decode */
#ifdef GL_EXT_texture_shared_exponent
#endif /* GL_EXT_texture_shared_exponent */
@@ -8045,6 +8067,9 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
CONST_CAST(GLEW_AMD_debug_output) = glewGetExtension("GL_AMD_debug_output");
if (glewExperimental || GLEW_AMD_debug_output) CONST_CAST(GLEW_AMD_debug_output) = !_glewInit_GL_AMD_debug_output(GLEW_CONTEXT_ARG_VAR_INIT);
#endif /* GL_AMD_debug_output */
#ifdef GL_AMD_depth_clamp_separate
CONST_CAST(GLEW_AMD_depth_clamp_separate) = glewGetExtension("GL_AMD_depth_clamp_separate");
#endif /* GL_AMD_depth_clamp_separate */
#ifdef GL_AMD_draw_buffers_blend
CONST_CAST(GLEW_AMD_draw_buffers_blend) = glewGetExtension("GL_AMD_draw_buffers_blend");
if (glewExperimental || GLEW_AMD_draw_buffers_blend) CONST_CAST(GLEW_AMD_draw_buffers_blend) = !_glewInit_GL_AMD_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT);
@@ -8841,6 +8866,9 @@ GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
#ifdef GL_EXT_texture_sRGB
CONST_CAST(GLEW_EXT_texture_sRGB) = glewGetExtension("GL_EXT_texture_sRGB");
#endif /* GL_EXT_texture_sRGB */
#ifdef GL_EXT_texture_sRGB_decode
CONST_CAST(GLEW_EXT_texture_sRGB_decode) = glewGetExtension("GL_EXT_texture_sRGB_decode");
#endif /* GL_EXT_texture_sRGB_decode */
#ifdef GL_EXT_texture_shared_exponent
CONST_CAST(GLEW_EXT_texture_shared_exponent) = glewGetExtension("GL_EXT_texture_shared_exponent");
#endif /* GL_EXT_texture_shared_exponent */
@@ -11326,10 +11354,10 @@ const GLubyte* glewGetString (GLenum name)
static const GLubyte* _glewString[] =
{
(const GLubyte*)NULL,
(const GLubyte*)"1.5.7",
(const GLubyte*)"1.5.8",
(const GLubyte*)"1",
(const GLubyte*)"5",
(const GLubyte*)"7"
(const GLubyte*)"8"
};
const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1;
return _glewString[(int)name > max_string ? 0 : (int)name];
@@ -11362,7 +11390,7 @@ GLenum glewInit ()
#endif /* !GLEW_MX */
#ifdef GLEW_MX
GLboolean glewContextIsSupported (GLEWContext* ctx, const char* name)
GLboolean glewContextIsSupported (const GLEWContext* ctx, const char* name)
#else
GLboolean glewIsSupported (const char* name)
#endif
@@ -11508,6 +11536,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
#ifdef GL_AMD_depth_clamp_separate
if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp_separate", 20))
{
ret = GLEW_AMD_depth_clamp_separate;
continue;
}
#endif
#ifdef GL_AMD_draw_buffers_blend
if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18))
{
@@ -13105,6 +13140,13 @@ GLboolean glewIsSupported (const char* name)
continue;
}
#endif
#ifdef GL_EXT_texture_sRGB_decode
if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB_decode", 19))
{
ret = GLEW_EXT_texture_sRGB_decode;
continue;
}
#endif
#ifdef GL_EXT_texture_shared_exponent
if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shared_exponent", 23))
{
@@ -14340,7 +14382,7 @@ GLboolean glewIsSupported (const char* name)
#if defined(_WIN32)
#if defined(GLEW_MX)
GLboolean wglewContextIsSupported (WGLEWContext* ctx, const char* name)
GLboolean wglewContextIsSupported (const WGLEWContext* ctx, const char* name)
#else
GLboolean wglewIsSupported (const char* name)
#endif
@@ -14703,7 +14745,7 @@ GLboolean wglewIsSupported (const char* name)
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
#if defined(GLEW_MX)
GLboolean glxewContextIsSupported (GLXEWContext* ctx, const char* name)
GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name)
#else
GLboolean glxewIsSupported (const char* name)
#endif
+24
View File
@@ -569,6 +569,15 @@ static void _glewInfo_GL_AMD_debug_output (void)
#endif /* GL_AMD_debug_output */
#ifdef GL_AMD_depth_clamp_separate
static void _glewInfo_GL_AMD_depth_clamp_separate (void)
{
glewPrintExt("GL_AMD_depth_clamp_separate", GLEW_AMD_depth_clamp_separate, glewIsSupported("GL_AMD_depth_clamp_separate"), glewGetExtension("GL_AMD_depth_clamp_separate"));
}
#endif /* GL_AMD_depth_clamp_separate */
#ifdef GL_AMD_draw_buffers_blend
static void _glewInfo_GL_AMD_draw_buffers_blend (void)
@@ -3805,6 +3814,15 @@ static void _glewInfo_GL_EXT_texture_sRGB (void)
#endif /* GL_EXT_texture_sRGB */
#ifdef GL_EXT_texture_sRGB_decode
static void _glewInfo_GL_EXT_texture_sRGB_decode (void)
{
glewPrintExt("GL_EXT_texture_sRGB_decode", GLEW_EXT_texture_sRGB_decode, glewIsSupported("GL_EXT_texture_sRGB_decode"), glewGetExtension("GL_EXT_texture_sRGB_decode"));
}
#endif /* GL_EXT_texture_sRGB_decode */
#ifdef GL_EXT_texture_shared_exponent
static void _glewInfo_GL_EXT_texture_shared_exponent (void)
@@ -7143,6 +7161,9 @@ static void glewInfo (void)
#ifdef GL_AMD_debug_output
_glewInfo_GL_AMD_debug_output();
#endif /* GL_AMD_debug_output */
#ifdef GL_AMD_depth_clamp_separate
_glewInfo_GL_AMD_depth_clamp_separate();
#endif /* GL_AMD_depth_clamp_separate */
#ifdef GL_AMD_draw_buffers_blend
_glewInfo_GL_AMD_draw_buffers_blend();
#endif /* GL_AMD_draw_buffers_blend */
@@ -7821,6 +7842,9 @@ static void glewInfo (void)
#ifdef GL_EXT_texture_sRGB
_glewInfo_GL_EXT_texture_sRGB();
#endif /* GL_EXT_texture_sRGB */
#ifdef GL_EXT_texture_sRGB_decode
_glewInfo_GL_EXT_texture_sRGB_decode();
#endif /* GL_EXT_texture_sRGB_decode */
#ifdef GL_EXT_texture_shared_exponent
_glewInfo_GL_EXT_texture_shared_exponent();
#endif /* GL_EXT_texture_shared_exponent */