~ubuntu-branches/ubuntu/trusty/glew/trusty

« back to all changes in this revision

Viewing changes to auto/doc/install.html

  • Committer: Bazaar Package Importer
  • Author(s): Joost Yervante Damad
  • Date: 2010-04-10 18:16:21 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100410181621-179fn0er7sjbccku
Tags: 1.5.3-1
* New upstream release (Closes: #577183)
* reworked mx build support to reflect new version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<h2>Installation</h2>
 
2
 
 
3
<p>
 
4
To use the shared library version of GLEW, you need to copy the
 
5
headers and libraries into their destination directories. On Windows
 
6
this typically boils down to copying:
 
7
</p>
 
8
 
 
9
<table border="0" cellpadding="0" cellspacing="0" align="center"> <!-- bgcolor="#f0f0f0" -->
 
10
<tr><td align="left"><tt>bin/glew32.dll</tt></td><td>&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;</td>
 
11
<td align="left"><tt>%SystemRoot%/system32</tt></td></tr>
 
12
<tr><td align="left"><tt>lib/glew32.lib</tt></td><td>&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;</td>
 
13
<td align="left"><tt>{VC Root}/Lib</tt></td></tr>
 
14
<tr><td align="left"><tt>include/GL/glew.h</tt></td><td>&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;</td>
 
15
<td align="left"><tt>{VC Root}/Include/GL</tt></td></tr>
 
16
<tr><td align="left"><tt>include/GL/wglew.h</tt></td><td>&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;</td>
 
17
<td align="left"><tt>{VC Root}/Include/GL</tt></td></tr>
 
18
</table>
 
19
<p>
 
20
</p>
 
21
 
 
22
<p>
 
23
where <tt>{VC Root}</tt> is the Visual C++ root directory, typically
 
24
<tt>C:/Program Files/Microsoft Visual Studio/VC98</tt> for Visual
 
25
Studio 6.0 or <tt>C:/Program Files/Microsoft Visual
 
26
Studio .NET 2003/Vc7/PlatformSDK</tt> for Visual Studio .NET.
 
27
</p>
 
28
 
 
29
<p>
 
30
On Unix, typing <tt>make install</tt> will attempt to install GLEW
 
31
into <tt>/usr/include/GL</tt> and <tt>/usr/lib</tt>.  You can
 
32
customize the installation target via the <tt>GLEW_DEST</tt>
 
33
environment variable if you do not have write access to these
 
34
directories.
 
35
</p>
 
36
 
 
37
<h2>Building Your Project with GLEW</h2>
 
38
<p>
 
39
There are two ways to build your project with GLEW.
 
40
</p>
 
41
<h3>Including the source files / project file</h3>
 
42
<p>
 
43
The simpler but less flexible way is to include <tt>glew.h</tt> and
 
44
<tt>glew.c</tt> into your project.  On Windows, you also need to
 
45
define the <tt>GLEW_STATIC</tt> preprocessor token when building a
 
46
static library or executable, and the <tt>GLEW_BUILD</tt> preprocessor
 
47
token when building a dll.  You also need to replace
 
48
<tt>&lt;GL/gl.h&gt;</tt> and <tt>&lt;GL/glu.h&gt;</tt> with
 
49
<tt>&lt;glew.h&gt;</tt> in your code and set the appropriate include
 
50
flag (<tt>-I</tt>) to tell the compiler where to look for it.  For
 
51
example:
 
52
</p>
 
53
<p class="pre">
 
54
#include &lt;glew.h&gt;<br>
 
55
#include &lt;GL/glut.h&gt;<br>
 
56
&lt;gl, glu, and glut functionality is available here&gt;<br>
 
57
</p>
 
58
<p>
 
59
Depending on where you put <tt>glew.h</tt> you may also need to change
 
60
the include directives in <tt>glew.c</tt>. Note that if you are using
 
61
GLEW together with GLUT, you have to include <tt>glew.h</tt> first.
 
62
In addition, <tt>glew.h</tt> includes <tt>glu.h</tt>, so you do not
 
63
need to include it separately.
 
64
</p>
 
65
<p>
 
66
On Windows, you also have the option of adding the supplied project
 
67
file <tt>glew_static.dsp</tt> to your workspace (solution) and compile
 
68
it together with your other projects.  In this case you also need to
 
69
change the <tt>GLEW_BUILD</tt> preprocessor constant to
 
70
<tt>GLEW_STATIC</tt> when building a static library or executable,
 
71
otherwise you get build errors.
 
72
</p>
 
73
<p>
 
74
<b>Note that GLEW does not use the C
 
75
runtime library, so it does not matter which version (single-threaded,
 
76
multi-threaded or multi-threaded DLL) it is linked with (without
 
77
debugging information). It is, however, always a good idea to compile all
 
78
your projects including GLEW with the same C runtime settings.</b>
 
79
</p>
 
80
 
 
81
<h3>Using GLEW as a shared library</h3>
 
82
 
 
83
<p>
 
84
Alternatively, you can use the provided project files / makefile to
 
85
build a separate shared library you can link your projects with later.
 
86
In this case the best practice is to install <tt>glew.h</tt>,
 
87
<tt>glew32.lib</tt>, and <tt>glew32.dll</tt> / <tt>libGLEW.so</tt> to
 
88
where the OpenGL equivalents <tt>gl.h</tt>, <tt>opengl32.lib</tt>, and
 
89
<tt>opengl32.dll</tt> / <tt>libGL.so</tt> are located.  Note that you
 
90
need administrative privileges to do this.  If you do not have
 
91
administrator access and your system administrator will not do it for
 
92
you, you can install GLEW into your own lib and include subdirectories
 
93
and tell the compiler where to find it. Then you can just replace
 
94
<tt>&lt;GL/gl.h&gt;</tt> with <tt>&lt;GL/glew.h&gt;</tt> in your
 
95
program:
 
96
</p>
 
97
 
 
98
<p class="pre">
 
99
#include &lt;GL/glew.h&gt;<br>
 
100
#include &lt;GL/glut.h&gt;<br>
 
101
&lt;gl, glu, and glut functionality is available here&gt;<br>
 
102
</p>
 
103
 
 
104
<p>
 
105
or:
 
106
</p>
 
107
 
 
108
<p class="pre">
 
109
#include &lt;GL/glew.h&gt;<br>
 
110
&lt;gl and glu functionality is available here&gt;<br>
 
111
</p>
 
112
 
 
113
<p>
 
114
Remember to link your project with <tt>glew32.lib</tt>,
 
115
<tt>glu32.lib</tt>, and <tt>opengl32.lib</tt> on Windows and
 
116
<tt>libGLEW.so</tt>, <tt>libGLU.so</tt>, and <tt>libGL.so</tt> on
 
117
Unix (<tt>-lGLEW -lGLU -lGL</tt>).
 
118
</p>
 
119
 
 
120
<p>
 
121
It is important to keep in mind that <tt>glew.h</tt> includes neither
 
122
<tt>windows.h</tt> nor <tt>gl.h</tt>.  Also, GLEW will warn you by
 
123
issuing a preprocessor error in case you have included <tt>gl.h</tt>,
 
124
<tt>glext.h</tt>, or <tt>glATI.h</tt> before <tt>glew.h</tt>.
 
125
</p>
 
126