I'm trying to load a depthbuffer from a file and copy it to the depth buffer instead of clearing it every frame.
anyway, i'm a bit new to opengl, so i just tried to load my texture like this:
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, DepthData);
and i try to draw it like this:
glBindTexture(GL_TEXTURE_2D, DepthTexture);
glColorMask(FALSE, FALSE, FALSE, FALSE);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f); glVertex2f(0.0f, 0.0f);
glTexCoord2f(0.0f, 1.0f); glVertex2f(0.0f, 1.0f);
glTexCoord2f(1.0f, 1.0f); glVertex2f(1.0f, 1.0f);
glTexCoord2f(1.0f, 0.0f); glVertex2f(1.0f, 0.0f);
glEnd();
i tried to load a depthbuffer with every value set to 1.0, and everything i tried to draw got hidden, while it shouldn't.
what should i do? btw, i do NOT want to use glDrawPixels