sdl2: add a feature that make the SDL2 GL context transparent (non-opaque) if UIKIT_TRANSPARENT is set in the environ. (this must be done before the window creation, so main.m is a good place)

This commit is contained in:
Mathieu Virbel 2015-08-20 17:36:56 +02:00
parent 64a7da2431
commit 07e12fd2b8
2 changed files with 17 additions and 0 deletions

View file

@ -12,6 +12,12 @@ class LibSDL2Recipe(Recipe):
pbx_frameworks = ["OpenGLES", "AudioToolbox", "QuartzCore", "CoreGraphics",
"CoreMotion"]
def prebuild_arch(self, arch):
if self.has_marker("patched"):
return
self.apply_patch("uikit-transparent.patch")
self.set_marker("patched")
def build_arch(self, arch):
shprint(sh.xcodebuild,
"ONLY_ACTIVE_ARCH=NO",

View file

@ -0,0 +1,11 @@
--- slime73-sdl-experiments-618662dc9e82/src/video/uikit/SDL_uikitopenglview.m.orig 2015-08-20 16:09:59.000000000 +0200
+++ slime73-sdl-experiments-618662dc9e82/src/video/uikit/SDL_uikitopenglview.m 2015-08-20 16:11:25.000000000 +0200
@@ -99,7 +99,7 @@
CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;
- eaglLayer.opaque = YES;
+ eaglLayer.opaque = SDL_getenv("UIKIT_TRANSPARENT") ? NO : YES;
eaglLayer.drawableProperties = @{
kEAGLDrawablePropertyRetainedBacking:@(retained),
kEAGLDrawablePropertyColorFormat:colorFormat