|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
The OpenGL Extension Wrangler Library
|
|
kusano |
7d535a |
Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee="" org=""></milan>
|
|
kusano |
7d535a |
Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org=""></mmagallo[]debian>
|
|
kusano |
7d535a |
Copyright (C) 2002, Lev Povalahev
|
|
kusano |
7d535a |
All rights reserved.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Redistribution and use in source and binary forms, with or without
|
|
kusano |
7d535a |
modification, are permitted provided that the following conditions are met:
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
* Redistributions of source code must retain the above copyright notice,
|
|
kusano |
7d535a |
this list of conditions and the following disclaimer.
|
|
kusano |
7d535a |
* Redistributions in binary form must reproduce the above copyright notice,
|
|
kusano |
7d535a |
this list of conditions and the following disclaimer in the documentation
|
|
kusano |
7d535a |
and/or other materials provided with the distribution.
|
|
kusano |
7d535a |
* The name of the author may be used to endorse or promote products
|
|
kusano |
7d535a |
derived from this software without specific prior written permission.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
kusano |
7d535a |
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
kusano |
7d535a |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
kusano |
7d535a |
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
kusano |
7d535a |
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
kusano |
7d535a |
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
kusano |
7d535a |
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
kusano |
7d535a |
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
kusano |
7d535a |
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
kusano |
7d535a |
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
|
kusano |
7d535a |
THE POSSIBILITY OF SUCH DAMAGE.
|
|
kusano |
7d535a |
-->
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
<title>GLEW: The OpenGL Extension Wrangler Library</title>
|
|
kusano |
7d535a |
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
|
|
kusano |
7d535a |
<link href="glew.css" rel="stylesheet" type="text/css">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Latest Release: 1.9.0
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Download
|
|
kusano |
7d535a |
Usage
|
|
kusano |
7d535a |
Building
|
|
kusano |
7d535a |
Installation
|
|
kusano |
7d535a |
Source Generation
|
|
kusano |
7d535a |
Credits & Copyright
|
|
kusano |
7d535a |
Change Log
|
|
kusano |
7d535a |
Project Page
|
|
kusano |
7d535a |
Mailing Lists
|
|
kusano |
7d535a |
Bug Tracker
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Last Update: 08-06-12
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
height="35" border="0" alt="OpenGL Logo">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
src="http://sourceforge.net/sflogo.php?group_id=67586&type=1"
|
|
kusano |
7d535a |
width="88" height="31" border="0" alt="SourceForge Logo">
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
href="http://sourceforge.net/donate/index.php?group_id=67586">
|
|
kusano |
7d535a |
src="http://images.sourceforge.net/images/project-support.jpg"
|
|
kusano |
7d535a |
width="88" height="32" border="0" alt="Support This Project"> -->
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
The OpenGL Extension Wrangler Library
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Installation
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
To use the shared library version of GLEW, you need to copy the
|
|
kusano |
7d535a |
headers and libraries into their destination directories. On Windows
|
|
kusano |
7d535a |
this typically boils down to copying:
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
<tt>bin/glew32.dll</tt> to
|
|
kusano |
7d535a |
<tt>%SystemRoot%/system32</tt>
|
|
kusano |
7d535a |
<tt>lib/glew32.lib</tt> to
|
|
kusano |
7d535a |
<tt>{VC Root}/Lib</tt>
|
|
kusano |
7d535a |
<tt>include/GL/glew.h</tt> to
|
|
kusano |
7d535a |
<tt>{VC Root}/Include/GL</tt>
|
|
kusano |
7d535a |
<tt>include/GL/wglew.h</tt> to
|
|
kusano |
7d535a |
<tt>{VC Root}/Include/GL</tt>
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
where <tt>{VC Root}</tt> is the Visual C++ root directory, typically
|
|
kusano |
7d535a |
<tt>C:/Program Files/Microsoft Visual Studio/VC98</tt> for Visual
|
|
kusano |
7d535a |
Studio 6.0 or <tt>C:/Program Files/Microsoft Visual</tt>
|
|
kusano |
7d535a |
Studio .NET 2003/Vc7/PlatformSDK for Visual Studio .NET.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
On Unix, typing <tt>make install</tt> will attempt to install GLEW
|
|
kusano |
7d535a |
into <tt>/usr/include/GL</tt> and <tt>/usr/lib</tt>. You can
|
|
kusano |
7d535a |
customize the installation target via the <tt>GLEW_DEST</tt>
|
|
kusano |
7d535a |
environment variable if you do not have write access to these
|
|
kusano |
7d535a |
directories.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Building Your Project with GLEW
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
There are two ways to build your project with GLEW.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Including the source files / project file
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
The simpler but less flexible way is to include <tt>glew.h</tt> and
|
|
kusano |
7d535a |
<tt>glew.c</tt> into your project. On Windows, you also need to
|
|
kusano |
7d535a |
define the <tt>GLEW_STATIC</tt> preprocessor token when building a
|
|
kusano |
7d535a |
static library or executable, and the <tt>GLEW_BUILD</tt> preprocessor
|
|
kusano |
7d535a |
token when building a dll. You also need to replace
|
|
kusano |
7d535a |
<tt><GL/gl.h></tt> and <tt><GL/glu.h></tt> with
|
|
kusano |
7d535a |
<tt><glew.h></tt> in your code and set the appropriate include
|
|
kusano |
7d535a |
flag (<tt>-I</tt>) to tell the compiler where to look for it. For
|
|
kusano |
7d535a |
example:
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#include <glew.h>
|
|
kusano |
7d535a |
#include <GL/glut.h>
|
|
kusano |
7d535a |
<gl, glu, and glut functionality is available here>
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Depending on where you put <tt>glew.h</tt> you may also need to change
|
|
kusano |
7d535a |
the include directives in <tt>glew.c</tt>. Note that if you are using
|
|
kusano |
7d535a |
GLEW together with GLUT, you have to include <tt>glew.h</tt> first.
|
|
kusano |
7d535a |
In addition, <tt>glew.h</tt> includes <tt>glu.h</tt>, so you do not
|
|
kusano |
7d535a |
need to include it separately.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
On Windows, you also have the option of adding the supplied project
|
|
kusano |
7d535a |
file <tt>glew_static.dsp</tt> to your workspace (solution) and compile
|
|
kusano |
7d535a |
it together with your other projects. In this case you also need to
|
|
kusano |
7d535a |
change the <tt>GLEW_BUILD</tt> preprocessor constant to
|
|
kusano |
7d535a |
<tt>GLEW_STATIC</tt> when building a static library or executable,
|
|
kusano |
7d535a |
otherwise you get build errors.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Note that GLEW does not use the C
|
|
kusano |
7d535a |
runtime library, so it does not matter which version (single-threaded,
|
|
kusano |
7d535a |
multi-threaded or multi-threaded DLL) it is linked with (without
|
|
kusano |
7d535a |
debugging information). It is, however, always a good idea to compile all
|
|
kusano |
7d535a |
your projects including GLEW with the same C runtime settings.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Using GLEW as a shared library
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Alternatively, you can use the provided project files / makefile to
|
|
kusano |
7d535a |
build a separate shared library you can link your projects with later.
|
|
kusano |
7d535a |
In this case the best practice is to install <tt>glew.h</tt>,
|
|
kusano |
7d535a |
<tt>glew32.lib</tt>, and <tt>glew32.dll</tt> / <tt>libGLEW.so</tt> to
|
|
kusano |
7d535a |
where the OpenGL equivalents <tt>gl.h</tt>, <tt>opengl32.lib</tt>, and
|
|
kusano |
7d535a |
<tt>opengl32.dll</tt> / <tt>libGL.so</tt> are located. Note that you
|
|
kusano |
7d535a |
need administrative privileges to do this. If you do not have
|
|
kusano |
7d535a |
administrator access and your system administrator will not do it for
|
|
kusano |
7d535a |
you, you can install GLEW into your own lib and include subdirectories
|
|
kusano |
7d535a |
and tell the compiler where to find it. Then you can just replace
|
|
kusano |
7d535a |
<tt><GL/gl.h></tt> with <tt><GL/glew.h></tt> in your
|
|
kusano |
7d535a |
program:
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#include <GL/glew.h>
|
|
kusano |
7d535a |
#include <GL/glut.h>
|
|
kusano |
7d535a |
<gl, glu, and glut functionality is available here>
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
or:
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
#include <GL/glew.h>
|
|
kusano |
7d535a |
<gl and glu functionality is available here>
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
Remember to link your project with <tt>glew32.lib</tt>,
|
|
kusano |
7d535a |
<tt>glu32.lib</tt>, and <tt>opengl32.lib</tt> on Windows and
|
|
kusano |
7d535a |
<tt>libGLEW.so</tt>, <tt>libGLU.so</tt>, and <tt>libGL.so</tt> on
|
|
kusano |
7d535a |
Unix (<tt>-lGLEW -lGLU -lGL</tt>).
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
It is important to keep in mind that <tt>glew.h</tt> includes neither
|
|
kusano |
7d535a |
<tt>windows.h</tt> nor <tt>gl.h</tt>. Also, GLEW will warn you by
|
|
kusano |
7d535a |
issuing a preprocessor error in case you have included <tt>gl.h</tt>,
|
|
kusano |
7d535a |
<tt>glext.h</tt>, or <tt>glATI.h</tt> before <tt>glew.h</tt>.
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|
|
kusano |
7d535a |
|