source: GTP/trunk/Lib/Illum/GPUObscurancesGT/Libraries/glew/doc/install.html @ 1648

Revision 1648, 7.6 KB checked in by igarcia, 18 years ago (diff)
Line 
1<!--
2 Copyright (C) 2002-2005, Milan Ikits <milan ikits[]ieee org>
3 Copyright (C) 2002-2005, Marcelo E. Magallon <mmagallo[]debian org>
4 This documentation may not be modified or redistributed in any
5 form, except by the copyright holder.
6-->
7<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html/4/loose.dtd">
8<!-- &nbsp;<img src="new.png" height="12" alt="NEW!"> -->
9<html>
10<head>
11<title>
12GLEW: The OpenGL Extension Wrangler Library
13</title>
14<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> 
15<link href="glew.css" type="text/css" rel="stylesheet">
16</head>
17<body bgcolor="#fff0d0">
18<table border="0" width="100%" cellpadding="12" cellspacing="8">
19<tr>
20<td bgcolor="#ffffff" align="left" valign="top" width="200">
21<table border="0" width="100%" cellpadding="0" cellspacing="0" align="left">
22<tr>
23<td valign="top">
24<table border="0" width="100%" cellpadding="0" cellspacing="0" align="left">
25<tr><td align="center"><i>Latest Release: <a href="https://sourceforge.net/project/showfiles.php?group_id=67586&amp;package_id=67942&amp;release_id=327647">1.3.3</a></i></td></tr>
26<tr><td align="center"><br></td></tr>
27<tr><td align="center"><img src="./glew.png" alt="GLEW Logo" width="97" height="75"></td></tr>
28<tr><td align="center"><br></td></tr>
29<tr><td align="center">
30<table border="0" cellpadding="0" cellspacing="0" align="center">
31<tr><td align="center"><a href="index.html">Download</a></td></tr>
32<tr><td align="center"><b>Installation</b></td></tr>
33<tr><td align="center"><a href="basic.html">Basic Usage</a></td></tr>
34<tr><td align="center"><a href="advanced.html">Advanced Usage</a></td></tr>
35<tr><td align="center"><a href="credits.html">Credits & Copyright</a></td></tr>
36<tr><td align="center"><a href="log.html">Change Log</a></td></tr>
37<tr><td align="center"><a href="http://sourceforge.net/projects/glew/">Project Page</a></td></tr>
38<tr><td align="center"><a href="https://sourceforge.net/mail/?group_id=67586">Mailing Lists</a></td></tr>
39<tr><td align="center"><a href="http://sourceforge.net/tracker/?group_id=67586">Bug Tracker</a></td></tr>
40</table>
41<tr><td align="center"><br></tr>
42</table>
43</td>
44</tr>
45<tr>
46<td valign="bottom">
47<table border="0" width="100%" cellpadding="5" cellspacing="0" align="left">
48<tr><td align="center"><i>Last Update: 05-16-05</i></td></tr>
49<tr><td align="center">
50<a href="http://www.opengl.org"> <img src="./ogl_sm.jpg" width="68"
51height="35" border="0" alt="OpenGL Logo"></a>
52<a href="http://sourceforge.net"> <img
53src="http://sourceforge.net/sflogo.php?group_id=67586&amp;type=1"
54width="88" height="31" border="0" alt="SourceForge Logo"></a>
55</td>
56</tr>
57</table>
58</td>
59</tr>
60</table>
61</td>
62
63<td bgcolor="#ffffff" align="left" valign="top">
64
65<h1 align="center">The OpenGL Extension Wrangler Library</h1>
66
67<h2>Installation</h2>
68
69<p>
70To use the shared library version of GLEW, you need to copy the
71headers and libraries into their destination directories. On Windows
72this typically boils down to copying:
73</p>
74
75<table border="0" cellpadding="0" cellspacing="0" align="center"> <!-- bgcolor="#f0f0f0" -->
76<tr><td align="left"><tt>bin/glew32.dll</tt></td><td>&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;</td>
77<td align="left"><tt>%SystemRoot%/system32</tt></td></tr>
78<tr><td align="left"><tt>lib/glew32.lib</tt></td><td>&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;</td>
79<td align="left"><tt>{VC Root}/Lib</tt></td></tr>
80<tr><td align="left"><tt>include/GL/glew.h</tt></td><td>&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;</td>
81<td align="left"><tt>{VC Root}/Include/GL</tt></td></tr>
82<tr><td align="left"><tt>include/GL/wglew.h</tt></td><td>&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;</td>
83<td align="left"><tt>{VC Root}/Include/GL</tt></td></tr>
84</table>
85<p>
86</p>
87
88<p>
89where <tt>{VC Root}</tt> is the Visual C++ root directory, typically
90<tt>C:/Program Files/Microsoft Visual Studio/VC98</tt> for Visual
91Studio 6.0 or <tt>C:/Program Files/Microsoft Visual
92Studio .NET 2003/Vc7/PlatformSDK</tt> for Visual Studio .NET.
93</p>
94
95<p>
96On Unix, typing <tt>make install</tt> will attempt to install GLEW
97into <tt>/usr/include/GL</tt> and <tt>/usr/lib</tt>.  You can
98customize the installation target via the <tt>GLEW_DEST</tt>
99environment variable if you do not have write access to these
100directories.
101</p>
102
103<h2>Building Your Project with GLEW</h2>
104<p>
105There are two ways to build your project with GLEW.
106</p>
107<h3>Including the source files / project file</h3>
108<p>
109The simpler but less flexible way is to include <tt>glew.h</tt> and
110<tt>glew.c</tt> into your project.  On Windows, you also need to
111define the <tt>GLEW_STATIC</tt> preprocessor token when building a
112static library or executable, and the <tt>GLEW_BUILD</tt> preprocessor
113token when building a dll.  You also need to replace
114<tt>&lt;GL/gl.h&gt;</tt> and <tt>&lt;GL/glu.h&gt;</tt> with
115<tt>&lt;glew.h&gt;</tt> in your code and set the appropriate include
116flag (<tt>-I</tt>) to tell the compiler where to look for it.  For
117example:
118</p>
119<p class="pre">
120#include &lt;glew.h&gt;<br>
121#include &lt;GL/glut.h&gt;<br>
122&lt;gl, glu, and glut functionality is available here&gt;<br>
123</p>
124<p>
125Depending on where you put <tt>glew.h</tt> you may also need to change
126the include directives in <tt>glew.c</tt>. Note that if you are using
127GLEW together with GLUT, you have to include <tt>glew.h</tt> first.
128In addition, <tt>glew.h</tt> includes <tt>glu.h</tt>, so you do not
129need to include it separately.
130</p>
131<p>
132On Windows, you also have the option of adding the supplied project
133file <tt>glew_static.dsp</tt> to your workspace (solution) and compile
134it together with your other projects.  In this case you also need to
135change the <tt>GLEW_BUILD</tt> preprocessor constant to
136<tt>GLEW_STATIC</tt> when building a static library or executable,
137otherwise you get build errors.
138</p>
139<p>
140<b>Note that GLEW does not use the C
141runtime library, so it does not matter which version (single-threaded,
142multi-threaded or multi-threaded DLL) it is linked with (without
143debugging information). It is, however, always a good idea to compile all
144your projects including GLEW with the same C runtime settings.</b>
145</p>
146
147<h3>Using GLEW as a shared library</h3>
148
149<p>
150Alternatively, you can use the provided project files / makefile to
151build a separate shared library you can link your projects with later.
152In this case the best practice is to install <tt>glew.h</tt>,
153<tt>glew32.lib</tt>, and <tt>glew32.dll</tt> / <tt>libGLEW.so</tt> to
154where the OpenGL equivalents <tt>gl.h</tt>, <tt>opengl32.lib</tt>, and
155<tt>opengl32.dll</tt> / <tt>libGL.so</tt> are located.  Note that you
156need administrative privileges to do this.  If you do not have
157administrator access and your system administrator will not do it for
158you, you can install GLEW into your own lib and include subdirectories
159and tell the compiler where to find it. Then you can just replace
160<tt>&lt;GL/gl.h&gt;</tt> with <tt>&lt;GL/glew.h&gt;</tt> in your
161program:
162</p>
163
164<p class="pre">
165#include &lt;GL/glew.h&gt;<br>
166#include &lt;GL/glut.h&gt;<br>
167&lt;gl, glu, and glut functionality is available here&gt;<br>
168</p>
169
170<p>
171or:
172</p>
173
174<p class="pre">
175#include &lt;GL/glew.h&gt;<br>
176&lt;gl and glu functionality is available here&gt;<br>
177</p>
178
179<p>
180Remember to link your project with <tt>glew32.lib</tt>,
181<tt>glu32.lib</tt>, and <tt>opengl32.lib</tt> on Windows and
182<tt>libGLEW.so</tt>, <tt>libGLU.so</tt>, and <tt>libGL.so</tt> on
183Unix (<tt>-lGLEW -lGLU -lGL</tt>).
184</p>
185
186<p>
187It is important to keep in mind that <tt>glew.h</tt> includes neither
188<tt>windows.h</tt> nor <tt>gl.h</tt>.  Also, GLEW will warn you by
189issuing a preprocessor error in case you have included <tt>gl.h</tt>,
190<tt>glext.h</tt>, or <tt>glATI.h</tt> before <tt>glew.h</tt>.
191</p>
192
193</td>
194</tr>
195
196</table>
197
198</body>
Note: See TracBrowser for help on using the repository browser.