diff options
author | Sven Gothel <[email protected]> | 2019-07-08 06:15:59 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-07-08 06:15:59 +0200 |
commit | 29ad35ab598b6d97367e2e9763f0d2a96c52bcaa (patch) | |
tree | 7fd7131f9a9c728ed1c8f657a6ee67faee13cc34 /src/newt/native | |
parent | b4fef61928cfd379dcb956e17a63495a18444f8a (diff) |
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.
Diffstat (limited to 'src/newt/native')
-rw-r--r-- | src/newt/native/IOSWindow.m | 19 |
1 files changed, 18 insertions, 1 deletions
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); |