problem blitting to fullscreen window
problem blitting to fullscreen window
- Subject: problem blitting to fullscreen window
- From: George Marlin <email@hidden>
- Date: Tue, 1 May 2007 12:36:47 -0700 (PDT)
In my app I'm blitting a simple bitmap to a window. It all works fine
when I make a window in the canonical manner with a nib file:
[NSBundle loadNibNamed:@"MainMenu" owner:NSApp] ;
NSWindow* main_window = [self mainWindow] ;
[main_window makeKeyAndOrderFront:nil] ;
However it all goes to pot when I replace the above with code to make
a fullscreen window:
if (CGDisplayCapture( kCGDirectMainDisplay ) != kCGErrorSuccess) {
NSLog(@"Couldn't capture the main display!") ;
assert(0) ;
}
int windowLevel = CGShieldingWindowLevel() ;
NSRect screenRect = [[NSScreen mainScreen] frame] ;
NSWindow* main_window =
[[MyWindow alloc]
initWithContentRect:screenRect
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO
screen:[NSScreen mainScreen]] ;
[main_window makeMainWindow] ;
[main_window setLevel:windowLevel] ;
[main_window makeKeyAndOrderFront:nil] ;
(MyWindow has overridden canBecomeMainWindow to return true.) The app
does take over the whole screen, but the screen is just solid black;
none of my blits show up. All data appears legit; the window's
content view is not nil, for example. The blit is from a
NSBitmapImageRep using drawAtPoint, between lockFocus/unlockFocus on
the window's content view.
Any ideas what could be wrong?
Thanks,
George Marlin
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden