Skip to main content
GameDev.net gamedev.net
🔒 Locked

screen to memory buffer

Started by tadobie Jan 31, 2005 at 11:10 PM 9 replies 1.2k views
Original Post
tadobie
tadobie
HI all, I'm wondering about doing a screen capture that is will returns an array that represents a ".bmp" to memory (doing bitwise comparison). Until now I have been using Qt to do this. The problem is the screen capture returns a Pixmap which is converted to a bitmap and then read into a memory buffer. This is just to slow for what I want. It takes around 300ms to perform (3 and a bit frames per second, I don't think so!). If there is a way to capture the screen in openGL without having to convert to ".bmp" data I may be able to acheive the kinds of speeds I am looking for. any clues?
Don't mug ya self!
tadobie
tadobie
need to do pixel by pixel comparison for a streaming algorithm I've write that does something like a VNC operation
Don't mug ya self!
Raduprv
Raduprv
Can you post more details about what exactly you are trying to do? There must eb a better/faster way to accomplish what you want, without reading from teh frame buffer. Maybe rendering to a texture would help?
tadobie
tadobie
I have multiple desktops running
Each is controlled by an external device via wifi
regular screen captures are made
screen capture 1 is compared with screen capture 2
the differences are dynamically built into an array
this array is sent to the appropriate device and changes the screen accordingly

The only real bottle neck is that I way I have been performing the screen capture requires a Pixmap to be converted to an array which I can read quickly

The rest of the process is negligable.
All I need is a fast way to access the screen data.


Don't mug ya self!
tadobie
tadobie
not for a specific openGL app but thought that openGL might offer a way of capturing the screen an presenting it in a format I can us. Been trying to find out how (tryed SDL, wierd compresssed/ interlaced format that it too confusing to traverse through. ".bmp" format is easy to traverse though. Can you tell me if a screen capture using openGL can be organised into a particular format ( in my case an array representing a '.bmp" file)?
Don't mug ya self!
Raduprv
Raduprv
Well, your problem is that you can't capture a screen using OpenGL unless that screen actually belongs to an OpenGL application.
Your best bet is to look in the Win32 API and see if you can find a function that returns the desktop in some BMP or raw format.
tadobie
tadobie
OK,
The functionality I have at this point could easily be rewritten to be openGl complient if it can do what I need it to do (it's all just array comparisons and manipulation). If I need to create a display object, surface etc that's no problem. Is it worth it or will it just add more overhead and give me a less readable data structure (as SDL did)?
(BTW I'm using a Linux based system, open source all the way!)
Don't mug ya self!
Raduprv
Raduprv
If it's Linux then you can use Wine and Win32 :D J/K
Actually, if you really want it to be OpenGL (which I do not recommend, because not all the videocards under Linux have good Linux OpenGL support, and you might end up with software MESA, which is very slow), then you can render your screen in a texture, then take the data from that texture.
tadobie
tadobie
OK, thanks heaps for you advise. I'll look into it.
Don't mug ya self!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.