Grab current desktop/screen as a texture?
Howdy
I'm writing a program and I'd like to mess with the a screen capture of whatever if displayed on the screen when the program starts. I need to then use the grab of the screen as an OpenGL texture so I can draw on it, or put it on a polygon or whatever.
So my question is, how do I grab the screen and then make it into a texture? It's something I've done under Windows, but I can't work it out under Mac OS X, altho I'm hoping it's still possible.
Any help would be greatly appreciated!
Rob.
I'm writing a program and I'd like to mess with the a screen capture of whatever if displayed on the screen when the program starts. I need to then use the grab of the screen as an OpenGL texture so I can draw on it, or put it on a polygon or whatever.
So my question is, how do I grab the screen and then make it into a texture? It's something I've done under Windows, but I can't work it out under Mac OS X, altho I'm hoping it's still possible.
Any help would be greatly appreciated!
Rob.
Should certainly be possible. Freedom Force (ported by Omni Group) applies an entertaining swirl effect to the desktop image when it starts up. I don't know how they did it though.
For that matter, screen capture utilities also do it. Hmmm...
[5 minutes later]
Here's a method I just came up with: programatically invoke the command line utility "screencapture", sending the image to the clipboard.
http://www.macdevcenter.com/pub/a/mac/20...tml?page=3
Then you'd have to get it from there into a texture.
There's got to be a more direct way, though. Hopefully someone here knows the magic incantation...
For that matter, screen capture utilities also do it. Hmmm...
[5 minutes later]
Here's a method I just came up with: programatically invoke the command line utility "screencapture", sending the image to the clipboard.
http://www.macdevcenter.com/pub/a/mac/20...tml?page=3
Then you'd have to get it from there into a texture.
There's got to be a more direct way, though. Hopefully someone here knows the magic incantation...
Measure twice, cut once, curse three or four times.
If you're only interested in capturing *your* app's interface into an OpenGL texture, and if your app is Cocoa, you could use this:
http://developer.apple.com/qa/qa2001/qa1325.html
http://developer.apple.com/qa/qa2001/qa1325.html
Hmm.. I actually want to get the whole screen, but it's a start.
Just thinking without knowing here, but is there a global NSView which encompases the whole screen? That'd be handy.
Or what about making a window the size of the screen thats transparent, then grabbing that? That would work under Windows, but I don't know enough about OS X to be able to say myself. What dya think?
Just thinking without knowing here, but is there a global NSView which encompases the whole screen? That'd be handy.
Or what about making a window the size of the screen thats transparent, then grabbing that? That would work under Windows, but I don't know enough about OS X to be able to say myself. What dya think?
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| SDL. Current music position | e40pud | 0 | 1,878 |
Mar 9, 2010 08:46 AM Last Post: e40pud |
|
| Has anyone had problems with desktop after quit? | mwark | 2 | 2,017 |
Jan 23, 2010 05:04 PM Last Post: mwark |
|
| OpenGL full screen mode leaves garbage on screen when exiting app | Malarkey | 5 | 4,459 |
Nov 19, 2008 12:51 PM Last Post: Malarkey |
|
| Full screen context doesn't remain the current context | Malarkey | 3 | 2,969 |
Feb 1, 2007 05:27 PM Last Post: OneSadCookie |
|
| Getting Current Translation And Rotation In OpenGL | Nick | 3 | 3,005 |
Jul 26, 2006 11:16 AM Last Post: kelvin |
|

