View Full Version : OpenGL Desktop Texture

05-08-2003, 05:50 AM
How can i get the desktop(screenshot) image as a texture in my openGL program ? I'm using VC++ / MFC


05-08-2003, 07:07 AM
I suspect you might need to create a full-screen (single-buffer) window, but don't clear it. Then just do a glReadPixels. That should grab everything for you.

05-08-2003, 07:54 AM
I thought i could use GetDesktop(or something like that)
to get the handle and the get a HBITMAP... i saw this on codeguru.com

i tried it, but it crashed http://www.opengl.org/discussion_boards/ubb/redface.gifP when i called the texture creation routines...

05-08-2003, 09:20 AM
Try looking at http://msdn.microsoft.com and looking up knowledge article Q97193 entitled WINCAP Captures Screens Using DIB API. It has a sample, not gl specific. And, if that doesn't help you, search their docs.

05-08-2003, 09:39 AM
thx a lot to you Adrian !

05-08-2003, 12:22 PM
Happy to help. Did it work okay?

05-09-2003, 03:05 AM
i don't have time to work on it right now... but i'll give it a try real soon