• 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 Troubles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OpenGL Troubles


  • Subject: Re: OpenGL Troubles
  • From: David Spooner <email@hidden>
  • Date: Mon, 24 Feb 2003 09:36:48 -0700

On Monday, February 24, 2003, at 02:28 AM, email@hidden wrote:

But I get an "invalid drawable" message! I know that the current
context is the right one, and that it -update'd with the latest view


I think the view has to be associated with a window before you it can be
associated with an opengl context. I use NSView's -viewDidMoveToWindow
something like...

- (void) viewDidMoveToWindow
{
[_openGLContext setView:(window != nil ? self : nil)];
}

You'll need to implement -reshape if you don't subclass NSOpenGLView

- (void) reshape
{
[_openGLContext update];
}


In -lockFocus, I call
[_openGLContext makeCurrentContext];

Also, I would call NSOpenGLContext's -makeCurrentContext from -drawRect:
rather than overriding -lockFocus


dave
_______________________________________________
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: [Newbie] NSOutlineView and setFont: ?
  • Next by Date: Re: [Newbie] NSOutlineView and setFont: ?
  • Previous by thread: Re: OpenGL Troubles [solved]
  • Next by thread: Capturing key events
  • Index(es):
    • Date
    • Thread