glReadPixels reads mass value

when I use the following code:

GLfloat* buffer=NULL;
buffer= new GLfloat[widthheight3];
glReadPixels(0, 0, width, height, GL_RGB, GL_FLOAT, buffer );

I found buffer[0], buffer[1], buffer[2] gives mass value.(4.01e008 something).

what’s wrong with it? I used MFC windows for openGL display.


1)You have a valid GL context and it’s made current (insert wglMakeCurrent(blabla) to be sure)
2)You already did some drawing (eg at least one glClear)

that might be a driver bug. What gfx card do you use, maybe someone else can verify this?

Assumption 3)Your width/height aren’t out of bounds.

[This message has been edited by zeckensack (edited 06-16-2002).]

The code you supplied looks right (according to the specs). Maybe you need to call glReadBuffer.