NSScreen, CG and fullscreen bug?
NSScreen, CG and fullscreen bug?
- Subject: NSScreen, CG and fullscreen bug?
- From: Brian Hook <email@hidden>
- Date: Wed, 07 Aug 2002 15:14:22 -0700
I'm running into a bug I _think_ is with something in Cocoa and/or CG.
I'm currently using LibSDL as the back end for our games running on OS X
(and Linux), and we're getting all kinds of wacky problems right now if
our app starts in fullscreen then goes into a windowed mode. If we
start windowed, go fullscreen, then go back to windowed it's fine. If
we start fullscreen and stay in fullscreen, we're also fine.
While trying to hunt down this bug, I noticed odd behaviour in that
NSWindow -center wasn't working correctly -- my window was always placed
in the upper left of the screen.
Upon further investigation, I checked the call to [ [ NSScreen
mainScreen ] visibleFrame ] and lo and behold, it was reporting 640,480
even when I was clearly running at 1280 x 1024.
Is there a way to "flush" NSScreen and force it to recognize a mode
change? Or, alternatively, is it possible that there's some call after
going from fullscreen -> windowed that I should be making to sync the
rest of Cocoa that I may not be doing? Failing that, any other ideas
what might be wrong?
The other place this manifests itself (although this might be unrelated)
is when I was calling NSWindow -convertScreenToBase, which was giving me
incorrect values, but this could just be a side effect of the NSScreen
problem. Upon closer inspection of the window's frame, I found that it
thought it was 0,0 when the window was at the top left of the screen,
and that frame.origin values ranged from 0 to -screenheight as I pulled
it down.
This is consistent with Cocoa's coordinate system geometry, but in the
wrong quadrant (I think).
Thanks,
Brian
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.