Drawing directly to the screen?

BlueAvian
Unregistered
 
Post: #1
Just wondering... is these some way to draw directly to the screen with OpenGL, or some other way?
Quote this message in a reply
Moderator
Posts: 133
Joined: 2008.05
Post: #2
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.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #3
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...
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #4
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 this message in a reply
Programmer
Unregistered
 
Post: #5
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 this message in a reply
Member
Posts: 28
Joined: 2003.10
Post: #6
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.

[Image: troll-tongue.png]

-- Giles Williams
Oolite - retro space-sim agogo
Quote this message in a reply
Moderator
Posts: 522
Joined: 2002.04
Post: #7
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
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2008.09
Post: #8
jeff binder drawed directly to the screen, he said that it allowed the full potential of the graphics card to kick in.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #9
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 Rasp
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenGL full screen mode leaves garbage on screen when exiting app Malarkey 5 5,297 Nov 19, 2008 12:51 PM
Last Post: Malarkey