Re: NSOpenGLView in NSScrollView problem
Re: NSOpenGLView in NSScrollView problem
- Subject: Re: NSOpenGLView in NSScrollView problem
- From: David Spooner <email@hidden>
- Date: Thu, 11 Oct 2007 06:26:08 -0600
I had previously implemented a thumbnail of opengl views, which looks
similar to what you're doing. The problem is likely in how the opengl
viewport is specified in your view class. It's been a while since
I've looked at this and I'm not sure I've ever really understood the
rationale, but I know the code I use is (effectively)
NSRect r = [view visibleRect];
vp[0] = 0;
vp[1] = 0;
vp[2] = (GLint)NSWidth(r);
vp[3] = (GLint)NSHeight(r);
Rather than the more intuitive
vp[0] = (GLint)NSMinX(r);
vp[1] = (GLint)NSMinY(r);
dave
On 10-Oct-07, at 10:45 PM, Half Activist wrote:
Hi everyone,
I put several NSOpenGLView subclasses instances in a NSScrollView.
The problem is when I scroll down, the NSOpenGLView that is partly
visible,
and we only see the top of it, I expect that I would see only
the top of associated opengl viewport, but it doesn't.
What is displayed is the bottom of it, it does not clip correctly.
It' kind of hard to explain so I attached a picture to depict the
problem.
http://img210.imageshack.us/img210/6845/sketchts4.png
OR
http://img210.imageshack.us/my.php?image=sketchts4.png
Regards.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden