Browse Source

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

Uli Kusterer 9 years ago
parent
commit
7568b74599
2 changed files with 2 additions and 1 deletions
  1. 1 0
      RootlessForEmulators/AppDelegate.m
  2. 1 1
      RootlessForEmulators/EmulatorMain.c

+ 1 - 0
RootlessForEmulators/AppDelegate.m

@@ -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)]];
 	

+ 1 - 1
RootlessForEmulators/EmulatorMain.c

@@ -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: