Changing the opengl viewport every time you draw is generally a poor practice. Setting the viewport is traditionally one of the most expensive open gl operations. The window will not resize anywhere near as often as the view will be redrawn. That is why it is usually better to reset the viewport only when the view actually has resized.

Views can be configured in Interface Builder or via code to resize automatically as the window changes size. The framework calls the view's setFrame: method as needed. The bounds are automatically recalculated when the frame changes, but that is not always what you want. I often want my bounds coordinates to stay the same even if the view changes size so that if the view is enlarges, the content is scaled to fill the new size.

None of this is magic or complex. Just read about the view hierarchy in the documentation. http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaViewsGuide/Introduction/chapter_1_section_1.html



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to