I am trying to Render a Composition in CAOpenGLLayer using QCRenderer.


This is how i create QCRenderer

- (CGLContextObj)copyCGLContextForPixelFormat: (CGLPixelFormatObj)pixelFormat
{
CGLContextObj object = [super copyCGLContextForPixelFormat:pixelFormat]; NSString *path = [[NSBundle mainBundle] pathForResource:@"Blob" ofType:@"qtz"];
        QCComposition *aComposition = [QCComposition compositionWithFile:path];
CGColorSpaceRef colorRef = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); qcRenderer = [[QCRenderer alloc] initWithCGLContext:object pixelFormat:pixelFormat colorSpace:colorRef composition:aComposition];
        return object;
}


And this is how i display it...

- (BOOL)canDrawInCGLContext:(CGLContextObj)glContext pixelFormat: (CGLPixelFormatObj)pixelFormat forLayerTime: (CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp
{
        CGLSetCurrentContext(glContext);
        _startTime = _startTime + (1.0f / 25.0f);
BOOL success = [qcRenderer renderAtTime:_startTime arguments: [NSDictionary dictionary]];
        if (texture)
                CVOpenGLBufferRelease(texture);
        texture = [qcRenderer createSnapshotImageOfType:@"CVOpenGLBuffer"];
        if (success) {
                if (texture)
                        return YES;
        }
        return NO;
}

then i display the texture in drawInCGLContext method.

But nothing get displays on the View.

I have debugged the Application and found out that createSnapshotImageOfType: returns NULL. but renderAtTime: return true. Is this the Bug or i am going some where wrong.

Thanks!
Anshul
_______________________________________________

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