From 2d0899283f6dda790478ac6b5d6536d1f2061c96 Mon Sep 17 00:00:00 2001 From: Matthias Bentrup Date: Mon, 16 Feb 2015 14:16:10 +0100 Subject: [PATCH 01/10] Extend glewinfo to request specific GL versions/profiles/flags. --- auto/src/glewinfo_head.c | 16 +++- auto/src/glewinfo_tail.c | 192 ++++++++++++++++++++++++++++++--------- 2 files changed, 162 insertions(+), 46 deletions(-) diff --git a/auto/src/glewinfo_head.c b/auto/src/glewinfo_head.c index b10f85a..9a7f529 100644 --- a/auto/src/glewinfo_head.c +++ b/auto/src/glewinfo_head.c @@ -26,16 +26,22 @@ GLXEWContext _glxewctx; #endif #endif +struct createParams { #if defined(_WIN32) -GLboolean glewCreateContext (int* pixelformat); + int pixelformat; #elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) -GLboolean glewCreateContext (const char* display, int* visual); -#else -GLboolean glewCreateContext (); + const char* display; + int visual; #endif + int major, minor; + int profile_mask; + int flags; +}; + +GLboolean glewCreateContext (struct createParams *params); #if defined(_WIN32) || !defined(__APPLE__) || defined(GLEW_APPLE_GLX) -GLboolean glewParseArgs (int argc, char** argv, char** display, int* visual); +GLboolean glewParseArgs (int argc, char** argv, struct createParams *); #endif void glewDestroyContext (); diff --git a/auto/src/glewinfo_tail.c b/auto/src/glewinfo_tail.c index b48a3f1..f5cc0e3 100644 --- a/auto/src/glewinfo_tail.c +++ b/auto/src/glewinfo_tail.c @@ -11,29 +11,38 @@ int main (void) #endif { GLuint err; + struct createParams params = { +#if defined(_WIN32) + -1, /* pixelformat */ +#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) + "", /* display */ + -1, /* visual */ +#endif + 0, /* major */ + 0, /* minor */ + 0, /* profile mask */ + 0 /* flags */ + }; #if defined(_WIN32) || !defined(__APPLE__) || defined(GLEW_APPLE_GLX) - char* display = NULL; - int visual = -1; - - if (glewParseArgs(argc-1, argv+1, &display, &visual)) + if (glewParseArgs(argc-1, argv+1, ¶ms)) { + fprintf(stderr, "Usage: glewinfo " #if defined(_WIN32) - fprintf(stderr, "Usage: glewinfo [-pf ]\n"); + "[-pf ] " #else - fprintf(stderr, "Usage: glewinfo [-display ] [-visual ]\n"); + "[-display ] " + "[-visual ] " #endif + "[-version ] " + "[-profiles ] " + "[-flags ]" + "\n"); return 1; } #endif -#if defined(_WIN32) - if (GL_TRUE == glewCreateContext(&visual)) -#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) - if (GL_TRUE == glewCreateContext()) -#else - if (GL_TRUE == glewCreateContext(display, &visual)) -#endif + if (GL_TRUE == glewCreateContext(¶ms)) { fprintf(stderr, "Error: glewCreateContext failed\n"); glewDestroyContext(); @@ -73,10 +82,10 @@ int main (void) fprintf(f, "---------------------------\n\n"); fprintf(f, "GLEW version %s\n", glewGetString(GLEW_VERSION)); #if defined(_WIN32) - fprintf(f, "Reporting capabilities of pixelformat %d\n", visual); + fprintf(f, "Reporting capabilities of pixelformat %d\n", params.pixelformat); #elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) fprintf(f, "Reporting capabilities of display %s, visual 0x%x\n", - display == NULL ? getenv("DISPLAY") : display, visual); + params.display == NULL ? getenv("DISPLAY") : params.display, params.visual); #endif fprintf(f, "Running on a %s from %s\n", glGetString(GL_RENDERER), glGetString(GL_VENDOR)); @@ -95,34 +104,46 @@ int main (void) /* ------------------------------------------------------------------------ */ #if defined(_WIN32) || !defined(__APPLE__) || defined(GLEW_APPLE_GLX) -GLboolean glewParseArgs (int argc, char** argv, char** display, int* visual) +GLboolean glewParseArgs (int argc, char** argv, struct createParams *params) { int p = 0; while (p < argc) { -#if defined(_WIN32) - if (!strcmp(argv[p], "-pf") || !strcmp(argv[p], "-pixelformat")) + if (!strcmp(argv[p], "-version")) { if (++p >= argc) return GL_TRUE; - *display = 0; - *visual = strtol(argv[p++], NULL, 0); + if (sscanf(argv[p++], "%d.%d", ¶ms->major, ¶ms->minor) != 2) return GL_TRUE; } - else - return GL_TRUE; -#else - if (!strcmp(argv[p], "-display")) + else if (!strcmp(argv[p], "-profiles")) { if (++p >= argc) return GL_TRUE; - *display = argv[p++]; + params->profile_mask = (int)strtol(argv[p++], NULL, 0); + } + else if (!strcmp(argv[p], "-flags")) + { + if (++p >= argc) return GL_TRUE; + params->flags = (int)strtol(argv[p++], NULL, 0); + } +#if defined(_WIN32) + else if (!strcmp(argv[p], "-pf") || !strcmp(argv[p], "-pixelformat")) + { + if (++p >= argc) return GL_TRUE; + params->pixelformat = strtol(argv[p++], NULL, 0); + } +#else + else if (!strcmp(argv[p], "-display")) + { + if (++p >= argc) return GL_TRUE; + params->display = argv[p++]; } else if (!strcmp(argv[p], "-visual")) { if (++p >= argc) return GL_TRUE; - *visual = (int)strtol(argv[p++], NULL, 0); + params->visual = (int)strtol(argv[p++], NULL, 0); } +#endif else return GL_TRUE; -#endif } return GL_FALSE; } @@ -136,7 +157,7 @@ HWND wnd = NULL; HDC dc = NULL; HGLRC rc = NULL; -GLboolean glewCreateContext (int* pixelformat) +GLboolean glewCreateContext (struct createParams* params) { WNDCLASS wc; PIXELFORMATDESCRIPTOR pfd; @@ -155,20 +176,58 @@ GLboolean glewCreateContext (int* pixelformat) if (NULL == dc) return GL_TRUE; /* find pixel format */ ZeroMemory(&pfd, sizeof(PIXELFORMATDESCRIPTOR)); - if (*pixelformat == -1) /* find default */ + if (params->pixelformat == -1) /* find default */ { pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); pfd.nVersion = 1; pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL; - *pixelformat = ChoosePixelFormat(dc, &pfd); - if (*pixelformat == 0) return GL_TRUE; + params->pixelformat = ChoosePixelFormat(dc, &pfd); + if (params->pixelformat == 0) return GL_TRUE; } /* set the pixel format for the dc */ - if (FALSE == SetPixelFormat(dc, *pixelformat, &pfd)) return GL_TRUE; + if (FALSE == SetPixelFormat(dc, params->pixelformat, &pfd)) return GL_TRUE; /* create rendering context */ rc = wglCreateContext(dc); if (NULL == rc) return GL_TRUE; if (FALSE == wglMakeCurrent(dc, rc)) return GL_TRUE; + if (params->major || params->profile_mask || params->flags) + { + HGLRC oldRC = rc; + int contextAttrs[20]; + int i; + + extern GLenum GLEWAPIENTRY wglewContextInit(); + wglewContextInit(); + + if (!wglewGetExtension("WGL_ARB_create_context_profile")) + return GL_TRUE; + + i = 0; + if( params->major ) + { + contextAttrs[i++] = WGL_CONTEXT_MAJOR_VERSION_ARB; + contextAttrs[i++] = params->major; + contextAttrs[i++] = WGL_CONTEXT_MINOR_VERSION_ARB; + contextAttrs[i++] = params->minor; + } + if( params->profile_mask ) + { + contextAttrs[i++] = WGL_CONTEXT_PROFILE_MASK_ARB; + contextAttrs[i++] = params->profile_mask; + } + if( params->flags ) + { + contextAttrs[i++] = WGL_CONTEXT_FLAGS_ARB; + contextAttrs[i++] = params->flags; + } + contextAttrs[i++] = 0; + rc = wglCreateContextAttribsARB(dc, 0, contextAttrs); + + if (NULL == rc) return GL_TRUE; + if (!wglMakeCurrent(dc, rc)) return GL_TRUE; + + wglDeleteContext(oldRC); + } return GL_FALSE; } @@ -190,21 +249,24 @@ void glewDestroyContext () CGLContextObj ctx, octx; -GLboolean glewCreateContext () +GLboolean glewCreateContext (struct createParams *params) { const CGLPixelFormatAttribute attrib[4] = { kCGLPFAAccelerated, /* No software rendering */ -#if 0 kCGLPFAOpenGLProfile, /* OSX 10.7 Lion onwards */ (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core, /* 3.2 Core Context */ -#endif 0 }; CGLPixelFormatObj pf; GLint npix; CGLError error; + if( params->major < 3 && + !(params->profile_mask & GL_CONTEXT_CORE_PROFILE_BIT) ) { + attrib[1] = 0; // terminate attrib array before the core profile attribute + } + error = CGLChoosePixelFormat(attrib, &pf, &npix); if (error) return GL_TRUE; error = CGLCreateContext(pf, NULL, &ctx); @@ -230,7 +292,7 @@ void glewDestroyContext () #elif defined(__HAIKU__) -GLboolean glewCreateContext () +GLboolean glewCreateContext (struct createParams *params) { /* TODO: Haiku: We need to call C++ code here */ return GL_FALSE; @@ -252,22 +314,22 @@ GLXContext ctx = NULL; Window wnd = 0; Colormap cmap = 0; -GLboolean glewCreateContext (const char* display, int* visual) +GLboolean glewCreateContext (struct createParams *params) { int attrib[] = { GLX_RGBA, GLX_DOUBLEBUFFER, None }; int erb, evb; XSetWindowAttributes swa; /* open display */ - dpy = XOpenDisplay(display); + dpy = XOpenDisplay(params->display); if (NULL == dpy) return GL_TRUE; /* query for glx */ if (!glXQueryExtension(dpy, &erb, &evb)) return GL_TRUE; /* choose visual */ - if (*visual == -1) + if (params->visual == -1) { vi = glXChooseVisual(dpy, DefaultScreen(dpy), attrib); if (NULL == vi) return GL_TRUE; - *visual = (int)XVisualIDFromVisual(vi->visual); + params->visual = (int)XVisualIDFromVisual(vi->visual); } else { @@ -275,7 +337,7 @@ GLboolean glewCreateContext (const char* display, int* visual) vis = XGetVisualInfo(dpy, 0, NULL, &n_vis); for (i=0; ivisual) vi = &vis[i]; } if (vi == NULL) return GL_TRUE; @@ -293,6 +355,54 @@ GLboolean glewCreateContext (const char* display, int* visual) CWBorderPixel | CWColormap, &swa); /* make context current */ if (!glXMakeCurrent(dpy, wnd, ctx)) return GL_TRUE; + if (params->major || params->profile_mask || params->flags) + { + GLXContext oldCtx = ctx; + GLXFBConfig *FBConfigs; + int FBConfigAttrs[] = { GLX_FBCONFIG_ID, 0, None }; + int contextAttrs[20]; + int nelems, i; + + glxewContextInit(); + + if (!glxewGetExtension("GLX_ARB_create_context_profile")) + return GL_TRUE; + + if (glXQueryContext(dpy, oldCtx, GLX_FBCONFIG_ID, &FBConfigAttrs[1])) + return GL_TRUE; + FBConfigs = glXChooseFBConfig(dpy, vi->screen, FBConfigAttrs, &nelems); + + if (nelems < 1) + return GL_TRUE; + + i = 0; + if( params->major ) + { + contextAttrs[i++] = GLX_CONTEXT_MAJOR_VERSION_ARB; + contextAttrs[i++] = params->major; + contextAttrs[i++] = GLX_CONTEXT_MINOR_VERSION_ARB; + contextAttrs[i++] = params->minor; + } + if( params->profile_mask ) + { + contextAttrs[i++] = GLX_CONTEXT_PROFILE_MASK_ARB; + contextAttrs[i++] = params->profile_mask; + } + if( params->flags ) + { + contextAttrs[i++] = GLX_CONTEXT_FLAGS_ARB; + contextAttrs[i++] = params->flags; + } + contextAttrs[i++] = None; + ctx = glXCreateContextAttribsARB(dpy, *FBConfigs, NULL, True, contextAttrs); + + if (NULL == ctx) return GL_TRUE; + if (!glXMakeCurrent(dpy, wnd, ctx)) return GL_TRUE; + + glXDestroyContext(dpy, oldCtx); + + XFree(FBConfigs); + } return GL_FALSE; } From 60b0fc5c0521f34274a35261a82e118364a9ab32 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Fri, 29 May 2015 20:08:13 +1000 Subject: [PATCH 02/10] [CoreSupport] Mac OS X support for glewinfo GL version/profiles/flags. --- auto/src/glewinfo_head.c | 6 ++++-- auto/src/glewinfo_tail.c | 46 +++++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/auto/src/glewinfo_head.c b/auto/src/glewinfo_head.c index 9a7f529..0174fdd 100644 --- a/auto/src/glewinfo_head.c +++ b/auto/src/glewinfo_head.c @@ -8,6 +8,10 @@ #include #endif +#if defined(__APPLE__) +#include +#endif + #ifdef GLEW_REGAL #include #endif @@ -40,9 +44,7 @@ struct createParams { GLboolean glewCreateContext (struct createParams *params); -#if defined(_WIN32) || !defined(__APPLE__) || defined(GLEW_APPLE_GLX) GLboolean glewParseArgs (int argc, char** argv, struct createParams *); -#endif void glewDestroyContext (); diff --git a/auto/src/glewinfo_tail.c b/auto/src/glewinfo_tail.c index f5cc0e3..6f748a7 100644 --- a/auto/src/glewinfo_tail.c +++ b/auto/src/glewinfo_tail.c @@ -4,17 +4,13 @@ /* ------------------------------------------------------------------------ */ -#if defined(_WIN32) || !defined(__APPLE__) || defined(GLEW_APPLE_GLX) int main (int argc, char** argv) -#else -int main (void) -#endif { GLuint err; struct createParams params = { #if defined(_WIN32) -1, /* pixelformat */ -#elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) +#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) "", /* display */ -1, /* visual */ #endif @@ -24,13 +20,12 @@ int main (void) 0 /* flags */ }; -#if defined(_WIN32) || !defined(__APPLE__) || defined(GLEW_APPLE_GLX) if (glewParseArgs(argc-1, argv+1, ¶ms)) { fprintf(stderr, "Usage: glewinfo " #if defined(_WIN32) "[-pf ] " -#else +#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) "[-display ] " "[-visual ] " #endif @@ -40,7 +35,6 @@ int main (void) "\n"); return 1; } -#endif if (GL_TRUE == glewCreateContext(¶ms)) { @@ -53,7 +47,7 @@ int main (void) err = glewContextInit(glewGetContext()); #ifdef _WIN32 err = err || wglewContextInit(wglewGetContext()); -#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) err = err || glxewContextInit(glxewGetContext()); #endif @@ -103,7 +97,6 @@ int main (void) /* ------------------------------------------------------------------------ */ -#if defined(_WIN32) || !defined(__APPLE__) || defined(GLEW_APPLE_GLX) GLboolean glewParseArgs (int argc, char** argv, struct createParams *params) { int p = 0; @@ -130,7 +123,7 @@ GLboolean glewParseArgs (int argc, char** argv, struct createParams *params) if (++p >= argc) return GL_TRUE; params->pixelformat = strtol(argv[p++], NULL, 0); } -#else +#elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) else if (!strcmp(argv[p], "-display")) { if (++p >= argc) return GL_TRUE; @@ -147,7 +140,6 @@ GLboolean glewParseArgs (int argc, char** argv, struct createParams *params) } return GL_FALSE; } -#endif /* ------------------------------------------------------------------------ */ @@ -251,23 +243,29 @@ CGLContextObj ctx, octx; GLboolean glewCreateContext (struct createParams *params) { - const CGLPixelFormatAttribute attrib[4] = - { - kCGLPFAAccelerated, /* No software rendering */ - kCGLPFAOpenGLProfile, /* OSX 10.7 Lion onwards */ - (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core, /* 3.2 Core Context */ - 0 - }; + CGLPixelFormatAttribute contextAttrs[20]; + int i; CGLPixelFormatObj pf; GLint npix; CGLError error; - if( params->major < 3 && - !(params->profile_mask & GL_CONTEXT_CORE_PROFILE_BIT) ) { - attrib[1] = 0; // terminate attrib array before the core profile attribute - } + i = 0; + contextAttrs[i++] = kCGLPFAAccelerated; /* No software rendering */ - error = CGLChoosePixelFormat(attrib, &pf, &npix); + #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 + if (params->profile_mask & GL_CONTEXT_CORE_PROFILE_BIT) + { + if (params->major==3 && params->minor>=2) + { + contextAttrs[i++] = kCGLPFAOpenGLProfile; /* OSX 10.7 Lion onwards */ + contextAttrs[i++] = (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core; /* 3.2 Core Context */ + } + } + #endif + + contextAttrs[i++] = 0; + + error = CGLChoosePixelFormat(contextAttrs, &pf, &npix); if (error) return GL_TRUE; error = CGLCreateContext(pf, NULL, &ctx); if (error) return GL_TRUE; From 0720521034ccbb18cdbf9dac625e2c0f7e2006eb Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Fri, 29 May 2015 20:29:08 +1000 Subject: [PATCH 03/10] [CoreSupport] glewinfo profiles/flags documentation breadcrumbs. --- auto/src/glewinfo_head.c | 13 +++++++++---- auto/src/glewinfo_tail.c | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/auto/src/glewinfo_head.c b/auto/src/glewinfo_head.c index 0174fdd..9529b44 100644 --- a/auto/src/glewinfo_head.c +++ b/auto/src/glewinfo_head.c @@ -30,16 +30,21 @@ GLXEWContext _glxewctx; #endif #endif -struct createParams { +/* Command-line parameters for GL context creation */ + +struct createParams +{ #if defined(_WIN32) int pixelformat; #elif !defined(__APPLE__) && !defined(__HAIKU__) || defined(GLEW_APPLE_GLX) const char* display; int visual; #endif - int major, minor; - int profile_mask; - int flags; + int major, minor; /* GL context version number */ + + /* https://www.opengl.org/registry/specs/ARB/glx_create_context.txt */ + int profile_mask; /* core = 1, compatibility = 2 */ + int flags; /* debug = 1, forward compatible = 2 */ }; GLboolean glewCreateContext (struct createParams *params); diff --git a/auto/src/glewinfo_tail.c b/auto/src/glewinfo_tail.c index 6f748a7..a1e7434 100644 --- a/auto/src/glewinfo_tail.c +++ b/auto/src/glewinfo_tail.c @@ -7,7 +7,8 @@ int main (int argc, char** argv) { GLuint err; - struct createParams params = { + struct createParams params = + { #if defined(_WIN32) -1, /* pixelformat */ #elif !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) From 211bf29181fab758e370005b0818a364804011b6 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Fri, 29 May 2015 20:45:19 +1000 Subject: [PATCH 04/10] [CoreSupport] glewinfo profiles/flags refinement - commandline profile and flags as strings. --- auto/src/glewinfo_head.c | 2 +- auto/src/glewinfo_tail.c | 40 +++++++++++++++++++++++----------------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/auto/src/glewinfo_head.c b/auto/src/glewinfo_head.c index 9529b44..37ff44d 100644 --- a/auto/src/glewinfo_head.c +++ b/auto/src/glewinfo_head.c @@ -43,7 +43,7 @@ struct createParams int major, minor; /* GL context version number */ /* https://www.opengl.org/registry/specs/ARB/glx_create_context.txt */ - int profile_mask; /* core = 1, compatibility = 2 */ + int profile; /* core = 1, compatibility = 2 */ int flags; /* debug = 1, forward compatible = 2 */ }; diff --git a/auto/src/glewinfo_tail.c b/auto/src/glewinfo_tail.c index a1e7434..95c7ed1 100644 --- a/auto/src/glewinfo_tail.c +++ b/auto/src/glewinfo_tail.c @@ -31,8 +31,8 @@ int main (int argc, char** argv) "[-visual ] " #endif "[-version ] " - "[-profiles ] " - "[-flags ]" + "[-profile core|compatibility] " + "[-flag debug|forward]" "\n"); return 1; } @@ -108,15 +108,21 @@ GLboolean glewParseArgs (int argc, char** argv, struct createParams *params) if (++p >= argc) return GL_TRUE; if (sscanf(argv[p++], "%d.%d", ¶ms->major, ¶ms->minor) != 2) return GL_TRUE; } - else if (!strcmp(argv[p], "-profiles")) + else if (!strcmp(argv[p], "-profile")) { if (++p >= argc) return GL_TRUE; - params->profile_mask = (int)strtol(argv[p++], NULL, 0); + if (strcmp("core", argv[p]) == 0) params->profile |= 1; + else if (strcmp("compatibility",argv[p]) == 0) params->profile |= 2; + else return GL_TRUE; + ++p; } - else if (!strcmp(argv[p], "-flags")) + else if (!strcmp(argv[p], "-flag")) { if (++p >= argc) return GL_TRUE; - params->flags = (int)strtol(argv[p++], NULL, 0); + if (strcmp("debug", argv[p]) == 0) params->flags |= 1; + else if (strcmp("forward",argv[p]) == 0) params->flags |= 2; + else return GL_TRUE; + ++p; } #if defined(_WIN32) else if (!strcmp(argv[p], "-pf") || !strcmp(argv[p], "-pixelformat")) @@ -183,7 +189,7 @@ GLboolean glewCreateContext (struct createParams* params) rc = wglCreateContext(dc); if (NULL == rc) return GL_TRUE; if (FALSE == wglMakeCurrent(dc, rc)) return GL_TRUE; - if (params->major || params->profile_mask || params->flags) + if (params->major || params->profile || params->flags) { HGLRC oldRC = rc; int contextAttrs[20]; @@ -196,19 +202,19 @@ GLboolean glewCreateContext (struct createParams* params) return GL_TRUE; i = 0; - if( params->major ) + if (params->major) { contextAttrs[i++] = WGL_CONTEXT_MAJOR_VERSION_ARB; contextAttrs[i++] = params->major; contextAttrs[i++] = WGL_CONTEXT_MINOR_VERSION_ARB; contextAttrs[i++] = params->minor; } - if( params->profile_mask ) + if (params->profile) { contextAttrs[i++] = WGL_CONTEXT_PROFILE_MASK_ARB; - contextAttrs[i++] = params->profile_mask; + contextAttrs[i++] = params->profile; } - if( params->flags ) + if (params->flags) { contextAttrs[i++] = WGL_CONTEXT_FLAGS_ARB; contextAttrs[i++] = params->flags; @@ -254,7 +260,7 @@ GLboolean glewCreateContext (struct createParams *params) contextAttrs[i++] = kCGLPFAAccelerated; /* No software rendering */ #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7 - if (params->profile_mask & GL_CONTEXT_CORE_PROFILE_BIT) + if (params->profile & GL_CONTEXT_CORE_PROFILE_BIT) { if (params->major==3 && params->minor>=2) { @@ -354,7 +360,7 @@ GLboolean glewCreateContext (struct createParams *params) CWBorderPixel | CWColormap, &swa); /* make context current */ if (!glXMakeCurrent(dpy, wnd, ctx)) return GL_TRUE; - if (params->major || params->profile_mask || params->flags) + if (params->major || params->profile || params->flags) { GLXContext oldCtx = ctx; GLXFBConfig *FBConfigs; @@ -375,19 +381,19 @@ GLboolean glewCreateContext (struct createParams *params) return GL_TRUE; i = 0; - if( params->major ) + if (params->major) { contextAttrs[i++] = GLX_CONTEXT_MAJOR_VERSION_ARB; contextAttrs[i++] = params->major; contextAttrs[i++] = GLX_CONTEXT_MINOR_VERSION_ARB; contextAttrs[i++] = params->minor; } - if( params->profile_mask ) + if (params->profile) { contextAttrs[i++] = GLX_CONTEXT_PROFILE_MASK_ARB; - contextAttrs[i++] = params->profile_mask; + contextAttrs[i++] = params->profile; } - if( params->flags ) + if (params->flags) { contextAttrs[i++] = GLX_CONTEXT_FLAGS_ARB; contextAttrs[i++] = params->flags; From 9580ab4226680fc6f1b09030f13c9107d975da9c Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sat, 21 Feb 2015 09:02:04 +1000 Subject: [PATCH 05/10] [CoreSupport] Whitespace fixup for make_def_var.pl --- auto/bin/make_def_var.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/auto/bin/make_def_var.pl b/auto/bin/make_def_var.pl index e484194..ae007a6 100755 --- a/auto/bin/make_def_var.pl +++ b/auto/bin/make_def_var.pl @@ -21,11 +21,11 @@ if (@ARGV) { @extlist = @ARGV; - foreach my $ext (sort @extlist) - { - my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); - my $extvar = $extname; - $extvar =~ s/GL(X*)_/GL$1EW_/; - print "GLboolean " . prefix_varname($extvar) . " = GL_FALSE;\n"; - } + foreach my $ext (sort @extlist) + { + my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + my $extvar = $extname; + $extvar =~ s/GL(X*)_/GL$1EW_/; + print "GLboolean " . prefix_varname($extvar) . " = GL_FALSE;\n"; + } } From 044b9ff14cbf38a236fe6b12fc2e64b32e10120c Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sat, 21 Feb 2015 21:04:57 +1000 Subject: [PATCH 06/10] Add -ansi -pedantic compilation flags for Mac build, as extra diagnostic information. --- config/Makefile.darwin | 1 + 1 file changed, 1 insertion(+) diff --git a/config/Makefile.darwin b/config/Makefile.darwin index bf34a0e..56fd584 100644 --- a/config/Makefile.darwin +++ b/config/Makefile.darwin @@ -2,6 +2,7 @@ NAME = $(GLEW_NAME) CC = cc LD = cc CFLAGS.EXTRA = -dynamic -fno-common +CFLAGS.EXTRA += -ansi -pedantic #CFLAGS.EXTRA += -no-cpp-precomp LDFLAGS.EXTRA = ifneq (undefined, $(origin GLEW_APPLE_GLX)) From 49eafff1051f1ef5b5a23b9bedae79a4e08fea46 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sat, 21 Feb 2015 23:44:40 +1000 Subject: [PATCH 07/10] Use -ansi -pedantic compilation flags for Linux build. --- config/Makefile.linux | 1 + 1 file changed, 1 insertion(+) diff --git a/config/Makefile.linux b/config/Makefile.linux index 55e4a23..6b9da03 100644 --- a/config/Makefile.linux +++ b/config/Makefile.linux @@ -24,6 +24,7 @@ WARN = -Wall -W POPT = -O2 CFLAGS.EXTRA += -fPIC CFLAGS.EXTRA += -Wcast-qual +CFLAGS.EXTRA += -ansi -pedantic BIN.SUFFIX = LIB.SONAME = lib$(NAME).so.$(SO_MAJOR) LIB.DEVLNK = lib$(NAME).so From 0e88d39f4aa409c5d0aab4a10b1ac5cda257f75d Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sat, 13 Jun 2015 10:18:41 +1000 Subject: [PATCH 08/10] Leave extraneous #ifdef blocks --- auto/bin/make_init.pl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/auto/bin/make_init.pl b/auto/bin/make_init.pl index 70abc98..5e6200a 100755 --- a/auto/bin/make_init.pl +++ b/auto/bin/make_init.pl @@ -38,18 +38,17 @@ if (@ARGV) parse_ext($ext); #make_separator($extname); - print "#ifdef $extname\n\n"; my $extvar = $extname; my $extvardef = $extname; $extvar =~ s/GL(X*)_/GL$1EW_/; if (keys %$functions) { + print "#ifdef $extname\n\n"; print "static GLboolean _glewInit_$extname (" . $type . "EW_CONTEXT_ARG_DEF_INIT)\n{\n GLboolean r = GL_FALSE;\n"; output_decls($functions, \&make_pfn_def_init); print "\n return r;\n}\n\n"; + print "#endif /* $extname */\n\n"; } - #print "\nGLboolean " . prefix_varname($extvar) . " = GL_FALSE;\n\n"; - print "#endif /* $extname */\n\n"; } } From 0c19148d6a575b7abca9bceb8e9b34bef3f2c729 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sat, 13 Jun 2015 10:35:23 +1000 Subject: [PATCH 09/10] glew_utils is no longer used, removing. --- auto/Makefile | 69 ------------------ auto/src/glew_utils.c | 162 ------------------------------------------ auto/src/glew_utils.h | 101 -------------------------- 3 files changed, 332 deletions(-) delete mode 100644 auto/src/glew_utils.c delete mode 100644 auto/src/glew_utils.h diff --git a/auto/Makefile b/auto/Makefile index a10d44a..91b68ed 100644 --- a/auto/Makefile +++ b/auto/Makefile @@ -245,75 +245,6 @@ $(S.DEST)/glew.c: $(EXT)/.dummy perl -e "s/\(\(glColorSubTable = /((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)\"glBlendEquation\")) == NULL) || r;\n r = ((glColorSubTable = /g" -pi $@ rm -f $@.bak -$(S.DEST)/glew_def.c: $(EXT)/.dummy - cp -f $(SRC)/glew_license.h $@ - echo -e "#include \"glew_utils.h\"\n\n#if !defined(_WIN32) || !defined(GLEW_MX)" >> $@ - $(BIN)/make_def_fun.pl GL $(GL_CORE_SPEC) >> $@ - $(BIN)/make_def_fun.pl GL $(GL_EXT_SPEC) >> $@ - echo -e "\n#endif /* !WIN32 || !GLEW_MX */" >> $@ - echo -e "\n#if !defined(GLEW_MX)\n\nGLboolean __GLEW_VERSION_1_1 = GL_FALSE;" >> $@ - $(BIN)/make_def_var.pl GL $(GL_CORE_SPEC) >> $@ - $(BIN)/make_def_var.pl GL $(GL_EXT_SPEC) >> $@ - echo -e "\n#if defined(_WIN32)" >> $@ - $(BIN)/make_def_fun.pl WGL $(WGL_EXT_SPEC) >> $@ - $(BIN)/make_def_var.pl WGL $(WGL_EXT_SPEC) >> $@ - echo -e "\n#endif /* _WIN32 */" >> $@ - echo -e "\n#endif /* !GLEW_MX */" >> $@; - echo -e "\n#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))" >> $@ - $(BIN)/make_def_fun.pl GLX $(GLX_CORE_SPEC) >> $@ - $(BIN)/make_def_fun.pl GLX $(GLX_EXT_SPEC) >> $@ - echo -e "\n#if !defined(GLEW_MX)" >> $@; - echo -e "\nGLboolean __GLXEW_VERSION_1_0 = GL_FALSE;" >> $@ - echo -e "GLboolean __GLXEW_VERSION_1_1 = GL_FALSE;" >> $@ - $(BIN)/make_def_var.pl GLX $(GLX_CORE_SPEC) >> $@ - $(BIN)/make_def_var.pl GLX $(GLX_EXT_SPEC) >> $@ - echo -e "\n#endif /* !GLEW_MX */" >> $@; - echo -e "\n#endif /* !defined(_WIN32) && !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */" >> $@; - rm -f $@.bak - -$(S.DEST)/glew_init.c: $(EXT)/.dummy - cp -f $(SRC)/glew_license.h $@ - echo -e "#include \"glew_utils.h\"\n" >> $@ - $(BIN)/make_init.pl GL $(GL_CORE_SPEC) >> $@ - $(BIN)/make_init.pl GL $(GL_EXT_SPEC) >> $@ - cat $(SRC)/glew_init_gl.c >> $@ - $(BIN)/make_list.pl $(GL_CORE_SPEC) | grep -v '\"GL_VERSION' >> $@ - $(BIN)/make_list.pl $(GL_EXT_SPEC) >> $@ - echo -e "\n return GLEW_OK;\n}\n\n#if defined(_WIN32)\n" >> $@; - $(BIN)/make_init.pl WGL $(WGL_EXT_SPEC) >> $@ - cat $(SRC)/glew_init_wgl.c >> $@ - $(BIN)/make_list.pl $(WGL_EXT_SPEC) >> $@ - echo -e "\n return GLEW_OK;\n}\n\n" >> $@; - echo -e "\n#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX)\n" >> $@ - $(BIN)/make_init.pl GLX $(GLX_CORE_SPEC) >> $@ - $(BIN)/make_init.pl GLX $(GLX_EXT_SPEC) >> $@ - cat $(SRC)/glew_init_glx.c >> $@ - $(BIN)/make_list.pl $(CORE)/GLX_VERSION_1_3 | grep -v '\"GLX_VERSION' >> $@ - $(BIN)/make_list.pl $(GLX_EXT_SPEC) >> $@ - echo -e "\n return GLEW_OK;\n}\n\n#endif /* !__APPLE__ || GLEW_APPLE_GLX */\n" >> $@; - cat $(SRC)/glew_init_tail.c >> $@ - perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@ - perl -e "s/GLEW_VERSION_MAJOR_STRING/$(GLEW_MAJOR)/g" -pi $@ - perl -e "s/GLEW_VERSION_MINOR_STRING/$(GLEW_MINOR)/g" -pi $@ - perl -e "s/GLEW_VERSION_MICRO_STRING/$(GLEW_MICRO)/g" -pi $@ - perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@ - perl -e "s/\(\(glBlendColor = /((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)\"glBlendEquation\")) == NULL) || r;\n r = ((glBlendColor = /g" -pi $@ - rm -f $@.bak - -$(S.DEST)/glew_str.c: $(EXT)/.dummy - cp -f $(SRC)/glew_license.h $@ - echo -e "\n#include \"glew_utils.h\"\n" >> $@ - cat $(SRC)/glew_str_head.c >> $@ - $(BIN)/make_str.pl $(GL_CORE_SPEC) $(GL_EXT_SPEC) >> $@ - cat $(SRC)/glew_str_wgl.c >> $@ - $(BIN)/make_str.pl $(WGL_EXT_SPEC) >> $@ - cat $(SRC)/glew_str_glx.c >> $@ - $(BIN)/make_str.pl $(GLX_CORE_SPEC) $(GLX_EXT_SPEC) >> $@ - cat $(SRC)/glew_str_tail.c >> $@ -# perl -e "s/GLEW_VERSION_STRING/$(GLEW_VERSION)/g" -pi $@ -# perl -e "s/GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader\(GLEW_CONTEXT_ARG_VAR_INIT\);/{ GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); }/g" -pi $@ - rm -f $@.bak - $(S.DEST)/glewinfo.c: $(EXT)/.dummy @echo "--------------------------------------------------------------------" @echo "Creating glewinfo.c" diff --git a/auto/src/glew_utils.c b/auto/src/glew_utils.c deleted file mode 100644 index 9e791f4..0000000 --- a/auto/src/glew_utils.c +++ /dev/null @@ -1,162 +0,0 @@ -/* -** The OpenGL Extension Wrangler Library -** Copyright (C) 2002-2008, Milan Ikits -** Copyright (C) 2002-2008, Marcelo E. Magallon -** Copyright (C) 2002, Lev Povalahev -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** -** * Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** * The name of the author may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -** THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include -#if defined(_WIN32) -# include -#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) -# include -#endif - -#include "glew_utils.h" - -#if defined(__APPLE__) -#include -#include -#include - -void* NSGLGetProcAddress (const GLubyte *name) -{ - NSSymbol symbol; - char* symbolName; - /* prepend a '_' for the Unix C symbol mangling convention */ - symbolName = malloc(strlen((const char*)name) + 2); - strcpy(symbolName+1, (const char*)name); - symbolName[0] = '_'; - symbol = NULL; - if (NSIsSymbolNameDefined(symbolName)) - symbol = NSLookupAndBindSymbol(symbolName); - free(symbolName); - return symbol ? NSAddressOfSymbol(symbol) : NULL; -} -#endif /* __APPLE__ */ - -#if defined(__sgi) || defined (__sun) -#include -#include -#include - -void* dlGetProcAddress (const GLubyte* name) -{ - static void* h = NULL; - static void* gpa; - - if (h == NULL) - { - if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL; - gpa = dlsym(h, "glXGetProcAddress"); - } - - if (gpa != NULL) - return ((void*(*)(const GLubyte*))gpa)(name); - else - return dlsym(h, (const char*)name); -} -#endif /* __sgi || __sun */ - -/* - * GLEW, just like OpenGL or GLU, does not rely on the standard C library. - * These functions implement the functionality required in this file. - */ - -GLuint _glewStrLen (const GLubyte* s) -{ - GLuint i=0; - while (s+i != NULL && s[i] != '\0') i++; - return i; -} - -GLuint _glewStrCLen (const GLubyte* s, GLubyte c) -{ - GLuint i=0; - while (s+i != NULL && s[i] != '\0' && s[i] != c) i++; - return i; -} - -GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) -{ - GLuint i=0; - while (i < n && a+i != NULL && b+i != NULL && a[i] == b[i]) i++; - return i == n ? GL_TRUE : GL_FALSE; -} - -GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) -{ - while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t')) - { - *a++; - *na--; - } - if(*na >= nb) - { - GLuint i=0; - while (i < nb && *a+i != NULL && b+i != NULL && *a[i] == b[i]) i++; - if(i == nb) - { - *a = *a + nb; - *na = *na - nb; - return GL_TRUE; - } - } - return GL_FALSE; -} - -GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) -{ - if(*na >= nb) - { - GLuint i=0; - while (i < nb && *a+i != NULL && b+i != NULL && *a[i] == b[i]) i++; - if(i == nb) - { - *a = *a + nb; - *na = *na - nb; - return GL_TRUE; - } - } - return GL_FALSE; -} - -GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) -{ - if(*na >= nb) - { - GLuint i=0; - while (i < nb && *a+i != NULL && b+i != NULL && *a[i] == b[i]) i++; - if (i == nb && (*na == nb || *a[i] == ' ' || *a[i] == '\n' || *a[i] == '\r' || *a[i] == '\t')) - { - *a = *a + nb; - *na = *na - nb; - return GL_TRUE; - } - } - return GL_FALSE; -} diff --git a/auto/src/glew_utils.h b/auto/src/glew_utils.h deleted file mode 100644 index 4291972..0000000 --- a/auto/src/glew_utils.h +++ /dev/null @@ -1,101 +0,0 @@ -/* -** The OpenGL Extension Wrangler Library -** Copyright (C) 2002-2008, Milan Ikits -** Copyright (C) 2002-2008, Marcelo E. Magallon -** Copyright (C) 2002, Lev Povalahev -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** -** * Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** * The name of the author may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -** THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#ifndef __glew_utils_h__ -#define __glew_utils_h__ - -#include -#if defined(_WIN32) -# include -#elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) -# include -#endif - -/* - * Define glewGetContext and related helper macros. - */ -#ifdef GLEW_MX -# define glewGetContext() ctx -# ifdef _WIN32 -# define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx -# define GLEW_CONTEXT_ARG_VAR_INIT ctx -# define wglewGetContext() ctx -# define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx -# define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx -# else /* _WIN32 */ -# define GLEW_CONTEXT_ARG_DEF_INIT void -# define GLEW_CONTEXT_ARG_VAR_INIT -# define glxewGetContext() ctx -# define GLXEW_CONTEXT_ARG_DEF_INIT void -# define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx -# endif /* _WIN32 */ -# define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx -#else /* GLEW_MX */ -# define GLEW_CONTEXT_ARG_DEF_INIT void -# define GLEW_CONTEXT_ARG_VAR_INIT -# define GLEW_CONTEXT_ARG_DEF_LIST void -# define WGLEW_CONTEXT_ARG_DEF_INIT void -# define WGLEW_CONTEXT_ARG_DEF_LIST void -# define GLXEW_CONTEXT_ARG_DEF_INIT void -# define GLXEW_CONTEXT_ARG_DEF_LIST void -#endif /* GLEW_MX */ - -/* - * Define glewGetProcAddress. - */ -#if defined(_WIN32) -# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) -#else -# if defined(__APPLE__) - extern void* NSGLGetProcAddress (const GLubyte* name); -# define glewGetProcAddress(name) NSGLGetProcAddress(name) -# else -# if defined(__sgi) || defined(__sun) - extern void* dlGetProcAddress (const GLubyte* name); -# define glewGetProcAddress(name) dlGetProcAddress(name) -# else /* __linux */ -# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) -# endif -# endif -#endif - -/* - * GLEW, just like OpenGL or GLU, does not rely on the standard C library. - * These functions implement the string processing functionality required in the library. - */ -extern GLuint _glewStrLen (const GLubyte* s); -extern GLuint _glewStrCLen (const GLubyte* s, GLubyte c); -extern GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n); -extern GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb); -extern GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb); -extern GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) - -#endif /* __glew_utils_h__ */ From fda28dbfb07e869d5570ba2a5b949d80ecd7e2cf Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Sat, 13 Jun 2015 19:44:35 +1000 Subject: [PATCH 10/10] [CoreSupport] Tab indentation for perl scripts --- auto/bin/make_def_var.pl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/auto/bin/make_def_var.pl b/auto/bin/make_def_var.pl index ae007a6..2b2a1d9 100755 --- a/auto/bin/make_def_var.pl +++ b/auto/bin/make_def_var.pl @@ -19,13 +19,13 @@ our $type = shift; if (@ARGV) { - @extlist = @ARGV; + @extlist = @ARGV; - foreach my $ext (sort @extlist) - { - my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); - my $extvar = $extname; - $extvar =~ s/GL(X*)_/GL$1EW_/; - print "GLboolean " . prefix_varname($extvar) . " = GL_FALSE;\n"; - } + foreach my $ext (sort @extlist) + { + my ($extname, $exturl, $extstring, $types, $tokens, $functions, $exacts) = parse_ext($ext); + my $extvar = $extname; + $extvar =~ s/GL(X*)_/GL$1EW_/; + print "GLboolean " . prefix_varname($extvar) . " = GL_FALSE;\n"; + } }