I am working on an OpenGL project in C using Xcode 3.2.6. It is a tutorial program and yet I am having problems with it. When I double-click Project.app, it opens for a quarter of a second then closes. The source is:

#import <Cocoa/Cocoa.h>
#include <GLUT/GLUT.h>

int main(int argc, char *argv[])
{
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_RGBA);
	glutInitWindowSize(1000, 1000);
	glutInitWindowPosition(100, 100);
	glutCreateWindow("OpenGL Test");
	glutMainLoop();
}

what am I doing wrong? thanks in advance.

You don't have a display function or an idle function. Not 100% sure if this is the problem since I haven't used glut in a while but from what I remember you need them.

You don't have a display function or an idle function. Not 100% sure if this is the problem since I haven't used glut in a while but from what I remember you need them.

thank you; will try!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.