Re: Problem running compositions offline...
Subject : Re: Problem running compositions offline...
From: Pierre-Olivier Latour <email@hidden >
Date: Thu, 22 Feb 2007 08:31:04 -0800
Delivered-to: email@hidden
Delivered-to: email@hidden
Try different combinations of attributes like only
kCGLPFARemotePBuffer and NSOpenGLPFAAccelerated.
On Feb 22, 2007, at 8:21 AM, Dominik Westner wrote:
Here is the code snippet:
- (id) initWithCompositionPath:(NSString*)path pixelsWide:(unsigned)
width pixelsHigh:(unsigned)height
{
NSOpenGLPixelFormatAttribute attributes[] = {
kCGLPFARemotePBuffer,
NSOpenGLPFAPixelBuffer,
NSOpenGLPFANoRecovery,
NSOpenGLPFAAccelerated,
NSOpenGLPFADepthSize, 24,
NSOpenGLPFASamples, 1,
(NSOpenGLPixelFormatAttribute) 0
};
NSOpenGLPixelFormat* format = [[[NSOpenGLPixelFormat alloc]
initWithAttributes:attributes] autorelease];
//Check parameters - Rendering at sizes smaller than 16x16 will
likely produce garbage
if(![path length] || (width < 16) || (height < 16)) {
[self release];
return nil;
}
if(self = [super init]) {
//Create the OpenGL pixel buffer to render into
_pixelBuffer = [[NSOpenGLPixelBuffer alloc]
initWithTextureTarget:GL_TEXTURE_RECTANGLE_EXT
textureInternalFormat:GL_RGBA textureMaxMipMapLevel:0
pixelsWide:width pixelsHigh:height];
if(_pixelBuffer == nil) {
NSLog(@"Cannot create OpenGL pixel buffer");
[self release];
return nil;
}
//Create the OpenGL context to render with (with color and depth
buffers)
_openGLContext = [[NSOpenGLContext alloc] initWithFormat:format
shareContext:nil];
if(_openGLContext == nil) {
NSLog(@"Cannot create OpenGL context");
[self release];
return nil;
}
....
Dominik
On 22.02.2007, at 17:15, Pierre-Olivier Latour wrote:
Hi Pierre-Olivier,
I am running as root and I added the RemotePBuffer attribute to
my Pixelformat.
If I have a monitor connected everything is running fine.
Then I unplug the monitor and reboot the machine. After that I get:
2007-02-22 10:02:56.823 ImageService[187] invalid pixel format
2007-02-22 10:02:56.823 ImageService[187] invalid context
2007-02-22 10:02:56.823 ImageService[187] Cannot create OpenGL
context
So the RemotePBuffer attribute didn't seem to help. It looks like
I have to find a way to make the hardware think there is a
monitor connected. Maybe this works:
What are the exact list of attributes you use when creating the
OpenGL context?
________________________________________________________
Pierre-Olivier Latour email@hidden
Quartz Composer Team Apple Computer, Inc.
________________________________________________________
Pierre-Olivier Latour email@hidden
Quartz Composer Team Apple Computer, Inc.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.