Sign in to follow this  
Clapfoot

OpenGL Error using glAccum

Recommended Posts

I get GL_INVALID_OPERATION from glAccum. The call is not made between begin and end. Is there any kind of special initialization that is needed to use the accumulation buffer? Is glAcucum a generally supported feature by most OpenGL implementations? I have a Radeon 9800 pro so i'm assuming it should be supported on my card. Anyone know whats going on here? Thanks a lot!

Share this post


Link to post
Share on other sites
Alot of cards it's infact only supported in software, however as I recall the 9500 and up and the GF6 (maybe even GFFX) support it in hardware.

However to use it you need to request an accumlation buffer as part of your pixel format; have you done that?

Share this post


Link to post
Share on other sites
No, I did not do that. Is this all I have to add to my pixel format descriptor?

pfd.cAccumBits = 24;
pfd.cAccumRedBits = 8;
pfd.cAccumGreenBits = 8;
pfd.cAccumBlueBits = 8;
pfd.cAccumAlphaBits = 0;

I'm not getting the error anymore, but nothing shows up on the screen when I do:

glReadBuffer(GL_BACK);
glDrawBuffer(GL_BACK);
glClear(GL_ACCUM_BUFFER_BIT);
glColor3f(1.0, 0.0, 0.0);
DrawCube();
glAccum(GL_ACCUM, 0.5);
glColor3f(0.0, 1.0, 0.0);
DrawCube();
glAccum(GL_ACCUM, 0.5);
glAccum(GL_RETURN, 1.0);

Things show up fine when I don't return the accumulation buffer (when I comment out glAccum(GL_RETURN, 1.0)).

Thanks again!

Edit: I think the accumulation buffer is drawing fine (as I get a grey screen if I do glAccum(GL_RETURN, 0.5)), but I think the scene isn't drawing to the back buffer correctly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this