diff --git a/README.md b/README.md index 36e9333..a99e2ce 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,11 @@ Snapshots may contain new features, bug-fixes or new OpenGL extensions ahead of [glew-20160708.tgz](http://sourceforge.net/projects/glew/files/glew/snapshots/glew-20160708.tgz/download) *GLEW 2.0.0 RC: Core context, EGL support, no MX* -[glew-20160402.tgz](http://sourceforge.net/projects/glew/files/glew/snapshots/glew-20160402.tgz/download) -*GLEW 2.0.0 RC: Core context, EGL support, no MX* - ## Build -From a downloaded tarball or zip archive: +It is highly recommended to build from a tgz or zip release snapshot. +The code generation workflow is a complex brew of gnu make, perl and python, that works best on Linux or Mac. +For most end-users of GLEW the official releases are the best choice, with first class support. ### Linux and Mac @@ -41,9 +40,9 @@ From a downloaded tarball or zip archive: ##### Install build tools -Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libxmu-dev libxi-dev libgl-dev libosmesa-dev git` +Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libxmu-dev libxi-dev libgl-dev libosmesa-dev` -RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel git` +RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel` ##### Build @@ -61,9 +60,9 @@ Variables: `SYSTEM=linux-clang, GLEW_DEST=/usr/local, STRIP=` ##### Install build tools -Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libXmu-dev libXi-dev libgl-dev git cmake` +Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libXmu-dev libXi-dev libgl-dev cmake` -RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel git cmake` +RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel cmake` ##### Build diff --git a/auto/src/glew_init_glx.c b/auto/src/glew_init_glx.c index 159e45d..8c4596e 100644 --- a/auto/src/glew_init_glx.c +++ b/auto/src/glew_init_glx.c @@ -14,9 +14,13 @@ GLboolean glxewGetExtension (const char* name) GLenum glxewInit () { + Display* display; int major, minor; const GLubyte* extStart; const GLubyte* extEnd; + /* check for a display */ + display = glXGetCurrentDisplay(); + if (display == NULL) return GLEW_ERROR_NO_GLX_DISPLAY; /* initialize core GLX 1.2 */ if (_glewInit_GLX_VERSION_1_2()) return GLEW_ERROR_GLX_VERSION_11_ONLY; /* initialize flags */ @@ -26,7 +30,7 @@ GLenum glxewInit () GLXEW_VERSION_1_3 = GL_TRUE; GLXEW_VERSION_1_4 = GL_TRUE; /* query GLX version */ - glXQueryVersion(glXGetCurrentDisplay(), &major, &minor); + glXQueryVersion(display, &major, &minor); if (major == 1 && minor <= 3) { switch (minor) @@ -46,7 +50,7 @@ GLenum glxewInit () /* query GLX extension string */ extStart = 0; if (glXGetCurrentDisplay != NULL) - extStart = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); + extStart = (const GLubyte*)glXGetClientString(display, GLX_EXTENSIONS); if (extStart == 0) extStart = (const GLubyte *)""; extEnd = extStart + _glewStrLen(extStart); diff --git a/auto/src/glew_license.h b/auto/src/glew_license.h index 82a002c..77e2b29 100644 --- a/auto/src/glew_license.h +++ b/auto/src/glew_license.h @@ -1,6 +1,6 @@ /* ** The OpenGL Extension Wrangler Library -** Copyright (C) 2008-2015, Nigel Stewart +** Copyright (C) 2008-2016, Nigel Stewart ** Copyright (C) 2002-2008, Milan Ikits ** Copyright (C) 2002-2008, Marcelo E. Magallon ** Copyright (C) 2002, Lev Povalahev diff --git a/auto/src/glew_tail.h b/auto/src/glew_tail.h index ce7ff3c..09daade 100644 --- a/auto/src/glew_tail.h +++ b/auto/src/glew_tail.h @@ -6,6 +6,7 @@ #define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ #define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ #define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ +#define GLEW_ERROR_NO_GLX_DISPLAY 4 /* Need GLX display for GLX support */ /* string codes */ #define GLEW_VERSION 1 diff --git a/config/Makefile.darwin b/config/Makefile.darwin index 031356d..945e062 100644 --- a/config/Makefile.darwin +++ b/config/Makefile.darwin @@ -3,7 +3,7 @@ NAME = $(GLEW_NAME) CC = cc LD = cc CFLAGS.EXTRA = -dynamic -fno-common -CFLAGS.EXTRA += -ansi -pedantic +CFLAGS.EXTRA += -std=c89 -pedantic #CFLAGS.EXTRA += -no-cpp-precomp LDFLAGS.EXTRA = ifneq (undefined, $(origin GLEW_APPLE_GLX)) diff --git a/config/Makefile.darwin-ppc b/config/Makefile.darwin-ppc index a221ede..d511585 100644 --- a/config/Makefile.darwin-ppc +++ b/config/Makefile.darwin-ppc @@ -1,3 +1,5 @@ +# Note: PPC is no longer actively maintained for GLEW, but this configuration +# is here for reference. GLEW_DEST = /usr/local NAME = $(GLEW_NAME) CC = cc diff --git a/config/Makefile.darwin-universal b/config/Makefile.darwin-universal index c485b9f..9518f71 100644 --- a/config/Makefile.darwin-universal +++ b/config/Makefile.darwin-universal @@ -6,6 +6,7 @@ AR = LIBTOOL = libtool -static -o STRIP = CFLAGS.EXTRA = -dynamic -fno-common +CFLAGS.EXTRA += -std=c89 -pedantic #CFLAGS.EXTRA += -no-cpp-precomp CFLAGS.EXTRA += -arch i386 -arch x86_64 LDFLAGS.EXTRA = -arch i386 -arch x86_64 diff --git a/config/Makefile.darwin-x86_64 b/config/Makefile.darwin-x86_64 index e5896a1..1833438 100644 --- a/config/Makefile.darwin-x86_64 +++ b/config/Makefile.darwin-x86_64 @@ -3,6 +3,7 @@ NAME = $(GLEW_NAME) CC = cc LD = cc CFLAGS.EXTRA = -arch x86_64 -dynamic -fno-common +CFLAGS.EXTRA += -std=c89 -pedantic #CFLAGS.EXTRA += -no-cpp-precomp LDFLAGS.EXTRA = -arch x86_64 ifneq (undefined, $(origin GLEW_APPLE_GLX))