OpenGL Programming/Installation/Windows

< OpenGL Programming < Installation

All version of Windows from Windows 95 come with an OpenGL implementation (usually version 1.4). However, if you installed (or updated) the drivers for your graphics card it's probable that you're using your board manufacturer's own implementation of OpenGL.

OpenGL

The OpenGL library can usually be found by the name OpenGL32.dll under the \system32 folder, located in your system's root folder (usually c:\windows).

Headers compatible with OpenGL are bundled with most compilers. The header's versions may not be fully updated to your running implementation of OpenGL. If so, the new functions must be linked manually using the OpenGL's extension system, or using a wrapper such as GLEW.

GLEW

GLEW's official release is meant to work with visualc++ - but if you're using MinGW/GCC with Code::Blocks, no worry - you can:

cd glew-1.7.0/
make

GLee only compiles statically under Windows (not cross-compiling from GNU/Linux) but doesn't have this issue.

GLUT

GLM

GLM is a headers-only library, so you just need to unzip the GLM release to a directory, and add that directory to your include path in the project properties.


Cross-compilation

Newer tutorial Makefile's can now be invoked using a MXE-compatible environment, for example:

git clone https://github.com/mxe/mxe /usr/src/mxe
cd /usr/src/mxe/
# select your architecture in settings.mk, e.g. MXE_TARGETS := i686-w64-mingw32.static
make glew sdl2 sdl2_image freetype
cp -a .../glm /usr/src/mxe/usr/i686-w64-mingw32.static/include/
PATH=/usr/src/mxe/usr/i686-w64-mingw32.static/bin:/usr/src/mxe/usr/bin:$PATH
export CXX=i686-w64-mingw32.static-g++
export EXTRA_CPPFLAGS=-DGLEW_STATIC
export EXTRA_LDLIBS=-lopengl32
export PKG_CONFIG=i686-w64-mingw32.static-pkg-config
cd modern-tutorials/tutXXX/
make

Debugging note: due to a bug you need to pipe your input to GDB through cat:

cd /usr/src/mxe/
make gdb

cd .../modern-tutorials/tutXXX/
cat | wine /usr/src/mxe/usr/i686-w64-mingw32.static/bin/gdb.exe ./triangle
- Comment on this page

- Recent stats

< OpenGL Programming/Installation

Browse & download complete code
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.