[1648] | 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 | <!-- <img src="new.png" height="12" alt="NEW!"> --> |
---|
| 9 | <html> |
---|
| 10 | <head> |
---|
| 11 | <title> |
---|
| 12 | GLEW: 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&package_id=67942&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" |
---|
| 51 | height="35" border="0" alt="OpenGL Logo"></a> |
---|
| 52 | <a href="http://sourceforge.net"> <img |
---|
| 53 | src="http://sourceforge.net/sflogo.php?group_id=67586&type=1" |
---|
| 54 | width="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> |
---|
| 70 | To use the shared library version of GLEW, you need to copy the |
---|
| 71 | headers and libraries into their destination directories. On Windows |
---|
| 72 | this 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> to </td> |
---|
| 77 | <td align="left"><tt>%SystemRoot%/system32</tt></td></tr> |
---|
| 78 | <tr><td align="left"><tt>lib/glew32.lib</tt></td><td> to </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> to </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> to </td> |
---|
| 83 | <td align="left"><tt>{VC Root}/Include/GL</tt></td></tr> |
---|
| 84 | </table> |
---|
| 85 | <p> |
---|
| 86 | </p> |
---|
| 87 | |
---|
| 88 | <p> |
---|
| 89 | where <tt>{VC Root}</tt> is the Visual C++ root directory, typically |
---|
| 90 | <tt>C:/Program Files/Microsoft Visual Studio/VC98</tt> for Visual |
---|
| 91 | Studio 6.0 or <tt>C:/Program Files/Microsoft Visual |
---|
| 92 | Studio .NET 2003/Vc7/PlatformSDK</tt> for Visual Studio .NET. |
---|
| 93 | </p> |
---|
| 94 | |
---|
| 95 | <p> |
---|
| 96 | On Unix, typing <tt>make install</tt> will attempt to install GLEW |
---|
| 97 | into <tt>/usr/include/GL</tt> and <tt>/usr/lib</tt>. You can |
---|
| 98 | customize the installation target via the <tt>GLEW_DEST</tt> |
---|
| 99 | environment variable if you do not have write access to these |
---|
| 100 | directories. |
---|
| 101 | </p> |
---|
| 102 | |
---|
| 103 | <h2>Building Your Project with GLEW</h2> |
---|
| 104 | <p> |
---|
| 105 | There are two ways to build your project with GLEW. |
---|
| 106 | </p> |
---|
| 107 | <h3>Including the source files / project file</h3> |
---|
| 108 | <p> |
---|
| 109 | The 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 |
---|
| 111 | define the <tt>GLEW_STATIC</tt> preprocessor token when building a |
---|
| 112 | static library or executable, and the <tt>GLEW_BUILD</tt> preprocessor |
---|
| 113 | token when building a dll. You also need to replace |
---|
| 114 | <tt><GL/gl.h></tt> and <tt><GL/glu.h></tt> with |
---|
| 115 | <tt><glew.h></tt> in your code and set the appropriate include |
---|
| 116 | flag (<tt>-I</tt>) to tell the compiler where to look for it. For |
---|
| 117 | example: |
---|
| 118 | </p> |
---|
| 119 | <p class="pre"> |
---|
| 120 | #include <glew.h><br> |
---|
| 121 | #include <GL/glut.h><br> |
---|
| 122 | <gl, glu, and glut functionality is available here><br> |
---|
| 123 | </p> |
---|
| 124 | <p> |
---|
| 125 | Depending on where you put <tt>glew.h</tt> you may also need to change |
---|
| 126 | the include directives in <tt>glew.c</tt>. Note that if you are using |
---|
| 127 | GLEW together with GLUT, you have to include <tt>glew.h</tt> first. |
---|
| 128 | In addition, <tt>glew.h</tt> includes <tt>glu.h</tt>, so you do not |
---|
| 129 | need to include it separately. |
---|
| 130 | </p> |
---|
| 131 | <p> |
---|
| 132 | On Windows, you also have the option of adding the supplied project |
---|
| 133 | file <tt>glew_static.dsp</tt> to your workspace (solution) and compile |
---|
| 134 | it together with your other projects. In this case you also need to |
---|
| 135 | change the <tt>GLEW_BUILD</tt> preprocessor constant to |
---|
| 136 | <tt>GLEW_STATIC</tt> when building a static library or executable, |
---|
| 137 | otherwise you get build errors. |
---|
| 138 | </p> |
---|
| 139 | <p> |
---|
| 140 | <b>Note that GLEW does not use the C |
---|
| 141 | runtime library, so it does not matter which version (single-threaded, |
---|
| 142 | multi-threaded or multi-threaded DLL) it is linked with (without |
---|
| 143 | debugging information). It is, however, always a good idea to compile all |
---|
| 144 | your 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> |
---|
| 150 | Alternatively, you can use the provided project files / makefile to |
---|
| 151 | build a separate shared library you can link your projects with later. |
---|
| 152 | In 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 |
---|
| 154 | where 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 |
---|
| 156 | need administrative privileges to do this. If you do not have |
---|
| 157 | administrator access and your system administrator will not do it for |
---|
| 158 | you, you can install GLEW into your own lib and include subdirectories |
---|
| 159 | and tell the compiler where to find it. Then you can just replace |
---|
| 160 | <tt><GL/gl.h></tt> with <tt><GL/glew.h></tt> in your |
---|
| 161 | program: |
---|
| 162 | </p> |
---|
| 163 | |
---|
| 164 | <p class="pre"> |
---|
| 165 | #include <GL/glew.h><br> |
---|
| 166 | #include <GL/glut.h><br> |
---|
| 167 | <gl, glu, and glut functionality is available here><br> |
---|
| 168 | </p> |
---|
| 169 | |
---|
| 170 | <p> |
---|
| 171 | or: |
---|
| 172 | </p> |
---|
| 173 | |
---|
| 174 | <p class="pre"> |
---|
| 175 | #include <GL/glew.h><br> |
---|
| 176 | <gl and glu functionality is available here><br> |
---|
| 177 | </p> |
---|
| 178 | |
---|
| 179 | <p> |
---|
| 180 | Remember 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 |
---|
| 183 | Unix (<tt>-lGLEW -lGLU -lGL</tt>). |
---|
| 184 | </p> |
---|
| 185 | |
---|
| 186 | <p> |
---|
| 187 | It 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 |
---|
| 189 | issuing 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> |
---|