Re: NSOpenGLView inside NSScrollView query
Re: NSOpenGLView inside NSScrollView query
- Subject: Re: NSOpenGLView inside NSScrollView query
- From: MoreMasters <email@hidden>
- Date: Thu, 9 May 2002 01:12:41 +0100
The GL coordinate system is actually that of the _view_ in which it
lives (I thought ;), so I figured that putting it inside a
scrollview/clipview would adjust everything automagically when scrolled.
Anyway... visibleRect... I'd forgotten about that one! Yeah, perfect, it
works a treat!
Changing glViewport() gluPerspective() (which I used here instead of
glOrtho) in -drawRect and -reshape (-(void)reshape is called whenever
the view scrolls) does the trick.
Thanks a million.
On Thursday, May 9, 2002, at 12:54 AM, Erik M. Buck wrote:
I have gotten scrolling with NSOpenGLView inside a scroll view to
work. The
GL coordinate system is the windows coordinate system by default. The
GL
coordinate system does not know about the things transformations scroll
view
is making. Early in your drawRect: method for the GL view, use
glOrtho() to
set the coordinate system equal to the rectangle returned from the GL
view's -visibleRect method. Then make any other coordinate system
transformations from that. This also automatically handles zooming...
----- Original Message -----
From: "MoreMasters" <email@hidden>
To: <email@hidden>; "OpenGl List" <mac-
email@hidden>;
"Omni OSX-Dev" <email@hidden>
Sent: Wednesday, May 08, 2002 5:12 PM
Subject: NSOpenGLView inside NSScrollView query
Is it just me that can't get a subclass of NSOpenGLView to scroll when
grouped inside an NSScrollView?
Setting the size of the scrollview's content (MyOpenGLView) to be
bigger
than it's own correctly enables the scrollbars, but the GL view refuses
to scroll.
If one sizes the GLView to be less wide than the scrollview, but
taller... so that the vertical scrollbar is enabled... one can see the
aqua-theme horizontal pinstripes in the gap between the GLView and the
right edge of the scrollview. Moving the vertical scrollbar, one can
see
the aqua-theme pinstripes _are_ scrolling correctly, but OpenGL just
blits into it's own space and doesn't budge.
Has anybody else observed this behaviour?
Thanks.
_______________________________________________
MacOSX-dev mailing list
email@hidden
http://www.omnigroup.com/mailman/listinfo/macosx-dev
_______________________________________________
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.
_______________________________________________
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.