2015-10-05 08:20:39 +00:00
# GLEW - The OpenGL Extension Wrangler Library
2017-09-27 09:42:00 +00:00
The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library. GLEW provides efficient run-time mechanisms for determining which OpenGL extensions are supported on the target platform. OpenGL core and extension functionality is exposed in a single header file. GLEW has been tested on a variety of operating systems, including Windows, Linux, Mac OS X, FreeBSD, Irix, and Solaris.
2015-10-05 08:20:39 +00:00
![](http://glew.sourceforge.net/glew.png)
http://glew.sourceforge.net/
https://github.com/nigels-com/glew
2016-01-10 12:15:34 +00:00
[![Gitter ](https://badges.gitter.im/nigels-com/glew.svg )](https://gitter.im/nigels-com/glew?utm_source=badge& utm_medium=badge& utm_campaign=pr-badge)
2016-07-09 04:06:26 +00:00
[![Download ](https://img.shields.io/sourceforge/dm/glew.svg )](https://sourceforge.net/projects/glew/files/latest/download)
2023-11-11 00:00:54 +00:00
[![Health ](https://codebuild.ap-southeast-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiZ0cxMFNORFBPTGQ5Z1MyRUsxRnU5V1ZyOUNUWmZZRFJwNWdBNng5MnNtdFFObGNsTEJkQkxZa0lHYmtMNEZRREZaZmdvMUh2bDMxVjhFc3c2L29odFQ4PSIsIml2UGFyYW1ldGVyU3BlYyI6InhLVlFqWXVaMEZRVFh6c1QiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=master )](https://ap-southeast-2.codebuild.aws.amazon.com/project/eyJlbmNyeXB0ZWREYXRhIjoiK3RLWndGOVVkMWthbXRQZCtVTTNOQ0w2dEpxakZ1cVBTNDZ1UldGODdqUERSdkx0U21Nd0RFaGhQL1kycVlmNzh2OXpEYnRKV3hXTVJJdjUvVStCbTl0dkliZm5jRTFsc0VBPSIsIml2UGFyYW1ldGVyU3BlYyI6ImZ0ekRoMkNjaU0rRUt5K2UiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D)
2015-10-05 08:20:39 +00:00
2020-01-27 00:44:14 +00:00
## Table of Contents
2020-01-27 00:46:14 +00:00
* [Downloads ](#downloads )
* [Recent snapshots ](#recent-snapshots )
* [Build ](#build )
* [Linux and Mac ](#linux-and-mac )
* [Using GNU Make ](#using-gnu-make )
* [Install build tools ](#install-build-tools )
* [Build ](#build-1 )
* [Linux EGL ](#linux-egl )
* [Linux OSMesa ](#linux-osmesa )
* [Linux mingw-w64 ](#linux-mingw-w64 )
* [Using cmake ](#using-cmake )
* [Install build tools ](#install-build-tools-1 )
* [Build ](#build-2 )
* [Windows ](#windows )
* [Visual Studio ](#visual-studio )
* [MSYS/Mingw ](#msysmingw )
* [MSYS2/Mingw-w64 ](#msys2mingw-w64 )
* [glewinfo ](#glewinfo )
* [Code Generation ](#code-generation )
* [Authors ](#authors )
* [Contributions ](#contributions )
* [Copyright and Licensing ](#copyright-and-licensing )
2020-01-27 00:44:14 +00:00
2016-01-31 02:21:59 +00:00
## Downloads
2021-01-10 01:42:18 +00:00
Current release is [2.2.0 ](https://github.com/nigels-com/glew/releases/tag/glew-2.2.0 ).
2016-01-31 02:21:59 +00:00
[(Change Log) ](http://glew.sourceforge.net/log.html )
2019-01-28 11:12:43 +00:00
Sources available as
2021-01-10 01:42:18 +00:00
[ZIP ](https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.zip ) or
[TGZ ](https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0.tgz ).
2016-01-31 02:21:59 +00:00
2021-01-10 01:42:18 +00:00
Windows binaries for [32-bit and 64-bit ](https://github.com/nigels-com/glew/releases/download/glew-2.2.0/glew-2.2.0-win32.zip ).
2016-01-31 02:21:59 +00:00
### Recent snapshots
Snapshots may contain new features, bug-fixes or new OpenGL extensions ahead of tested, official releases.
2022-08-21 07:02:53 +00:00
[glew-20220402.tgz ](https://sourceforge.net/projects/glew/files/glew/snapshots/glew-20220402.tgz/download ) *GLEW 2.2.0 - with fix for glCreateProgressFenceNVX*
2018-10-10 04:09:18 +00:00
2015-10-05 08:20:39 +00:00
## Build
2016-11-13 04:44:44 +00:00
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.
2019-09-28 03:31:40 +00:00
The code generation is known to work on Windows using [MSYS2 ](https://www.msys2.org/ ).
2016-11-13 04:44:44 +00:00
For most end-users of GLEW the official releases are the best choice, with first class support.
2016-01-31 02:21:59 +00:00
### Linux and Mac
#### Using GNU Make
2019-09-28 03:31:40 +00:00
GNU make is the primary build system for GLEW, historically.
It includes targets for building the sources and headers, for maintenance purposes.
2016-01-31 02:21:59 +00:00
##### Install build tools
2018-10-10 02:29:15 +00:00
Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libxmu-dev libxi-dev libgl-dev`
2016-01-31 02:21:59 +00:00
2016-11-13 04:44:44 +00:00
RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel`
2016-01-31 02:21:59 +00:00
2019-01-29 11:38:07 +00:00
FreeBSD: `# pkg install xorg lang/gcc git cmake gmake bash python perl5`
2016-01-31 02:21:59 +00:00
##### Build
2015-10-05 08:20:39 +00:00
2016-01-31 02:21:59 +00:00
$ make
$ sudo make install
$ make clean
2015-10-05 08:20:39 +00:00
2016-09-07 14:26:37 +00:00
Targets: `all, glew.lib (sub-targets: glew.lib.shared, glew.lib.static), glew.bin, clean, install, uninstall`
2016-01-31 02:21:59 +00:00
Variables: `SYSTEM=linux-clang, GLEW_DEST=/usr/local, STRIP=`
2019-04-23 10:12:42 +00:00
_Note: you may need to call `make` in the **auto** folder first_
2016-10-05 00:32:57 +00:00
2018-10-10 02:29:15 +00:00
##### Linux EGL
$ sudo apt install libegl1-mesa-dev
$ make SYSTEM=linux-egl
##### Linux OSMesa
$ sudo apt install libosmesa-dev
$ make SYSTEM=linux-osmesa
2018-10-10 02:29:39 +00:00
##### Linux mingw-w64
2018-10-10 02:29:15 +00:00
$ sudo apt install mingw-w64
$ make SYSTEM=linux-mingw32
$ make SYSTEM=linux-mingw64
2016-01-31 02:21:59 +00:00
#### Using cmake
2022-08-21 07:02:53 +00:00
The cmake build is mostly contributor maintained.
2019-09-28 03:31:40 +00:00
Due to the multitude of use cases this is maintained on a _best effort_ basis.
Pull requests are welcome.
2023-09-22 00:01:45 +00:00
*CMake 3.16 or higher is required.*
2016-01-31 02:21:59 +00:00
##### Install build tools
2018-10-10 00:56:37 +00:00
Debian/Ubuntu/Mint: `$ sudo apt-get install build-essential libxmu-dev libxi-dev libgl-dev cmake git`
2016-01-31 02:21:59 +00:00
2018-10-10 00:56:37 +00:00
RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel cmake git`
2016-01-31 02:21:59 +00:00
##### Build
2018-10-10 00:56:37 +00:00
$ cd build
2019-01-28 11:12:43 +00:00
$ cmake ./cmake
2016-01-31 02:21:59 +00:00
$ make -j4
2015-10-05 08:20:39 +00:00
2016-04-03 08:08:57 +00:00
| Target | Description |
| ---------- | ----------- |
| glew | Build the glew shared library. |
| glew_s | Build the glew static library. |
| glewinfo | Build the `glewinfo` executable (requires `BUILD_UTILS` to be `ON` ). |
| visualinfo | Build the `visualinfo` executable (requires `BUILD_UTILS` to be `ON` ). |
2016-04-03 10:03:16 +00:00
| install | Install all enabled targets into `CMAKE_INSTALL_PREFIX` . |
2016-04-03 08:08:57 +00:00
| clean | Clean up build artifacts. |
| all | Build all enabled targets (default target). |
| Variables | Description |
| --------------- | ----------- |
| BUILD_UTILS | Build the `glewinfo` and `visualinfo` executables. |
2016-04-03 10:03:16 +00:00
| GLEW_REGAL | Build in Regal mode. |
| GLEW_OSMESA | Build in off-screen Mesa mode. |
| BUILD_FRAMEWORK | Build as MacOSX Framework. Setting `CMAKE_INSTALL_PREFIX` to `/Library/Frameworks` is recommended. |
2016-04-03 08:08:57 +00:00
2015-10-05 08:20:39 +00:00
### Windows
2016-02-05 20:46:18 +00:00
#### Visual Studio
2017-11-14 21:57:31 +00:00
Use the provided Visual Studio project file in build/vc15/
2016-01-31 02:21:59 +00:00
2017-11-14 21:57:31 +00:00
Projects for vc6, vc10, vc12 and vc14 are also provided
2016-02-05 20:46:18 +00:00
#### MSYS/Mingw
Available from [Mingw ](http://www.mingw.org/ )
Requirements: bash, make, gcc
$ mingw32-make
$ mingw32-make install
$ mingw32-make install.all
Alternative toolchain: `SYSTEM=mingw-win32`
#### MSYS2/Mingw-w64
Available from [Msys2 ](http://msys2.github.io/ ) and/or [Mingw-w64 ](http://mingw-w64.org/ )
Requirements: bash, make, gcc
2019-09-28 03:31:40 +00:00
$ pacman -S gcc make mingw-w64-i686-gcc mingw-w64-x86_64-gcc
2016-02-05 20:46:18 +00:00
$ make
$ make install
$ make install.all
Alternative toolchain: `SYSTEM=msys, SYSTEM=msys-win32, SYSTEM=msys-win64`
2016-01-31 02:21:59 +00:00
## glewinfo
`glewinfo` is a command-line tool useful for inspecting the capabilities of an
2017-01-15 19:20:19 +00:00
OpenGL implementation and GLEW support for that. Please include `glewinfo.txt`
2019-01-28 11:12:43 +00:00
with bug reports, as appropriate.
2016-01-31 02:21:59 +00:00
---------------------------
GLEW Extension Info
---------------------------
GLEW version 2.0.0
Reporting capabilities of pixelformat 3
Running on a Intel(R) HD Graphics 3000 from Intel
OpenGL version 3.1.0 - Build 9.17.10.4229 is supported
GL_VERSION_1_1: OK
---------------
GL_VERSION_1_2: OK
---------------
glCopyTexSubImage3D: OK
glDrawRangeElements: OK
glTexImage3D: OK
glTexSubImage3D: OK
2019-01-28 11:12:43 +00:00
2016-01-31 02:21:59 +00:00
...
2015-10-05 08:20:39 +00:00
## Code Generation
2016-12-13 18:41:06 +00:00
A Unix or Mac environment is needed for building GLEW from scratch to
2016-01-31 02:21:59 +00:00
include new extensions, or customize the code generation. The extension
data is regenerated from the top level source directory with:
2015-10-05 08:20:39 +00:00
2016-01-31 02:21:59 +00:00
make extensions
2015-10-05 08:20:39 +00:00
An alternative to generating the GLEW sources from scratch is to
download a pre-generated (unsupported) snapshot:
https://sourceforge.net/projects/glew/files/glew/snapshots/
2016-01-31 04:09:57 +00:00
## Authors
GLEW is currently maintained by [Nigel Stewart ](https://github.com/nigels-com )
with bug fixes, new OpenGL extension support and new releases.
GLEW was developed by [Milan Ikits ](http://www.cs.utah.edu/~ikits/ )
and [Marcelo Magallon ](http://wwwvis.informatik.uni-stuttgart.de/~magallon/ ).
Aaron Lefohn, Joe Kniss, and Chris Wyman were the first users and also
2019-01-28 11:12:43 +00:00
assisted with the design and debugging process.
2016-01-31 04:09:57 +00:00
The acronym GLEW originates from Aaron Lefohn.
Pasi Kä rkkä inen identified and fixed several problems with
GLX and SDL. Nate Robins created the `wglinfo` utility, to
2019-01-28 11:12:43 +00:00
which modifications were made by Michael Wimmer.
2016-01-31 04:09:57 +00:00
2018-10-10 04:00:00 +00:00
## Contributions
GLEW welcomes community contributions. Typically these are co-ordinated
2019-01-28 11:12:43 +00:00
via [Issues ](https://github.com/nigels-com/glew/issues ) or
2018-10-10 04:00:00 +00:00
[Pull Requests ](https://github.com/nigels-com/glew/pulls ) in the
GitHub web interface.
Be sure to mention platform and compiler toolchain details when filing
a bug report. The output of `glewinfo` can be quite useful for discussion
also.
2019-09-28 03:31:40 +00:00
Generally GLEW is usually released once a year, around the time of the Siggraph
2018-10-10 04:00:00 +00:00
computer graphics conference. If you're not using the current release
version of GLEW, be sure to check if the issue or bug is fixed there.
2016-01-31 04:09:57 +00:00
## Copyright and Licensing
GLEW is originally derived from the EXTGL project by Lev Povalahev.
2019-01-28 11:12:43 +00:00
The source code is licensed under the
[Modified BSD License ](http://glew.sourceforge.net/glew.txt ), the
2016-01-31 04:09:57 +00:00
[Mesa 3-D License ](http://glew.sourceforge.net/mesa.txt ) (MIT) and the
[Khronos License ](http://glew.sourceforge.net/khronos.txt ) (MIT).
2019-01-28 11:12:43 +00:00
The automatic code generation scripts are released under the
2016-01-31 04:09:57 +00:00
[GNU GPL ](http://glew.sourceforge.net/gpl.txt ).