Getting Started

From OpenGL Wiki
Revision as of 07:01, 29 March 2006 by V-man (talk | contribs) (→‎Windows)
Jump to navigation Jump to search

Installing OpenGL runtime libraries


If you are running Windows 98/NT/2000/XP/2003, the OpenGL library has already been installed on your system. Win95A did not come with GL, so Microsoft has made this available Windows OpenGL library Remember that GL is a system component on Windows. DO NOT modify or copy opengl32.dll from one OS to another. The filename is opengl32.dll and is either in WINDOWS\SYSTEM, WINNT\SYSTEM32, WINDOWS\SYSTEM32

This library alone will not give you hardware acceleration for OpenGL, though, so you will need to install the latest drivers for your graphics card:

Some sites also distribute beta versions of graphics drivers, which may give you access to bug fixes or new functionality before an official driver release from the manufacturer:

GLU is also included in the system folder as glu32.dll This is also a system component. Updated dll should be placed in your program's folder. You can get a GLU's source code from [http:/] You can get precompiled lib from [1] The current version is 1.3

Other libraries like GLUT, freeGLUT, QT, etc are not part of the OS. These should be downloaded from the net. [2]

OpenGL 2.0 and extensions

If you will be programming for Windows, typically compilers comes with a standard GL 1.1 .h and .lib To access higher GL functions, you would have to get the function pointer. For example, in C or C++, this is what you would do

Download glext.h and wglext.h from [3]

Put it in you compiler GL folder

  1. include <GL/gl.h>
  2. include <GL/glext.h>
  3. include <GL/wglext.h>

PFNGLACTIVETEXTUREPROC glActiveTexture; //Declare your function pointer in a .cpp file extern PFNGLACTIVETEXTUREPROC glActiveTexture; //Put this in a .h so that you can include the header in all your other .cpp

Once you create a GL context, you can use wglGetProcAddress to get a pointer to the function.

glActiveTexture = (PFNGLACTIVETEXTUREPROC) wglGetProcAddress("glActiveTexture");


Graphics on Linux is almost exclusively implemented using the X windows system. Supporting OpenGL on Linux involves using GLX extensions to the X Server. There is a standard Application Binary Interface defined for OpenGL on Linux that gives application compatability for OpenGL for a range of drivers. In addition the Direct Rendering Infrastucture (DRI) is a driver framework that allows drivers to be written and interoperate within a standard framework to easily support hardware acceleration, the DRI is included in of XFree86 4.0 but may need a card specific dirver to be configured after installation.

Vendors have different approaches to drivers on Linux, some support Open Source efforts using the DRI, and others support closed source frameworks but all methods support the standard ABI that will allow correctly written OpenGL applications to run on Linux.