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:
parent
9f76c4aa66
commit
7568b74599
@ -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)]];
|
||||
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user