Re: Cocoa and full-screen GL
Re: Cocoa and full-screen GL
- Subject: Re: Cocoa and full-screen GL
- From: Shawn Erickson <email@hidden>
- Date: Tue, 1 Feb 2005 08:22:26 -0800
On Jan 31, 2005, at 5:48 PM, John Stiles wrote:
I've seen a lot of examples of fullscreen OpenGL with Cocoa, and they
all seem a bit lacking. Actually getting full-screen graphics is not a
problem for me—CGL works as advertised—but I'm stumped as to how to
best handle events! All the demos I've found seem lacking:
What is currently used in a game I am working on is two threads. The
main thread is used to run, in this case, a Carbon event loop with a
set of registered event handlers and standard event handlers. It will
handle a few classes of the events itself (like quit, hide, etc.) and
only pass off what is needed to the game logic (key, mouse, etc.).
The game engine or loop runs in a secondary thread as fast as it can
render things. The main thread (the one running the event loop) feeds
game related events to the game thread via a queue.
We provide the option of capturing all displays or just the display
they want to play on and we capture the screens using Quartz services.
By capturing the display we allow the most GL hardware resources to be
available to the game and it blocks the exposé effect and
command-tabbing for free. We of course provide a way to hide the game
(without stopping the game) and this will detach the displayable GL and
uncapture any screens that we have captured. SImply commmand-tabbing
back to the game or selecting it in the dock will get things recaptured
as needed, etc.
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden