Are you sure you're not changing anything? Every time (as long as I can remember) I had a blank screen was my fault.
Check your "reshape" or "resize' function callback and make sure you use a proper gluLookAt in the beginning of the "Display" function. Since the pre-built program is running ok, chances are you're messing something up.
Try starting with a simple thing as:
Code:
#include <GL/glut.h>
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
glRectf(-0.5, -0.5, 0.5, 0.5);
glutSwapBuffers();
}
int main(int argc, char *argv[])
{
glutInitDisplayMode(GLUT_DOUBLE);
glutInitWindowPosition(100, 100);
glutInitWindowSize(100, 100);
glutInit(&argc, argv);
glutCreateWindow("Test");
glutDisplayFunc(display);
glutMainLoop();
}
Then compile with g++ <filename.cpp> -lglut
This should produce a small square in the middle of a small window.
If this doesn't work then I don't know what's wrong.