• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: cocoa-dev digest, Vol 2 #816 - 15 msgs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cocoa-dev digest, Vol 2 #816 - 15 msgs


  • Subject: Re: cocoa-dev digest, Vol 2 #816 - 15 msgs
  • From: Robert Miller <email@hidden>
  • Date: Fri, 21 Jun 2002 11:12:36 -0400

Fellow Cocoa Developers,

I figured this one out based on a 'clue' I found on the OpenGL BB. To obtain a 'sticky' effect for an NSOpenGLView I did this..

GLsizei w = (GLsizei)NSWidth([self frame]);
GLsizei h = (GLsizei)NSWidth([self frame]);
GLsizei x = (GLsizei)(NSMinX([self visibleRect]));
GLsizei y = (GLsizei)(NSMinY([self visibleRect]));

glViewport(-x, -y, w, h);

for more than one NSOpenGLView this should go at the top of your drawRect method. for a single view it can go into the reshape method.

Regards,
Bob M.

On Friday, June 21, 2002, at 11:05 AM, email@hidden wrote:

Message: 11
Date: Fri, 21 Jun 2002 09:40:32 -0400
Subject: NSOpenGLView weird scrolling behavior ?
From: Robert Miller <email@hidden>
To: Cocoa Development <email@hidden>

Hello,

I hope someone can help. I have one or more NSOpenGLView(s) as
subviews of another custom view which is inside an NSScrollView. The
opengl views are of varying origins and sizes inside their superview. If
I take a simple example and say draw a cube all works fine. The problem
is when resizing and or scrolling begins. If I scroll right horizontally
for example the position of the cube scrolls along properly in the
glViewPort what's weird is the moment that the left edge of the
NSOpenGLView begins to scroll out of view (left edge of window) the cube
stops scrolling as if the background is moving and the cube is remaining
stationery such that If i continue to scroll the cube will end up at the
rightmost position in the NSOpenGLView. I've played around with the
resize callback and also redefining the coordinates of the glViewPort at
the beginning of my drawRect: method and that does seem to have some
effect naturally. The question is what coordinate system do I need to
convert to in order to get the cube to scroll properly along with the
NSOpenGLView as if it is 'sticking' to the view ? Is there an example of
this somewhere ? Any help is as always greatly appreciated.

Thanks in advance,
Regards,
Bob M.
_______________________________________________
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.

  • Prev by Date: My newbie question..
  • Next by Date: Re: Outputting an unsigned long long
  • Previous by thread: Re: calling a shell script from an objective C application
  • Next by thread: Help with Crash Log Analysis
  • Index(es):
    • Date
    • Thread