Jump to content
  • Advertisement
Sign in to follow this  
luckyyyyyy

OpenGL Capture OpenGL window screen in Real-time ?

This topic is 2527 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello.

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 ?

Share this post


Link to post
Share on other sites
Advertisement
yea i am talking about glReadPixel

anyways the problem has been solved. the mistake was, I was capturing the image before the projection of texture. after disabling the texture, now i am able to capture the screens in the real-time.
Thanks

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!