Hey guys,
i have a problem with writing both RGBA and Depth info to the framebuffer.
i successfully filled an array with the Color info and another with the depth info using
glreadpixels(0,0,width,height,GL_RGBA,GL_UNSIGNED_INT_8_8_8_8,&somebuffer);
glreadpixels(0,0,width,height,GL_DEPTH_COMPONENT,GL_FLOAT,&someotherbuffer);
what i want to do is write them to a cleared framebuffer. so i used gldrawpixels like this:
for the color:
glWindowPos2i(0,0);
gldrawpixels(width,height,GL_RGBA,GL_UNSIGNED_INT_8_8_8_8,&somebuffer);
and for the depth:
glWindowPos2i(0,0);
gldrawpixels(width,height,GL_DEPTH_COMPONENT,GL_FLOAT,&someotherbuffer);
when i call gldrawpixels for the color only it works perfectly fine, but with the two of them the image gets all green … is there something i’m doing wrong…?
i avoided glrasterpos because i didn’t want anything to do with the current transformation. i just wanted to clear the buffer and just fill it with the data i already saved.
thanks in advance.