Drawing directly to the screen?
Just wondering... is these some way to draw directly to the screen with OpenGL, or some other way?
Quote:Originally posted by BlueAvian
Just wondering... is these some way to draw directly to the screen with OpenGL, or some other way?
I'm almost positive that drawing directly to the screen is a really bad idea. What you need to do is create a window with a AGLcontext on it and make it fullscreen(via BeginFullScreen in Quicktime, or glut). There is some good sample code on Apple's samplecode page to do this.
You shouldn't draw directly to the screen, because there's no way you can always "beat" the window server.
You need to either make a proper fullscreen OpenGL context (using CGCaptureAllDisplays and aglSetFullScreen, -[NSOpenGLContext setFullScreen] or CGLSetFullScreen),
or you need to make a window which composites with the other windows on the desktop. It should be possible to make this window always on top and not accept clicks. This is easier in Cocoa than in Carbon, though should be possible in both. It requires 10.2.
Let us know what you're trying to accomplish here...
You need to either make a proper fullscreen OpenGL context (using CGCaptureAllDisplays and aglSetFullScreen, -[NSOpenGLContext setFullScreen] or CGLSetFullScreen),
or you need to make a window which composites with the other windows on the desktop. It should be possible to make this window always on top and not accept clicks. This is easier in Cocoa than in Carbon, though should be possible in both. It requires 10.2.
Let us know what you're trying to accomplish here...
There is apple's "boing" example, which draws a transparent window with OpenGL in it, and it seems like it is floating on the screen, above all, as if you changed the actual screen buffer.
Quote:Originally posted by BlueAvian
Just wondering... is these some way to draw directly to the screen with OpenGL, or some other way?
I'm surprised nobody asked this first: Why?
Quote:Originally posted by BlueAvian
Just wondering... is these some way to draw directly to the screen with OpenGL, or some other way?
No, when I want to draw direct to the screen I use a wax pencil. I used to use white-board marker pens, but I find the wax pencil easier to clean off.
You can draw directly to the screen using BlitPixie from SpriteWorld. It is useful under Mac OS X on older computers that do not support Quartz Extreme. It will more than double your game's framerate (roughly), but at the cost of you having to make sure things get drawn correctly. For instance, if you run a game in windowed mode, just because you move the window doesn't mean the drawing moves too. Or if your game goes into the background, it will still draw on top of everything else! So I'd only recommend it if your game is in fullscreen mode and want to support older systems on Mac OS X.
-Jon
-Jon
jeff binder drawed directly to the screen, he said that it allowed the full potential of the graphics card to kick in.
Capturing the screen and then using OpenGL to draw lets the full potential of the graphics card kick in. Anything else is a waste of time
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| OpenGL full screen mode leaves garbage on screen when exiting app | Malarkey | 5 | 4,465 |
Nov 19, 2008 12:51 PM Last Post: Malarkey |
|

