• 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: Rendering OpenGL in timed loop (CoreVideo).
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rendering OpenGL in timed loop (CoreVideo).


  • Subject: Re: Rendering OpenGL in timed loop (CoreVideo).
  • From: Brian Bruinewoud <email@hidden>
  • Date: Sat, 11 Apr 2009 16:20:36 +1000

Ok. That "works". I was coming from an NSOpenGLView example where the view sets the context before the drawRect is sent.

Any it, doesn't crash/hang/stop now, but it doesn't draw anything, either... :(

Oh well.

On 11/04/2009, at 14:18 , Michael Ash wrote:

You can't just go and start calling OpenGL functions like that. OpenGL
depends on having a context set up, and each call is executed in that
context. This CoreVideo callback does nothing like that. All it does
is notify you each time the monitor is done refreshing. It's up to you
to set up your own GL context before you start making calls to GL
functions. I'm not 100% sure about how you do this, but I believe it
would be something like this:

NSOpenGLContext *savedCtx = [NSOpenGLContext currentContext];
[[self openGLContext] makeCurrentContext];
// your GL code here
[savedCtx makeCurrentContext];

Mike
_______________________________________________

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


  • Follow-Ups:
    • Re: Rendering OpenGL in timed loop (CoreVideo).
      • From: Michael Ash <email@hidden>
References: 
 >Rendering OpenGL in timed loop (CoreVideo). (From: Brian Bruinewoud <email@hidden>)
 >Re: Rendering OpenGL in timed loop (CoreVideo). (From: Greg Parker <email@hidden>)
 >Re: Rendering OpenGL in timed loop (CoreVideo). (From: Brian Bruinewoud <email@hidden>)
 >Re: Rendering OpenGL in timed loop (CoreVideo). (From: Brian Bruinewoud <email@hidden>)
 >Re: Rendering OpenGL in timed loop (CoreVideo). (From: Michael Ash <email@hidden>)

  • Prev by Date: Re: Rendering OpenGL in timed loop (CoreVideo).
  • Next by Date: Re: Undocumented flags in LSCopyItemInfoForRef
  • Previous by thread: Re: Rendering OpenGL in timed loop (CoreVideo).
  • Next by thread: Re: Rendering OpenGL in timed loop (CoreVideo).
  • Index(es):
    • Date
    • Thread