From 29ad35ab598b6d97367e2e9763f0d2a96c52bcaa Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 8 Jul 2019 06:15:59 +0200 Subject: NEWT iOS: Support translucent windows and remove the redColor default background (debug only). IOSUtil.CreateUIWindow(..) also gets its 'visible' attribute, to be true only for demo Hello1 code - false for intended Proxy Surface Hook. --- src/newt/native/IOSWindow.m | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/newt/native') diff --git a/src/newt/native/IOSWindow.m b/src/newt/native/IOSWindow.m index 4e3bd5479..b953c3146 100644 --- a/src/newt/native/IOSWindow.m +++ b/src/newt/native/IOSWindow.m @@ -517,7 +517,15 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_ios_WindowDriver_createWindow1 backing: 0 // TODO (NSBackingStoreType) bufferingType defer: YES isFullscreenWindow: fullscreen] autorelease] retain]; - [myWindow setBackgroundColor: [UIColor redColor]]; + if(opaque) { + [myWindow setOpaque: YES]; +#ifdef VERBOSE_ON + [myWindow setBackgroundColor: [UIColor redColor]]; +#endif + } else { + [myWindow setOpaque: NO]; + [myWindow setBackgroundColor: [UIColor clearColor]]; + } if( visible ) { // Only if calling this before adding the view, the view receives touch events. // Another 'funny' iOS API nightmare? @@ -530,6 +538,15 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_ios_WindowDriver_createWindow1 myView = [[NewtUIView alloc] initWithFrame: rectView] ; } CAEAGLLayer* l = (CAEAGLLayer*)[myView layer]; + if(opaque) { + [myView setOpaque: YES]; + [l setOpaque: YES]; + } else { + [myView setOpaque: NO]; + [myView setBackgroundColor: [UIColor clearColor]]; + [l setOpaque: NO]; + [l setBackgroundColor: [UIColor clearColor]]; + } DBG_PRINT_CREATEWIN1(2); changeContentView(env, jthis, parentView, myWindow, myView, NO); -- cgit v1.2.3