Allow for use of alpha channel in the back buffer, so emulators can e.g. set the desktop background color to transparent.

This commit is contained in:
Uli Kusterer 2015-03-08 17:56:49 +01:00
parent 9f76c4aa66
commit 7568b74599
2 changed files with 2 additions and 1 deletions

View File

@ -216,6 +216,7 @@
{
NSWindow* theWindow = [[NSWindow alloc] initWithContentRect: waf.frame styleMask: NSBorderlessWindowMask backing: NSBackingStoreBuffered defer: NO];
theWindow.releasedWhenClosed = NO;
theWindow.opaque = NO;
[theWindow setContentView: [[RootlessWindowContentView alloc] initWithFrame: NSMakeRect(0, 0, 100, 100)]];

View File

@ -30,7 +30,7 @@ int EmulatorMain( int argc, const char** argv )
uint32_t* backBuffer = malloc(screenWidth * screenHeight * 4);
for( int x = 0; x < (screenWidth * screenHeight); x++ )
backBuffer[x] = 0xFF0000FF; // Red with 100% alpha.
backBuffer[x] = 0x880000FF; // Red with 50% alpha.
BackBufferChanged( backBuffer, screenWidth * 4, screenWidth, screenHeight ); // And tell the rootless code to load it. You do that every time something changes.
// Everything that should show up as a window should be registered using this call: