Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems with creating a float pbuffer with CGL/AGL



Hi,
I have been trying to get a float pbuffer working on my powerbook (radeon 9600). I can create a pbuffer in either CGL or AGL without any problems, but they seem to be clamped between 0 and 1. The values are still floats (ie. they aren't fractions of 255), but clamped.
The simplest test was to do a glClear with negative color values or values >1. In linux i get proper values from a readback, but in OSX they are clamped.

Is it possible to get non-clamped values from a pbuffer in OSX?

Here's the code i use to create the buffers:

CGLPBufferObj _hPBuffer;
CGLContextObj _hPBContext;
_hPBscreen;

activatePBuffer(){
CGLSetCurrentContext(_hPBContext);
CGLSetPBuffer(_hPBContext, _hPBuffer,
, , _hPBscreen);
}

createPBuffer( width, height){
CGLPixelFormatAttribute attribs[
];
GLint ind =
;
ATTR_ADD(kCGLPFAAllRenderers);
ATTR_ADD(kCGLPFAColorFloat);
ATTR_ADDV(kCGLPFAColorSize,
);
ATTR_ADD(kCGLPFAAccelerated);
ATTR_ADD(kCGLPFANoRecovery);
ATTR_ADD(kCGLPFAPBuffer);
ATTR_ADD(AGL_NONE);

nScreens=;
CGLPixelFormatObj pix;
CGLChoosePixelFormat( attribs, &pix, &nScreens );
CGLCreateContext( pix,
, &_hPBContext);
CGLError err = CGLCreatePBuffer(width, height, GL_TEXTURE_RECTANGLE_ARB, GL_RGBA,
, &_hPBuffer);
printf(
"Failed to create pbuffer? %i\n", err);
CGLGetVirtualScreen(_hPBContext, &_hPBscreen);
}

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/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.