mirror of
https://github.com/nigels-com/glew.git
synced 2024-11-29 01:01:56 +00:00
No longer using deprecated AGL framework on Mac for visualinfo
This commit is contained in:
parent
e1815b2729
commit
54b537afda
@ -9,7 +9,7 @@ ifneq (undefined, $(origin GLEW_APPLE_GLX))
|
|||||||
CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
|
CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
|
||||||
LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
|
LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
|
||||||
else
|
else
|
||||||
LDFLAGS.GL = -framework AGL -framework OpenGL
|
LDFLAGS.GL = -framework OpenGL
|
||||||
endif
|
endif
|
||||||
LDFLAGS.STATIC =
|
LDFLAGS.STATIC =
|
||||||
LDFLAGS.DYNAMIC =
|
LDFLAGS.DYNAMIC =
|
||||||
|
@ -8,7 +8,7 @@ ifneq (undefined, $(origin GLEW_APPLE_GLX))
|
|||||||
CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
|
CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
|
||||||
LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
|
LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
|
||||||
else
|
else
|
||||||
LDFLAGS.GL = -framework AGL -framework OpenGL
|
LDFLAGS.GL = -framework OpenGL
|
||||||
endif
|
endif
|
||||||
LDFLAGS.STATIC =
|
LDFLAGS.STATIC =
|
||||||
LDFLAGS.DYNAMIC =
|
LDFLAGS.DYNAMIC =
|
||||||
|
@ -12,7 +12,7 @@ ifneq (undefined, $(origin GLEW_APPLE_GLX))
|
|||||||
CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
|
CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
|
||||||
LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
|
LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
|
||||||
else
|
else
|
||||||
LDFLAGS.GL = -framework AGL -framework OpenGL
|
LDFLAGS.GL = -framework OpenGL
|
||||||
endif
|
endif
|
||||||
LDFLAGS.DYNAMIC =
|
LDFLAGS.DYNAMIC =
|
||||||
WARN = -Wall -W
|
WARN = -Wall -W
|
||||||
|
@ -8,7 +8,7 @@ ifneq (undefined, $(origin GLEW_APPLE_GLX))
|
|||||||
CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
|
CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
|
||||||
LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
|
LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
|
||||||
else
|
else
|
||||||
LDFLAGS.GL = -framework AGL -framework OpenGL
|
LDFLAGS.GL = -framework OpenGL
|
||||||
endif
|
endif
|
||||||
LDFLAGS.STATIC =
|
LDFLAGS.STATIC =
|
||||||
LDFLAGS.DYNAMIC =
|
LDFLAGS.DYNAMIC =
|
||||||
|
@ -37,7 +37,8 @@
|
|||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#include <GL/wglew.h>
|
#include <GL/wglew.h>
|
||||||
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
|
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
|
||||||
#include <AGL/agl.h>
|
#include <OpenGL/OpenGL.h>
|
||||||
|
#include <OpenGL/CGLTypes.h>
|
||||||
#elif !defined(__HAIKU__)
|
#elif !defined(__HAIKU__)
|
||||||
#include <GL/glxew.h>
|
#include <GL/glxew.h>
|
||||||
#endif
|
#endif
|
||||||
@ -61,7 +62,7 @@ typedef struct GLContextStruct
|
|||||||
HDC dc;
|
HDC dc;
|
||||||
HGLRC rc;
|
HGLRC rc;
|
||||||
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
|
#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
|
||||||
AGLContext ctx, octx;
|
CGLContextObj ctx, octx;
|
||||||
#elif !defined(__HAIKU__)
|
#elif !defined(__HAIKU__)
|
||||||
Display* dpy;
|
Display* dpy;
|
||||||
XVisualInfo* vi;
|
XVisualInfo* vi;
|
||||||
@ -1072,30 +1073,28 @@ void InitContext (GLContext* ctx)
|
|||||||
|
|
||||||
GLboolean CreateContext (GLContext* ctx)
|
GLboolean CreateContext (GLContext* ctx)
|
||||||
{
|
{
|
||||||
int attrib[] = { AGL_RGBA, AGL_NONE };
|
CGLPixelFormatAttribute attrib[] = { kCGLPFAAccelerated, 0 };
|
||||||
AGLPixelFormat pf;
|
CGLPixelFormatObj pf;
|
||||||
|
GLint npix;
|
||||||
|
CGLError error;
|
||||||
/* check input */
|
/* check input */
|
||||||
if (NULL == ctx) return GL_TRUE;
|
if (NULL == ctx) return GL_TRUE;
|
||||||
/*int major, minor;
|
error = CGLChoosePixelFormat(attrib, &pf, &npix);
|
||||||
SetPortWindowPort(wnd);
|
if (error) return GL_TRUE;
|
||||||
aglGetVersion(&major, &minor);
|
error = CGLCreateContext(pf, NULL, &ctx->ctx);
|
||||||
fprintf(stderr, "GL %d.%d\n", major, minor);*/
|
if (error) return GL_TRUE;
|
||||||
pf = aglChoosePixelFormat(NULL, 0, attrib);
|
CGLReleasePixelFormat(pf);
|
||||||
if (NULL == pf) return GL_TRUE;
|
ctx->octx = CGLGetCurrentContext();
|
||||||
ctx->ctx = aglCreateContext(pf, NULL);
|
error = CGLSetCurrentContext(ctx->ctx);
|
||||||
if (NULL == ctx->ctx || AGL_NO_ERROR != aglGetError()) return GL_TRUE;
|
if (error) return GL_TRUE;
|
||||||
aglDestroyPixelFormat(pf);
|
|
||||||
/*aglSetDrawable(ctx, GetWindowPort(wnd));*/
|
|
||||||
ctx->octx = aglGetCurrentContext();
|
|
||||||
if (GL_FALSE == aglSetCurrentContext(ctx->ctx)) return GL_TRUE;
|
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DestroyContext (GLContext* ctx)
|
void DestroyContext (GLContext* ctx)
|
||||||
{
|
{
|
||||||
if (NULL == ctx) return;
|
if (NULL == ctx) return;
|
||||||
aglSetCurrentContext(ctx->octx);
|
CGLSetCurrentContext(ctx->octx);
|
||||||
if (NULL != ctx->ctx) aglDestroyContext(ctx->ctx);
|
if (NULL != ctx->ctx) CGLReleaseContext(ctx->ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
|
Loading…
Reference in New Issue
Block a user