diff --git a/Makefile b/Makefile index d27bd26..cb12bcd 100644 --- a/Makefile +++ b/Makefile @@ -89,14 +89,20 @@ ifeq ($(patsubst IRIX%,IRIX,$(SYSTEM)), IRIX) NAME = GLEW CC = cc LD = ld -ABI = -64 # -n32 -CFLAGS.EXTRA = -woff 1110,1498 $(ABI) +ABI = -64# -n32 +CC += $(ABI) +LD += $(ABI) +CFLAGS.EXTRA = -woff 1110,1498 LDFLAGS.SO = -shared -soname $(LIB.SONAME) -LDFLAGS.EXTRA = $(ABI) -LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11 +LDFLAGS.EXTRA = +LDFLAGS.GL = -lGL -lXext -lX11 NAME = GLEW WARN = -fullwarn BIN.SUFFIX = +LIB.SONAME = lib$(NAME).so.$(GLEW_MAJOR) +LIB.DEVLNK = lib$(NAME).so +LIB.SHARED = lib$(NAME).so.$(GLEW_VERSION) +LIB.STATIC = lib$(NAME).a else # ---------------------------------------------------------------------------- diff --git a/auto/src/glew_pre.c b/auto/src/glew_pre.c index a32d93d..641be2e 100644 --- a/auto/src/glew_pre.c +++ b/auto/src/glew_pre.c @@ -79,18 +79,18 @@ static void* NSGLGetProcAddress (const char* name) static void* dlGetProcAddress (const char* name) { static void* h = NULL; - /* static void *gpa; */ + static void *gpa; - if (h != NULL) + if (h == NULL) { if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL; - /* gpa = dlsym(h, "glXGetProcAddress"); */ + gpa = dlsym(h, "glXGetProcAddress"); } - /* if (gpa != NULL) + if (gpa != NULL) return ((void* (*)(const GLubyte*))gpa)(procName); - else */ - return dlsym(h, name); + else + return dlsym(h, name); } #endif /* __sgi */ diff --git a/auto/src/glewinfo_post.c b/auto/src/glewinfo_post.c index a1e839f..dd11b72 100644 --- a/auto/src/glewinfo_post.c +++ b/auto/src/glewinfo_post.c @@ -117,11 +117,13 @@ Display* dpy = NULL; XVisualInfo* vi = NULL; GLXContext ctx = NULL; Window wnd; +Colormap cmap; GLboolean glewCreateContext () { int attrib[] = { GLX_RGBA, None }; int erb, evb; + XSetWindowAttributes swa; /* open display */ dpy = XOpenDisplay(NULL); if (NULL == dpy) return GL_TRUE; @@ -134,8 +136,14 @@ GLboolean glewCreateContext () ctx = glXCreateContext(dpy, vi, None, True); if (NULL == ctx) return GL_TRUE; /* create window */ - wnd = XCreateSimpleWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, 1, 1, 0, 0, 0); - /* make context current */ + //wnd = XCreateSimpleWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, 1, 1, 1, 0, 0); + cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen), vi->visual, AllocNone); + //swa.colormap = cmap; + swa.border_pixel = 0; + swa.colormap = cmap; + wnd = XCreateWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, 256, 256, 0, vi->depth, + InputOutput, vi->visual, CWBorderPixel | CWColormap, &swa); + /* make context current */ if (!glXMakeCurrent(dpy, wnd, ctx)) return GL_TRUE; return GL_FALSE; } @@ -144,6 +152,7 @@ void glewDestroyContext () { if (NULL != dpy && NULL != ctx) glXDestroyContext(dpy, ctx); if (NULL != dpy) XDestroyWindow(dpy, wnd); + XFreeColormap(dpy, cmap); if (NULL != vi) XFree(vi); if (NULL != dpy) XCloseDisplay(dpy); }