FROM : George Marlin
DATE : Tue May 01 21:36:47 2007
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
DATE : Tue May 01 21:36:47 2007
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
| Related mails | Author | Date |
|---|---|---|
| No related mails found. | ||






Cocoa mail archive

