PDA

View Full Version : Accumulation Buffers doesn't exist



maleaume
08-26-2005, 04:18 AM
on ATI Graphics card (X800 and 9800) a simple code using accumulation buffer doesn't run.
but the same code on NVIDIA GC run perfectly..

an idea?

here the code

#include <GL/openglut.h>
#include <iostream>

using namespace std;

void display()
{
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

glClearColor(0,0,0,1);
glClear(GL_COLOR_BUFFER_BIT);
glViewport(0,0,600,600);
glOrtho(0,1,0,1,-1,1);

for(int i=0;i<10;i++)
{
glClear(GL_COLOR_BUFFER_BIT);
glTranslatef(0.05,0.05,0.05);
glBegin(GL_QUADS);

glColor3f(0.9,0.1,0.3);
glVertex3f(0.,0.,0.);
glVertex3f(0.,0.5,0.);
glVertex3f(0.5,0.5,0.);
glVertex3f(0.5,0.,0.);

glEnd();
glAccum(GL_ACCUM,0.1);
}

glAccum(GL_RETURN,1.0);
cout << (glGetError()!=GL_NO_ERROR);

glutSwapBuffers();
}

int main(int argc,char **argv)
{
glutInit(&amp;argc,argv);

glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_ACCUM);
glutInitWindowPosition(50,50);
glutInitWindowSize(600,600);
int window=glutCreateWindow("gni");
glClearAccum(0,0,0,1);
glClear(GL_ACCUM_BUFFER_BIT);
glutDisplayFunc(display);
glutMainLoop();

return 0;
}

Hlz
08-26-2005, 07:44 AM
What do you mean by "doesn't run"?

What are the accum component bit depths?
(Call glGetIntegerv with the GL_ACCUM_*_BITS to find out.)

There are always working examples to test with.
http://www.sgi.com/products/software/opengl/examples/
http://www.sgi.com/products/software/opengl/examples/redbook/source/accpersp.c