mirror of
https://github.com/nigels-com/glew.git
synced 2024-11-22 13:55:07 +00:00
*** 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:
parent
92a9583067
commit
791e699b70
14
Makefile
14
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
|
||||
# ----------------------------------------------------------------------------
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user