From 07e12fd2b812f20088d29357fd40800aa8641d8c Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Thu, 20 Aug 2015 17:36:56 +0200 Subject: [PATCH] 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) --- recipes/sdl2/__init__.py | 6 ++++++ recipes/sdl2/uikit-transparent.patch | 11 +++++++++++ 2 files changed, 17 insertions(+) create mode 100644 recipes/sdl2/uikit-transparent.patch diff --git a/recipes/sdl2/__init__.py b/recipes/sdl2/__init__.py index 77c57d6..bb016d8 100644 --- a/recipes/sdl2/__init__.py +++ b/recipes/sdl2/__init__.py @@ -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", diff --git a/recipes/sdl2/uikit-transparent.patch b/recipes/sdl2/uikit-transparent.patch new file mode 100644 index 0000000..4d32e80 --- /dev/null +++ b/recipes/sdl2/uikit-transparent.patch @@ -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