Re: NSOpenGLView bounds vs. frame
Re: NSOpenGLView bounds vs. frame
- Subject: Re: NSOpenGLView bounds vs. frame
- From: Troy Stephens <email@hidden>
- Date: Mon, 1 Dec 2003 16:05:10 -0800
On Dec 1, 2003, at 12:44 AM, Mark Flider wrote:
Does the bounds method in NSOpenGLView actually do anything? From the
sample code I've seen, we have to supply our own "bounds" in the form
of viewports and various matrices anyway... does [bounds] just return
the frame, or is it undefined, or is there a way to take advantage of
it (since setBounds: does not raise an error)?
An NSView's "bounds" rectangle, and the coordinate transform that it
defines, has no effect on OpenGL drawing. Thus, as you surmise, it's
of little use in an NSOpenGLView (or any other view to which you attach
an NSOpenGLContext).
If you don't change the bounds of an NSOpenGLView, they will be equal
in size to the view's frame, with an origin of (0,0). The view will
remember a different bounds rectangle if you set one, but, again, this
doesn't really do anything for you. The standard OpenGL calls
glViewport(), glOrtho(), gluPerspective(), glScalef(), etc. are the way
to specify whatever transforms you want applied to your GL drawing.
Hope this helps clarify.
Troy Stephens
Cocoa frameworks, Apple
_______________________________________________
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.