Jump to content
  • Advertisement
Sign in to follow this  
Ominae392

OpenGL Faking a screenshot

This topic is 4860 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

Here's the problem: I want to write a very basic console application that barely uses any OpenGL. Nothing will be displayed, I only want to use OpenGL for it's math. I don't have time to write lighting calculations, a projection matrix scheme, and anything else OpenGL might throw into the mix. The ultimate goal of my program would be load a 3D mesh, apply lighting to get a shaded mesh, and then export a 2D image of that shaded mesh. I know how to do a basic glReadPixels() dump to a bitmap but I can't think of how to do this without windows coordinates. Is there a way to dump only what would be encompassed by the rendering context? I'm still keeping functions for sizing the window and setting everything up properly, in fact right now the only line i've removed is SwapBuffers(). Maybe i'm talking non-sense... maybe I need to get off my ass and write out the math but I figured I could try this first.

Share this post


Link to post
Share on other sites
Advertisement
Why would you need to know the window coords? glReadPixels uses the pixels relative to the window, not using the entire screens. If you don't want to use a window (as it sounds like you wish not to display anything), look into pBuffers. They will allow you to render to a buffer thats not setup for a window.

Share this post


Link to post
Share on other sites
You can render to something other than a window in OpenGL. Bitmaps, printers, whatever. There's a whole imaging subset (that nobody uses) that might have some useful stuff. But that's all I can recall, since I don't use it either. Look it up.

Or you can just render to a hidden window if you want.

Share this post


Link to post
Share on other sites
Alright thanks. When I say "windows coords" I just mean the coords of the rendering context with relation to my window. I suck with terminology so I call crap whatever seems handy, sorry. Now that I know I can render to something other than a window i'll check it out.

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!