install.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <!-- begin header.html -->
  2. <!--
  3. The OpenGL Extension Wrangler Library
  4. Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
  5. Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
  6. Copyright (C) 2002, Lev Povalahev
  7. All rights reserved.
  8. Redistribution and use in source and binary forms, with or without
  9. modification, are permitted provided that the following conditions are met:
  10. * Redistributions of source code must retain the above copyright notice,
  11. this list of conditions and the following disclaimer.
  12. * Redistributions in binary form must reproduce the above copyright notice,
  13. this list of conditions and the following disclaimer in the documentation
  14. and/or other materials provided with the distribution.
  15. * The name of the author may be used to endorse or promote products
  16. derived from this software without specific prior written permission.
  17. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  18. AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20. ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  21. LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  22. CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  23. SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  24. INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  25. CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  26. ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  27. THE POSSIBILITY OF SUCH DAMAGE.
  28. -->
  29. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html/4/loose.dtd">
  30. <!-- &nbsp;<img src="new.png" height="12" alt="NEW!"> -->
  31. <html>
  32. <head>
  33. <title>GLEW: The OpenGL Extension Wrangler Library</title>
  34. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  35. <link href="glew.css" type="text/css" rel="stylesheet">
  36. </head>
  37. <body bgcolor="#fff0d0">
  38. <table border="0" width="100%" cellpadding="12" cellspacing="8" style="height:100%">
  39. <tr>
  40. <td bgcolor="#ffffff" align="left" valign="top" width="200">
  41. <table border="0" width="100%" cellpadding="0" cellspacing="0" align="left">
  42. <tr>
  43. <td valign="top">
  44. <table border="0" width="100%" cellpadding="0" cellspacing="0" align="left">
  45. <tr><td align="center"><i>Latest Release: <a href="https://sourceforge.net/projects/glew/files/glew/1.10.0/">1.10.0</a></i></td></tr>
  46. <tr><td align="center"><br></td></tr>
  47. <tr><td align="center"><img src="./glew.png" alt="GLEW Logo" width="97" height="75"></td></tr>
  48. <tr><td align="center"><br></td></tr>
  49. <tr><td align="center">
  50. <table border="0" cellpadding="0" cellspacing="0" align="center">
  51. <tr><td align="center"><a href="index.html">Download</a></td></tr>
  52. <tr><td align="center"><a href="basic.html">Usage</a></td></tr>
  53. <tr><td align="center"><a href="build.html">Building</a></td></tr>
  54. <tr><td align="center">Installation</td></tr>
  55. <tr><td align="center"><a href="advanced.html">Source Generation</a></td></tr>
  56. <tr><td align="center"><a href="credits.html">Credits & Copyright</a></td></tr>
  57. <tr><td align="center"><a href="log.html">Change Log</a></td></tr>
  58. <tr><td align="center"><a href="https://sourceforge.net/projects/glew">Project Page</a></td></tr>
  59. <tr><td align="center"><a href="https://sourceforge.net/p/glew/mailman">Mailing Lists</a></td></tr>
  60. <tr><td align="center"><a href="https://sourceforge.net/p/glew/_list/tickets">Bug Tracker</a></td></tr>
  61. </table>
  62. <tr><td align="center"><br></tr>
  63. </table>
  64. </td>
  65. </tr>
  66. <tr>
  67. <td valign="bottom">
  68. <table border="0" width="100%" cellpadding="5" cellspacing="0" align="left">
  69. <tr><td align="center"><i>Last Update: 07-22-13</i></td></tr>
  70. <tr><td align="center">
  71. <a href="http://www.opengl.org"> <img src="./ogl_sm.jpg" width="68"
  72. height="35" border="0" alt="OpenGL Logo"></a>
  73. <a href="http://sourceforge.net"> <img
  74. src="http://sourceforge.net/sflogo.php?group_id=67586&amp;type=1"
  75. width="88" height="31" border="0" alt="SourceForge Logo"></a>
  76. </td>
  77. </tr>
  78. <!--- <tr><td align="center"><a
  79. href="http://sourceforge.net/donate/index.php?group_id=67586"><img
  80. src="http://images.sourceforge.net/images/project-support.jpg"
  81. width="88" height="32" border="0" alt="Support This Project"></a></td></tr> -->
  82. </table>
  83. </td>
  84. </tr>
  85. </table>
  86. </td>
  87. <td bgcolor="#ffffff" align="left" valign="top">
  88. <h1>The OpenGL Extension Wrangler Library</h1>
  89. <!-- end header.html -->
  90. <h2>Installation</h2>
  91. <p>
  92. To use the shared library version of GLEW, you need to copy the
  93. headers and libraries into their destination directories. On Windows
  94. this typically boils down to copying:
  95. </p>
  96. <table border="0" cellpadding="0" cellspacing="0" align="center"> <!-- bgcolor="#f0f0f0" -->
  97. <tr><td align="left"><tt>bin/glew32.dll</tt></td><td>&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;</td>
  98. <td align="left"><tt>%SystemRoot%/system32</tt></td></tr>
  99. <tr><td align="left"><tt>lib/glew32.lib</tt></td><td>&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;</td>
  100. <td align="left"><tt>{VC Root}/Lib</tt></td></tr>
  101. <tr><td align="left"><tt>include/GL/glew.h</tt></td><td>&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;</td>
  102. <td align="left"><tt>{VC Root}/Include/GL</tt></td></tr>
  103. <tr><td align="left"><tt>include/GL/wglew.h</tt></td><td>&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;</td>
  104. <td align="left"><tt>{VC Root}/Include/GL</tt></td></tr>
  105. </table>
  106. <p>
  107. </p>
  108. <p>
  109. where <tt>{VC Root}</tt> is the Visual C++ root directory, typically
  110. <tt>C:/Program Files/Microsoft Visual Studio/VC98</tt> for Visual
  111. Studio 6.0 or <tt>C:/Program Files/Microsoft Visual
  112. Studio .NET 2003/Vc7/PlatformSDK</tt> for Visual Studio .NET.
  113. </p>
  114. <p>
  115. On Unix, typing <tt>make install</tt> will attempt to install GLEW
  116. into <tt>/usr/include/GL</tt> and <tt>/usr/lib</tt>. You can
  117. customize the installation target via the <tt>GLEW_DEST</tt>
  118. environment variable if you do not have write access to these
  119. directories.
  120. </p>
  121. <h2>Building Your Project with GLEW</h2>
  122. <p>
  123. There are two ways to build your project with GLEW.
  124. </p>
  125. <h3>Including the source files / project file</h3>
  126. <p>
  127. The simpler but less flexible way is to include <tt>glew.h</tt> and
  128. <tt>glew.c</tt> into your project. On Windows, you also need to
  129. define the <tt>GLEW_STATIC</tt> preprocessor token when building a
  130. static library or executable, and the <tt>GLEW_BUILD</tt> preprocessor
  131. token when building a dll. You also need to replace
  132. <tt>&lt;GL/gl.h&gt;</tt> and <tt>&lt;GL/glu.h&gt;</tt> with
  133. <tt>&lt;glew.h&gt;</tt> in your code and set the appropriate include
  134. flag (<tt>-I</tt>) to tell the compiler where to look for it. For
  135. example:
  136. </p>
  137. <p class="pre">
  138. #include &lt;glew.h&gt;<br>
  139. #include &lt;GL/glut.h&gt;<br>
  140. &lt;gl, glu, and glut functionality is available here&gt;<br>
  141. </p>
  142. <p>
  143. Depending on where you put <tt>glew.h</tt> you may also need to change
  144. the include directives in <tt>glew.c</tt>. Note that if you are using
  145. GLEW together with GLUT, you have to include <tt>glew.h</tt> first.
  146. In addition, <tt>glew.h</tt> includes <tt>glu.h</tt>, so you do not
  147. need to include it separately.
  148. </p>
  149. <p>
  150. On Windows, you also have the option of adding the supplied project
  151. file <tt>glew_static.dsp</tt> to your workspace (solution) and compile
  152. it together with your other projects. In this case you also need to
  153. change the <tt>GLEW_BUILD</tt> preprocessor constant to
  154. <tt>GLEW_STATIC</tt> when building a static library or executable,
  155. otherwise you get build errors.
  156. </p>
  157. <p>
  158. <b>Note that GLEW does not use the C
  159. runtime library, so it does not matter which version (single-threaded,
  160. multi-threaded or multi-threaded DLL) it is linked with (without
  161. debugging information). It is, however, always a good idea to compile all
  162. your projects including GLEW with the same C runtime settings.</b>
  163. </p>
  164. <h3>Using GLEW as a shared library</h3>
  165. <p>
  166. Alternatively, you can use the provided project files / makefile to
  167. build a separate shared library you can link your projects with later.
  168. In this case the best practice is to install <tt>glew.h</tt>,
  169. <tt>glew32.lib</tt>, and <tt>glew32.dll</tt> / <tt>libGLEW.so</tt> to
  170. where the OpenGL equivalents <tt>gl.h</tt>, <tt>opengl32.lib</tt>, and
  171. <tt>opengl32.dll</tt> / <tt>libGL.so</tt> are located. Note that you
  172. need administrative privileges to do this. If you do not have
  173. administrator access and your system administrator will not do it for
  174. you, you can install GLEW into your own lib and include subdirectories
  175. and tell the compiler where to find it. Then you can just replace
  176. <tt>&lt;GL/gl.h&gt;</tt> with <tt>&lt;GL/glew.h&gt;</tt> in your
  177. program:
  178. </p>
  179. <p class="pre">
  180. #include &lt;GL/glew.h&gt;<br>
  181. #include &lt;GL/glut.h&gt;<br>
  182. &lt;gl, glu, and glut functionality is available here&gt;<br>
  183. </p>
  184. <p>
  185. or:
  186. </p>
  187. <p class="pre">
  188. #include &lt;GL/glew.h&gt;<br>
  189. &lt;gl and glu functionality is available here&gt;<br>
  190. </p>
  191. <p>
  192. Remember to link your project with <tt>glew32.lib</tt>,
  193. <tt>glu32.lib</tt>, and <tt>opengl32.lib</tt> on Windows and
  194. <tt>libGLEW.so</tt>, <tt>libGLU.so</tt>, and <tt>libGL.so</tt> on
  195. Unix (<tt>-lGLEW -lGLU -lGL</tt>).
  196. </p>
  197. <p>
  198. It is important to keep in mind that <tt>glew.h</tt> includes neither
  199. <tt>windows.h</tt> nor <tt>gl.h</tt>. Also, GLEW will warn you by
  200. issuing a preprocessor error in case you have included <tt>gl.h</tt>,
  201. <tt>glext.h</tt>, or <tt>glATI.h</tt> before <tt>glew.h</tt>.
  202. </p>
  203. <!-- begin footer.html -->
  204. </td></tr></table></body>
  205. <!-- end footer.html -->