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

OpenGL Troubles


  • Subject: OpenGL Troubles
  • From: Dietrich Epp <email@hidden>
  • Date: Mon, 24 Feb 2003 00:56:46 -0800

I am trying to use OpenGL in Cocoa, but can't use NSOpenGLView because my view is sometimes an OpenGL view and sometimes not. So I gave it an _openGLContext ivar, and initialized it the following way:

...
pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes];
if (pixelFormat) {
_openGLContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil];
if (_openGLContext) {
[_openGLContext setView:self];
...

In -lockFocus, I call
[_openGLContext makeCurrentContext];

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 information goodness. Am I missing anything? Has anyone else used NSOpenGLContext without an NSOpenGLView (I did see it in the Omni game source, but that was no help).
_______________________________________________
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.
  • Follow-Ups:
    • Re: OpenGL Troubles [solved]
      • From: Dietrich Epp <email@hidden>
    • Re: OpenGL Troubles
      • From: Keith Bauer <email@hidden>
  • Prev by Date: Re: vtables in objc++
  • Next by Date: Re: Cocoa approachable by non-programmers ?
  • Previous by thread: Table View with no selection
  • Next by thread: Re: OpenGL Troubles
  • Index(es):
    • Date
    • Thread