Useful Code

All Code on this page is BSD-license, unless otherwise stated.

This code produces a messagebox containing an OpenGL error inside a message box

I use this for debugging purposes only, not for my main error detection from within my programs. It's very easy to 'drop' into code, but it creates a horrible mess for a user.
(requires < window.h >)

GLenum errorCode;

  if(errorCode = glGetError()!= GL_NO_ERROR)
		::MessageBox(NULL, (char *)gluErrorString(errorCode),
		  "OpenGL Error",MB_ICONERROR | MB_OK);

Simple GLUT framework

Right click and save as...

\\\\/\/\ Screaming Statue Software ™ y2k8 All Rights Reserved /\/\\\\\