OpenGl DirectX screenshoots

Programming, for all ages and all languages.
Post Reply
jeandaniel
Posts: 14
Joined: Wed Nov 14, 2007 3:26 pm
Location: Paris, France

OpenGl DirectX screenshoots

Post by jeandaniel »

Hi, i need to developp an app which take screenshoot of Windows 3d games (DirectX,openGL).
I have made a Python app that take screenshoot but when i launch my app and for example Quake3 all my screenshoot are gray images.
So i wonder if i need to developp an DirectX app or not.
And if yes, how can i put a DirectX app in front of another DirectX app which is in fullscreen mode ?
Thx all
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Post by neon »

Why not just use the prtscr key?
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

Since graphics applications can and do trade-off between speed and the ability to allow screenshots, you might be in serious trouble. It is not always possible to get the exact contents of the screen back in memory, as that image does not exist. Rather, it is generated on the fly when sending data to the monitor.

Try alt+printscreen as suggested. If that does not work either, chances are likely you are looking at an side effect of the above.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Post by Candy »

If you're really really sure you want to hard-core screenshot opengl/directx programs, make a hook on the buffer swap command and take the contents after the swap. That should give you the content.
Post Reply