So I have to learn GLUT for a project and I and trying to follow a tutorial. the problem is, when I run the code found in the tutorial, nothing happens? Why is this? Here is the code I am trying to get to work:
It compiles without any errors or warnings but when it runs nothing happens. The tutorial says that a black window should pop up, but no window here?? Does anybody have any suggestions? I am running Xcode 3.1 on Mac OS 10.5.2 and the tutorial is here:
http://blog.onesadcookie.com/2007/12/xcodeglut-tutorial.html
I have also tried to compile and run code from other sources but I get the same result. Any help is appreciated. Thanks.
Code:
#include <stdlib.h>
#include <GLUT/glut.h>
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glutSwapBuffers();
}
void reshape(int width, int height)
{
glViewport(0, 0, width, height);
}
void idle(void)
{
glutPostRedisplay();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);
glutInitWindowSize(640, 480);
glutCreateWindow("GLUT Program");
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutIdleFunc(idle);
glutMainLoop();
return EXIT_SUCCESS;
}
It compiles without any errors or warnings but when it runs nothing happens. The tutorial says that a black window should pop up, but no window here?? Does anybody have any suggestions? I am running Xcode 3.1 on Mac OS 10.5.2 and the tutorial is here:
http://blog.onesadcookie.com/2007/12/xcodeglut-tutorial.html
I have also tried to compile and run code from other sources but I get the same result. Any help is appreciated. Thanks.