Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problem blitting to fullscreen window



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.