Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Cocoa, OpenGL, and Display Lists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa, OpenGL, and Display Lists



I'm attempting to setup a display list, and then call it in my
drawRect function whenever my alarm fires. Now, drawRect is being
called per alarm fire as it should, and my glCallList function is
inside of drawRect, but for some reason the display list is only being
called twice, even though drawRect is being called every 0.004
seconds.

Code for initGL:

theSun = glGenLists(1);
glNewList( theSun, GL_COMPILE );
sun->Draw( light_position );
glEndList();

Code for drawRect:

glCallList( theSun );

I believe you need to flush the command stream. At the end of
-drawRect, call -flushBuffer on the context, or just glFlush().

gl seems to be aggregating the calls to glCallList and basically
throwing away what it thinks are duplicates, maybe? I don't know for
sure so you may want to check with the macopengl list.

Display lists are post processed after they are created, but not data is thrown away.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Cocoa, OpenGL, and Display Lists (From: Jesse Thompson <email@hidden>)
 >Re: Cocoa, OpenGL, and Display Lists (From: Brent Gulanowski <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.