… Er …
I’m trying to do some real-time CSG and I need to check out my depth buffer (visually) to be sure I’m on the right track; so here’s what I did:
First I declare an array to hold the anticipated depth buffer information:
GLfloat *Depth_Data = (GLfloat *) malloc(sizeof(GLfloat) * width * height);
Then I disable writes to the color buffer,
Next I draw a sphere (to the depth buffer)
I Subsequently read data from the depth buffer to the array Depth_Data and enable writes to the color buffer:
glReadPixels(0, 0, width, height, GL_DEPTH_COMPONENT, GL_FLOAT, Depth_Data);
Lastly I (attempt to) Draw the depth information to the color buffer as follows:
glDrawPixels(width, height, GL_LUMINANCE, GL_FLOAT, Depth_Data);
… but I get nothing?!
So then what am I doing wrong?
I made the check:
printf("OpenGL version: %s
… and got “1.3.0” which is kidda cool except that the call
generates an error … (something like) undeclared identifier/variable …
Methinks perhaps my header file is “pointing” to the wrong object files or something. I only recently had my graphics card upgraded to a GeForce 3 Ti200 from a RIVA or something …
H E L P !!!