Animated teapot

GLUT Object Oriented Framework on Github

In 2009 I took a Computer Animation course at @RIT I created an object-oriented C++ wrapper for GLUT. The idea was to create a set of classes that could be reused for each of the separate project submissions. The main class wraps around the GLUT C-style functions and provides a class that can be inherited from, to provide application specific functionality.

The idea was to make the boiler plate code disappear and make it easier for novice programmers to get an animated graphics window in as few lines as possible. Only four lines of code are needed to get the window running at 60 frames per second. You can subclass the framework and implement your own OpenGL animation or game project.

Edit (8/22/10): You don’t need to use pointers, I’ve updated the code example with working code.

// main.cpp
#include "GlutFramework.h"
using namespace glutFramework;
int main(int argc, char *argv[]) {
	GlutFramework framework;
	framework.startFramework(argc, argv);
        return 0;

[ad#Large Box]

The code uses a cross-platform (Windows/Mac tested) timer to create a constant frame-rate, which is necessary for animation projects. It’s under the MIT License, so feel free to use it as you see fit.

An Xcode 3.1 and Visual Studio 2010 project is hosted on github to support Mac and Windows. There is no setup on the Mac, but Windows users will need to configure GLUT. I plan on posted tutorials on how to get setup on both platforms. For now, look at the resources section below.

Animated teapot


[ad#Large Box]

Published by

Paul Solt

I'm a computer programmer, frisbee fanatic, and a cook. Currently I'm at RIT studying computer science.

6 thoughts on “GLUT Object Oriented Framework on Github”

  1. Amazing work :) I was about to do just about the same thing and I stumbled upon your work when I googled for the issues with setting up GLUT’s callback functions that I had put inside my graphics class. So instead of building my own OOP design around GLUT and OpenGL I can use yours right away =)


  2. Thank you! After struggling for hours on this problem, I finally stumbled upon your code. Quite helpful to get mine working. I had significant trouble with specifying the callback functions for glut, without actually writing them in the class.


Leave a Reply

Your email address will not be published. Required fields are marked *