Re: Rendering OpenGL in timed loop (CoreVideo).
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