mirror of
https://github.com/nigels-com/glew.git
synced 2024-11-13 09:43:48 +00:00
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:
parent
f3985b3a9b
commit
6f0457b50e
2
Makefile
2
Makefile
@ -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
|
||||||
|
@ -34,10 +34,44 @@
|
|||||||
#include <GL/glxew.h>
|
#include <GL/glxew.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define glewGetProcAddress(name) wglGetProcAddress(name)
|
# define glewGetProcAddress(name) wglGetProcAddress(name)
|
||||||
#else
|
#else
|
||||||
#define glewGetProcAddress(name) (*glXGetProcAddressARB)(name)
|
# ifdef GLEW_NEEDS_CUSTOM_GET_PROCADDRESS
|
||||||
#endif
|
# define glewGetProcAddress(name) __dlopenGetProcAddress(name)
|
||||||
|
# else
|
||||||
|
# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name)
|
||||||
|
# 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 ---------------------------- */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user