开发者

glutInit parameters in simple OSX example

I'm working with an example from this site on OSX and I have no troubles compiling it but I don't know how to test run it. The program looks like this:

void display()
{
}

int main(int argc, char **argv)
{
        glutInit(&argc, argv);
        glutDisplayFunc(display);
        glutMainLoop();
}

I don't know what the arguments should be for the program, which glutInit will use. Does anybody know what with which arguments I need to call me program to acually show a window?

Calling with no arguments orcourse causes this crash:

./hello 
2011-10-13 11:41:15.360 hello[2395:903] GLUT Fatal 开发者_如何学JAVAAPI Usage: main loop entered with no windows created.
Abort trap


You need to create a GLUT window before calling glutDisplayFunc or glutMainLoop

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜