To main page | 3dengine.org

GLEW


OpenGL Extension Wrangler Library (or GLEW) is a tool to simplify usage of GL extensions, like shown here.

Installation

Well written here, however for recent Visual C++ (Express too) for Windows:

1. Get the library
2. Unpack it (usually with right click)
2. Copy files
bin/glew32.dll to C:\windows\system32\
lib/glew32.lib to C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\
lib/glew32s.lib to C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\
include/GL/glew.h to C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\GL
include/GL/wglew.h to C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\GL

Usage and linking (for each project)

#include <glew.h>
#include <wglew.h>
If you use GLUT - include it AFTER those lines, however SDL is more recommended.

in main():
GLenum err = glewInit();
if (GLEW_OK != err) {
    exit( 1 ); // error
};

Linking (for each project)



In Visual C++ - right-click your project name in leftmost window (the second line), click "Properties", there 1) in Configuration drop-down select All configurations 2) find "Configuration properties", there "Linker", there "Input", there in Additional Dependencies you should put something like this:
glew32.lib
(If you already have something there - add this to the end of those you have).

You may remove opengl32.lib and glu32.lib from linking (glew takes care of those).

Or if you use SDL and SOIL (both recommended):
SDL.lib glew32.lib soil.lib
The order of those is important!