Programming - Games - OpenGL and C++

This tutorial was written for me by Imran Khan (,
Copyright (c) 2004 is owned by Martin Baker

Introduction to OpenGL :

OpenGL is a library of functions for fast 3D rendering.It's a hardware and system independent interface. An OpenGL application will work on every platform, as long as there is an installed implementation.Some of the OpenGL Features are as follows :

  • Varying graphics capabilities without compromising the graphics performance of the underlying hardware and without
    sacrificing control over the hardware’s operation.
  • A natural interface that allows a programmer to describe rendering operations tersely.
  • OpenGL is Flexible . It can accommodate extensions so that newgraphics operations can be added without disrupting the original interface.
  • Its simple, direct interface to the fundamental operations of 3D graphics rendering.
  • Provides basic graphics primitives to draw Points, Lines, Traingles etc

    GL_POINTS - dots
    GL_LINES – lines, in pairs
    GL_LINE_STRIP – polylines
    GL_LINE_LOOP – closed loop
    GL_TRIANGLES – triangles, three vertices
    GL_QUADS – quad, four vertices
    GL_POLYGON – convex filled polygon

  • Provides Camera Effect.
  • Provides Lightning effect.
  • Easy Interaction with the Hardware.
  • For the sake of Hardware independecy, OpenGL provides its own datatypes :
  • OpenGL datatypes :

    C++ OpenGL
    Unsigned int
    Unsigned short
    Unsigned char
    Signed char


  • Opengl Command format is very easy. You can understand it easily from the figure below :

In this Diagram we explained that if we have a command " glVertext2i(...) " then wat will be its format.


I hope its enough theory. Now lets start with the Tutorial.


next: first program

metadata block
see also:
Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover OpenGL Game Programming - Assumes a windows environment and covers both OpenGL and DirectX. Takes you through most of the theory that you need.

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to this site, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

cover Visual C++ .NET for Microsoft Platforms only.

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2015 Martin John Baker - All rights reserved - privacy policy.