On Fri, Apr 10, 2009 at 9:56 PM, Brian Bruinewoud <br...@darknova.com> wrote:
> Note that this thread is stopping on the line:
>
>        GLint e = glGetError();
>
> And that getFrameForTime looks like this:
>
> - (CVReturn)getFrameForTime:(const CVTimeStamp*)outputTime
> {
>    NSLog( @"getFrameForTime" );
>
>    if( !shouldRun ) return kCVReturnError;
>
>    redcomp = redcomp + 0.01;
>    NSLog( @"... red = %f", redcomp );
>
>    GLint e = glGetError();
>
>    if( !displayList )
>    {
>        NSLog( @"Create displayList" );
>    }
>    else
>    {
>        NSLog( @"Use existing displayList" );
>    }
>
>    return kCVReturnSuccess;
> }
>
> If I remove the glGetError() line, everything works (NSLog messages come
> spurting out at high speed).

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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to