I have spent too much time on this topic but got failed..
actually I just want to capture the screen shoot of OpenGL window in real time rendering. I mean to say in Display() function of OpenGL.
I tried with glReadPixels but I every time got the full black screen.
for example:
if(SKIP_FRAMES == 40)
{
CaptureScreenShoot(CapImg1, 512, 512);
glBindTexture(GL_TEXTURE_2D, BMPimageTexture[0]);
Sleep(1000);
}
if(SKIP_FRAMES == 60)
{
CaptureScreenShoot(CapImg2, 512, 512);
glBindTexture(GL_TEXTURE_2D, BMPimageTexture[1]);
Sleep(1000);
}
so on.......................
this method is not working... I got full black screen. But when I capture the screen using manual method for example by pressing key in Keyboard(unsigned char key, int x, int y) function... it works,,
but in Display() function it does not work.. I mean in real-time. why is it so ? what should i do for capturing the screen in real-time. already hanging around many libraries but couldn't find any ?