开发者

glutInit parameters in simple OSX example

开发者 https://www.devze.com 2023-04-12 13:30 出处:网络
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:

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

精彩评论

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

关注公众号