• 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: OpenGL Prog Guide for OSX - override initWithFrame
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OpenGL Prog Guide for OSX - override initWithFrame


  • Subject: Re: OpenGL Prog Guide for OSX - override initWithFrame
  • From: Richard Somers <email@hidden>
  • Date: Mon, 23 Mar 2009 12:33:54 -0600

On Mar 23, 2009, at 2:51AM, Ian Jackson wrote:

I have an OpenGL view as a subclass of NSView. Trying to follow the OpenGL Programming Guide for Mac OS X, I created all the methods described in the "Drawing to a Cocoa View" section. The thing I don't quite understand is that it says to override the initWithFrame: method of the NSView class, but the sample code describes a initWIthFrame:pixelFormat: method. I initially more or less cobbled all the sample code together in my custom OpenGL view, so that the initWithFrame:pixelFormat: method was included as it is in the guide. However, there is no initWithFrame:pixelFormat method in NSView, so the method doesn't get called.
I now override the initWIthFrame method, and include:


_pixelFormat = [[[self class] defaultPixelFormat] retain];

but, I'd like to know what the document actually intends.


The method -initWithFrame:pixelFormat: is found in NSOpenGLView not NSView. The inheritance hierarchy is NSOpenGLView : NSView : NSResponder : NSObject.

Richard

_______________________________________________

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


  • Prev by Date: Re: How to implement quick-playing and slow-playing of sound file?
  • Next by Date: Re: NSLevelIndicator Bindings Crash
  • Previous by thread: Re: Custom windows -- just curious
  • Next by thread: Key path for values in "Shared User Defaults"?
  • Index(es):
    • Date
    • Thread