Re: Full screen tiny issue
Re: Full screen tiny issue
- Subject: Re: Full screen tiny issue
- From: Ricky Sharp <email@hidden>
- Date: Tue, 27 Jun 2006 17:34:51 -0500
On Jun 27, 2006, at 2:55 PM, Nicholas Buratovich wrote:
Tue, 27 Jun 2006 11:55:09 -0500 Rick Sharp wrote:
One way to display the full screen window is to capture the
display and launch the window. Here is the sequence you need to
follow,
Use the CGDisplayCaptureWithOptions to capture the display (This
will block all other applications to draw on screen) Get the
window level using CGShieldingWindowLevel. Create a window and
set the window level. Display the window.
Don't do this. You should only ever capture the display if you
plan to not display any standard Cocoa windows/controls (i.e.
you're doing your own direct drawing). Definitely search the
archives for reasons for the problems.
In the Cocoa Drawing Guide on ADC under "Advanced Drawing
Techniques" there is a section about fullscreen drawing in Cocoa.
Capturing the screen and setting the NSWindow level to
CGShieldingWindowLevel is the recommended technique for fullscreen
drawing and sample code for that is provided. You can check it out
here: http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaDrawingGuide/AdvancedDrawing/chapter_9_section_4.html (the
list might mangle the URL but you get the idea).
I do recall when I searched the archives on this subject a while
back (last year or before I think) there some serious discussion
about this. There were a lot of "this isn't supported, don't do
it" warnings and "but it works, why not?" replies. To my
recollection the discussion basically ended with someone asking
"well then what is the supported way?" with no response.
Since Apple has this technique documented in the drawing guide
should we now consider this a supported way to do fullscreen
drawing in Cocoa? Or is there something I am missing that needs
clarification?
This is unfortunate. The following is part of a e-mail directly from
an Apple engineer from quartz-dev a while back:
"You should be aware that the CGCaptureDisplay APIs are intended as a
way to effectively remove a display from the window system. The
display still has to maintain a place in the global coordinate system
so that drawing mechanisms can find it, so it's possible to 'trick'
windows into appearing on the captured display.
Captured displays are typically used for porting full screen games
and some similar software, which contain their own graphics engine
and do not or can not interact with the window system. Some common
cases include full screen OpenGL context drawing systems as found in
games, where the context can achieve better performance on some
hardware by placing the frame buffer into unusual modes of operation.
In particular, a full-screen GL context may place the hardware in
states that cannot be supported by the window system. That's why the
documentation on using full-screen GL contexts recommends capturing
the display, removing the display from the window system.
There are some clever hacks out there that will get a window on a
captured display in some circumstances, however, this will definitely
not work on all hardware, particularly not with an OpenGL full-screen
context. The window may simply not appear, or little bits and pieces
may appear where a tiled framebuffer happens to map some of the tiles
holding the window content on-screen."
Perhaps a bug should be filed against that sample code.
When I need "full screen" apps that work with the windowing system,
it's easy to put "blanking windows" on all displays such that the
content area is the full size of the screen. Your main "content"
window can then be set up as a child window on the screen of your
choice. This will prevent the blanking window from ever appearing
above it.
Then, sprinkle in the call to SetSystemUIMode, and you're done.
Finally, this approach is res-independent savvy. Use the appropriate
APIs to size the blanking window(s) and content window.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
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