README.md 6.63 KB
Newer Older
1
2
# GLEW - The OpenGL Extension Wrangler Library

3
4
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.

5
6
7
8
9
10
11
![](http://glew.sourceforge.net/glew.png)

http://glew.sourceforge.net/

https://github.com/nigels-com/glew

[![Build Status](https://travis-ci.org/nigels-com/glew.svg?branch=master)](https://travis-ci.org/nigels-com/glew)
12
[![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)
13
[![Download](https://img.shields.io/sourceforge/dm/glew.svg)](https://sourceforge.net/projects/glew/files/latest/download)
14

15
16
## Downloads

Nigel Stewart's avatar
Nigel Stewart committed
17
Current release is [2.1.0](https://sourceforge.net/projects/glew/files/glew/2.1.0/).
18
19
20
[(Change Log)](http://glew.sourceforge.net/log.html)

Sources available as 
Nigel Stewart's avatar
Nigel Stewart committed
21
22
[ZIP](https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.zip/download) or
[TGZ](https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0.tgz/download).
23

Nigel Stewart's avatar
Nigel Stewart committed
24
Windows binaries for [32-bit and 64-bit](https://sourceforge.net/projects/glew/files/glew/2.1.0/glew-2.1.0-win32.zip/download).
25
26
27
28
29

### Recent snapshots

Snapshots may contain new features, bug-fixes or new OpenGL extensions ahead of tested, official releases.

30
31
## Build

Nigel Stewart's avatar
Nigel Stewart committed
32
33
34
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.
35
36
37
38
39
40
41

### Linux and Mac

#### Using GNU Make

##### Install build tools

Nigel Stewart's avatar
Nigel Stewart committed
42
Debian/Ubuntu/Mint:    `$ sudo apt-get install build-essential libxmu-dev libxi-dev libgl-dev libosmesa-dev`
43

Nigel Stewart's avatar
Nigel Stewart committed
44
RedHat/CentOS/Fedora:  `$ sudo yum install libXmu-devel libXi-devel libGL-devel`
45
46

##### Build
47

48
49
50
	$ make
	$ sudo make install
	$ make clean
51

52
Targets:    `all, glew.lib (sub-targets: glew.lib.shared, glew.lib.static), glew.bin, clean, install, uninstall`
53
54
55

Variables:  `SYSTEM=linux-clang, GLEW_DEST=/usr/local, STRIP=`

Miguel Vera's avatar
Miguel Vera committed
56
57
_Note: may need to make **auto** folder_

58
59
60
61
62
63
#### Using cmake

*CMake 2.8.12 or higher is required.*

##### Install build tools

Nigel Stewart's avatar
Nigel Stewart committed
64
Debian/Ubuntu/Mint:   `$ sudo apt-get install build-essential libXmu-dev libXi-dev libgl-dev cmake`
65

Nigel Stewart's avatar
Nigel Stewart committed
66
RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel cmake`
67
68
69
70
71
72

##### Build

	$ cd build
	$ cmake ./cmake 
	$ make -j4
73

74
75
76
77
78
79
| 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`). |
Nigel Stewart's avatar
Nigel Stewart committed
80
| install    | Install all enabled targets into `CMAKE_INSTALL_PREFIX`. |
81
82
83
84
85
86
| clean      | Clean up build artifacts. |
| all        | Build all enabled targets (default target). |

| Variables       | Description |
| --------------- | ----------- |
| BUILD_UTILS     | Build the `glewinfo` and `visualinfo` executables. |
Nigel Stewart's avatar
Nigel Stewart committed
87
88
89
| 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. |
90

91
92
### Windows

93
94
#### Visual Studio

95
96
Use the provided Visual Studio project file in build/vc12/

97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Projects for vc6 and vc10 are also provided

#### 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

	$ pacman -S gcc make  mingw-w64-i686-gcc mingw-w64-x86_64-gcc 
	$ make
	$ make install
	$ make install.all

Alternative toolchain:  `SYSTEM=msys, SYSTEM=msys-win32, SYSTEM=msys-win64`

124
125
126
## glewinfo

`glewinfo` is a command-line tool useful for inspecting the capabilities of an
127
128
OpenGL implementation and GLEW support for that.  Please include `glewinfo.txt`
with bug reports, as appropriate.	
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149

	---------------------------
	    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
	
	...
150
151
152

## Code Generation

153
A Unix or Mac environment is needed for building GLEW from scratch to
154
155
include new extensions, or customize the code generation. The extension
data is regenerated from the top level source directory with:
156

157
	make extensions
158
159
160
161
162
163
164
165

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/

Travis-built snapshots are also available:

166
https://glew.s3.amazonaws.com/index.html
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192

## 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
assisted with the design and debugging process.  

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
which modifications were made by Michael Wimmer.  

## Copyright and Licensing

GLEW is originally derived from the EXTGL project by Lev Povalahev.
The source code is licensed under the 
[Modified BSD License](http://glew.sourceforge.net/glew.txt), the 
[Mesa 3-D License](http://glew.sourceforge.net/mesa.txt) (MIT) and the
[Khronos License](http://glew.sourceforge.net/khronos.txt) (MIT).

The automatic code generation scripts are released under the 
[GNU GPL](http://glew.sourceforge.net/gpl.txt).