Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with GLUT application



the trace of functions called is like:

glutInit(&argc, argv)
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH)
glutInitWindowSize
glutInitWindowPos
glutCreateWindow

glutDisplayFunc
glutReshapeFunc

... after this the first "real" gl functions are called:

glPixelStorei(GL_PACK_ALIGNMENT,1)
glDepthFunc(GL_LESS)

 When running the program it crashes at the first gl-call.
(glPixelStorei, or when commented out glPixelStorei at glDepthFunc....)

It's not legal to make GL calls before you have an OpenGL context. On Linux and Windows they'll silently fail, on the Mac you'll crash.


In GLUT's case, that means that you must call glutCreateWindow or glutEnterGameMode before making any GL calls.

-Keith

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden
References: 
 >Problems with GLUT application (From: Hannes Krueger <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.