Add support for IRIX; tested on IRIX 6.5.18 with an Infinite Reality 3

git-svn-id: https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew@82 783a27ee-832a-0410-bc00-9f386506c6dd
This commit is contained in:
mem 2003-07-06 16:41:08 +00:00
parent f3985b3a9b
commit 6f0457b50e
2 changed files with 38 additions and 4 deletions

View File

@ -80,7 +80,7 @@ ifeq ($(patsubst IRIX%,IRIX,$(SYSTEM)), IRIX)
CC = cc CC = cc
EXTRA_CCFLAGS = EXTRA_CCFLAGS =
EXTRA_LDFALGS = EXTRA_LDFALGS =
EXTRA_CPPFLAGS = EXTRA_CPPFLAGS = -DGLEW_NEEDS_CUSTOM_GET_PROCADDRESS=1 -DGLEW_OPENGL_LIB_PATH=\"libGL.so\"
NAME = GLEW NAME = GLEW
P.BIN = P.BIN =
WARN = -fullwarn WARN = -fullwarn

View File

@ -36,8 +36,42 @@
#ifdef _WIN32 #ifdef _WIN32
# define glewGetProcAddress(name) wglGetProcAddress(name) # define glewGetProcAddress(name) wglGetProcAddress(name)
#else #else
# ifdef GLEW_NEEDS_CUSTOM_GET_PROCADDRESS
# define glewGetProcAddress(name) __dlopenGetProcAddress(name)
# else
# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) # define glewGetProcAddress(name) (*glXGetProcAddressARB)(name)
#endif # endif /* GLEW_NEEDS_CUSTOM_GET_PROCADDRESS */
#endif /* _WIN32 */
#ifdef GLEW_NEEDS_CUSTOM_GET_PROCADDRESS
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
static void * __dlopenGetProcAddress(const GLubyte *procName)
{
static void *h = NULL;
static void *gpa;
if (!h)
{
if (!(h = dlopen(GLEW_OPENGL_LIB_PATH, RTLD_LAZY | RTLD_LOCAL)))
{
fprintf(stderr,
"E: GLEW failed to dlopen %s: %s.\nAbort.\n",
GLEW_OPENGL_LIB_PATH, dlerror());
exit(100);
}
gpa = dlsym(h, "glXGetProcAddress");
}
if (gpa != NULL)
return ((void* (*)(const GLubyte*))gpa)(procName);
else
return dlsym(h, (const char *)procName);
}
#endif /* GLEW_NEEDS_CUSTOM_GET_PROCADDRESS */
/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ /* ----------------------------- GL_VERSION_1_1 ---------------------------- */