gl
' (e.g., glColor
, glVertex
, glTranslate
, glRotate
). The Core OpenGL models an object via a set of geometric primitives, such as point, line, and polygon.glu
' (e.g., gluLookAt
, gluPerspective
)glut
' (e.g., glutCreatewindow
, glutMouseFunc
). gl.h
' for core OpenGL, 'glu.h
' for GLU, and 'glut.h
' (or 'freeglut.h
') for GLUT, typically kept under 'includeGL
' directory.libopengl32.a
' for core OpenGL, 'libglu32.a
' for GLU, 'libglut32.a
' (or 'libfreeglut.a
' or 'glut32.lib
') for GLUT, typically kept under 'lib
' directory.glut32.dll
' (for 'freeglut.dll
') for GLUT under Win32, typically kept under 'bin
' or 'c:windowssystem32
'.includeGL
' to '<MINGW_HOME>includeGL
'; the libraries from 'lib
' to '<MINGW_HOME>lib
', and shared library from 'bin
' to '<MINGW_HOME>bin
' (which should be included in the PATH environment variable), where <MINGW_HOME>
is the MinGW installed directory.gl.h
', GLU header 'glu.h
' and GLUT header 'glut.h
' (or 'freeglut.h
') are kept in '<MINGW_HOME>includeGL
' directory. Since '<MINGW_HOME>include
' is in the implicit include-path. We can include the headers as <GL/glut.h>
, <GL/glt.h>
, and <GL/gl.h>
.libopengl32.a
', GLU library 'libglu32.a
' and GLUT library 'libfreeglut.a
' are kept in '<MINGW_HOME>lib
' directory. This directory is in the implicit library-path.opengl32
', 'glu32
', 'freeglut
' without the prefix 'lib
' and suffix '.a
'.glut.h
' to '<MINGW_HOME>includeGL
', 'glut32.lib
' to '<MINGW_HOME>lib
', and 'glut32.dll
' to '<MINGW_HOME>bin
' (which should be included in the PATH))gcc
', 'g++
', 'gdb
', 'make
' (under the 'Devel
' category) and 'opengl
', 'freeglut
' (under the 'Graphics
' category). gl.h
', GLU header 'glu.h
', and GLUT header 'glut.h
' are provided in the '<CYGWIN_HOME>usrincludew32apiGL
' directory. As '<CYGWIN_HOME>usrincludew32api
' is in the implicit include-path. We can include the headers as <GL/glut.h>
, <GL/glt.h>
, and <GL/gl.h>
.libopengl32.a
', GLU library 'libglu32.a
' and GLUT library 'libglut32.a
' are provided in the '<CYGWIN_HOME>libw32api
' directory. This directory is in the implicit library-path.opengl32
', 'glu32
', 'glut32
' without the prefix 'lib
' and suffix '.a
'.-I<dir>
for include-path, -L<dir>
for lib-path, and -l<lib>
for library.Hello
' ⇒ In 'Project type', select 'Executable', 'Empty Project' ⇒ In 'Toolchain', select 'Cygwin GCC' or 'MinGW GCC' (depending on your setup) ⇒ Next ⇒ Finish.GL01Hello.cpp
' ⇒ Finish.GL01Hello.cpp
', type the following source codes:windows.h
' header before the OpenGL headers. glut32
' (Cygwin) or 'freeglut
' (MinGW with freeglut) ⇒ Add ⇒ Enter 'glu32
' ⇒ Add ⇒ Enter 'opengl32
'.-l<lib>
, which specifies the 'library' to be linked. You might also need -I<dir>
to specify the 'include-path' and -L<dir>
to specify the 'lib-path', if the header files and libraries are not kept in implicit directories used by the compiler..metadata.pluginsorg.eclipse.cdt.uiglobal-build.log
'.main.cpp
', and replace with the code, as shown in the previous section.freeglut
' ⇒ Add ⇒ enter 'glu32
' ⇒ Add ⇒ enter 'opengl32
'.C:Program FilesMicrosoft Visual Studio 10.0VC
', with headers in sub-directory 'include
' and libraries in 'lib
'.C:Program FilesMicrosoft SDKsWindowsv7.0A
'. (Otherwise, you need to download and install the Windows SDK separately).gl.h
, glu.h
: header for OpenGL and GLU in directory 'C:Program FilesMicrosoft SDKsWindowsv7.0Aincludegl
'.opengl32.lib
, glu32.lib
: libraries for OpenGL and GLU in directory 'C:Program FilesMicrosoft SDKsWindowsv7.0Alib
'.opengl32.dll
, glu32.dll
: dynamic link libraries for OpenGL and GLU in directory 'C:WindowsSystem32
'. This directory is to be included in PATH environment variable.vcvarsall.bat
' (in 'C:Program FilesMicrosoft Visual Studio 10.0VCbin
'), or 'vcvars32.bat
' in the earlier version, to set the environment variables.glut.h
' to 'C:Program FilesMicrosoft SDKsWindowsv7.0Aincludegl
', 'glut32.lib
' to 'C:Program FilesMicrosoft SDKsWindowsv7.0Alib
', and 'glut32.dll
' to 'C:WindowsSystem32
' (that is, the same locations as OpenGL and GLU).hello
' ⇒ Next ⇒ Check 'Empty Project' ⇒ Finish.GL01Hello.cpp
' ⇒ Add.GL01Hello.cpp
', replace with the above code (in the previous section).opengl32.lib glu32.lib glut32.lib
'.glaux.h
': Try remove '#include <gl/glaux.h>
' from the source code. (Nehe's tutorial codes included a header 'glglaux.h
' for reading BMP file from Lesson #6 onwards. Lesson #1 to #5 do not require this header. GLUAX is obsolete and excluded from Windows SDK v6.0a.) If that does not work, you may have to download and install GLUAX package.gl.h
, glu.h
, glut.h
) path is set in the INCLUDE
environment variable, and the link libraries (opengl32.lib
, glu32.lib
, glut32.lib
) path is set in the LIB
environment variable: