Using an NSOpenGLVIew to play a Quartz composition with QCRenderer
Using an NSOpenGLVIew to play a Quartz composition with QCRenderer
- Subject: Using an NSOpenGLVIew to play a Quartz composition with QCRenderer
- From: Jonathan Selander <email@hidden>
- Date: Thu, 15 Jan 2009 10:35:04 +0100
Hi,
I want to be able to use antialiasing with my qtz as well as being
able to record frames, so I'm looking at ways to load the composition
with a custom opengl context. Ive looked at the QCTV example a bit,
and tried to make the first example on http://developer.apple.com/documentation/GraphicsImaging/Reference/QuartzFramework/Classes/QCRenderer_Class/Reference/Reference.html
to work.
I basically copy/pasted the code and added an NSOpenGLView to my
interface and connected it to a variable in my code, but when it's
supposed to render, the opengl view stays blank. This is the code i use:
- (void) awakeFromNib
{
NSOpenGLContext* context = [renderView openGLContext];
NSOpenGLPixelFormat* format = [renderView pixelFormat];
NSString* path = [[NSBundle mainBundle]
pathForResource:@"GreenScreen" ofType:@"qtz"];
QCRenderer* myRenderer;
// Create a Quartz Composer renderer.
myRenderer = [[QCRenderer alloc] initWithOpenGLContext:context
pixelFormat:format
file:path];
// Render the first 10 seconds of the composition with steps of 1/25s.
for (double t = 0.0; t <= 10.0; t += 1.0/25.0) {
[myRenderer renderAtTime:t arguments:nil];
[context flushBuffer]; //Required on double-buffered contexts
}
// Clean up
[myRenderer release];
}
_______________________________________________
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