You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

229 lines
9.6KB

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