*** empty log message ***

git-svn-id: https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew@139 783a27ee-832a-0410-bc00-9f386506c6dd
This commit is contained in:
ikits 2003-09-26 16:07:24 +00:00
parent 92a9583067
commit 791e699b70
3 changed files with 27 additions and 12 deletions

View File

@ -89,14 +89,20 @@ ifeq ($(patsubst IRIX%,IRIX,$(SYSTEM)), IRIX)
NAME = GLEW NAME = GLEW
CC = cc CC = cc
LD = ld LD = ld
ABI = -64 # -n32 ABI = -64# -n32
CFLAGS.EXTRA = -woff 1110,1498 $(ABI) CC += $(ABI)
LD += $(ABI)
CFLAGS.EXTRA = -woff 1110,1498
LDFLAGS.SO = -shared -soname $(LIB.SONAME) LDFLAGS.SO = -shared -soname $(LIB.SONAME)
LDFLAGS.EXTRA = $(ABI) LDFLAGS.EXTRA =
LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11 LDFLAGS.GL = -lGL -lXext -lX11
NAME = GLEW NAME = GLEW
WARN = -fullwarn WARN = -fullwarn
BIN.SUFFIX = 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 else
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------

View File

@ -79,18 +79,18 @@ static void* NSGLGetProcAddress (const char* name)
static void* dlGetProcAddress (const char* name) static void* dlGetProcAddress (const char* name)
{ {
static void* h = NULL; 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; 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); return ((void* (*)(const GLubyte*))gpa)(procName);
else */ else
return dlsym(h, name); return dlsym(h, name);
} }
#endif /* __sgi */ #endif /* __sgi */

View File

@ -117,11 +117,13 @@ Display* dpy = NULL;
XVisualInfo* vi = NULL; XVisualInfo* vi = NULL;
GLXContext ctx = NULL; GLXContext ctx = NULL;
Window wnd; Window wnd;
Colormap cmap;
GLboolean glewCreateContext () GLboolean glewCreateContext ()
{ {
int attrib[] = { GLX_RGBA, None }; int attrib[] = { GLX_RGBA, None };
int erb, evb; int erb, evb;
XSetWindowAttributes swa;
/* open display */ /* open display */
dpy = XOpenDisplay(NULL); dpy = XOpenDisplay(NULL);
if (NULL == dpy) return GL_TRUE; if (NULL == dpy) return GL_TRUE;
@ -134,8 +136,14 @@ GLboolean glewCreateContext ()
ctx = glXCreateContext(dpy, vi, None, True); ctx = glXCreateContext(dpy, vi, None, True);
if (NULL == ctx) return GL_TRUE; if (NULL == ctx) return GL_TRUE;
/* create window */ /* create window */
wnd = XCreateSimpleWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, 1, 1, 0, 0, 0); //wnd = XCreateSimpleWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, 1, 1, 1, 0, 0);
/* make context current */ 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; if (!glXMakeCurrent(dpy, wnd, ctx)) return GL_TRUE;
return GL_FALSE; return GL_FALSE;
} }
@ -144,6 +152,7 @@ void glewDestroyContext ()
{ {
if (NULL != dpy && NULL != ctx) glXDestroyContext(dpy, ctx); if (NULL != dpy && NULL != ctx) glXDestroyContext(dpy, ctx);
if (NULL != dpy) XDestroyWindow(dpy, wnd); if (NULL != dpy) XDestroyWindow(dpy, wnd);
XFreeColormap(dpy, cmap);
if (NULL != vi) XFree(vi); if (NULL != vi) XFree(vi);
if (NULL != dpy) XCloseDisplay(dpy); if (NULL != dpy) XCloseDisplay(dpy);
} }