• 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: Resizing a view to match the main NSWindow size?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Resizing a view to match the main NSWindow size?


  • Subject: Re: Resizing a view to match the main NSWindow size?
  • From: Graham Reitz <email@hidden>
  • Date: Sun, 25 May 2008 23:19:23 -0500

Thanks Eric. I have a CustomOpenGLView example that I downloaded from the apple development site (http://developer.apple.com/samplecode/Custom_Cocoa_OpenGL/listing5.html ).

Hopefully that has what I am looking for.

Use NSOpenGLView. It's whole reason to exist is to simplify setup and use of OpenGL in a Cocoa application. Why on earth would you assume you don't want to use NSOpenGLView ?

For Knowledge and a deeper understanding of how this works. That's usually a good reason and lauded in some circles.


I really don't mind doing it the 'painful' way (according to some folks). I've been doing it that way for over 15 years in the c++ world.

I have not done any OpenGL programming and very little gui development and just started obj-c programming this weekend.

-graham


On May 25, 2008, at 11:02 PM, Erik Buck wrote:

Use NSOpenGLView. It's whole reason to exist is to simplify setup and use of OpenGL in a Cocoa application. Why on earth would you assume you don't want to use NSOpenGLView ?

You see garbage after resizing the window because openGL has a fixed size frame buffer at the time the context is created. When the window is resized, the frame buffer isn't automatically increased so it doesn't contain any data in the newly revealed area of the window. One of the advantages of NSOpenGLView is that it handles the frame buffer resize.

If you handle this yourself, you will have to replace or update the opengl context. Apple provides an example of doing it the hard way.
_______________________________________________

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


References: 
 >Resizing a view to match the main NSWindow size? (From: Graham Reitz <email@hidden>)
 >Re: Resizing a view to match the main NSWindow size? (From: Nathan Kinsinger <email@hidden>)

  • Prev by Date: Re: Scaling view to fill printed page
  • Next by Date: Cocoa UI In Carbon App Issues.
  • Previous by thread: Re: Resizing a view to match the main NSWindow size?
  • Next by thread: Re: Resizing a view to match the main NSWindow size?
  • Index(es):
    • Date
    • Thread