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/nativewindow/native/ios/IOSmisc.m | |
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/nativewindow/native/ios/IOSmisc.m')
-rw-r--r-- | src/nativewindow/native/ios/IOSmisc.m | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/nativewindow/native/ios/IOSmisc.m b/src/nativewindow/native/ios/IOSmisc.m index 1983143df..9a1bbfd7f 100644 --- a/src/nativewindow/native/ios/IOSmisc.m +++ b/src/nativewindow/native/ios/IOSmisc.m @@ -315,7 +315,7 @@ JNIEXPORT jfloat JNICALL Java_jogamp_nativewindow_ios_IOSUtil_GetScreenPixelScal * Signature: (IIIIZ)J */ JNIEXPORT jlong JNICALL Java_jogamp_nativewindow_ios_IOSUtil_CreateUIWindow0 - (JNIEnv *env, jclass unused, jint x, jint y, jint width, jint height) + (JNIEnv *env, jclass unused, jint x, jint y, jint width, jint height, jboolean visible) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; [CATransaction begin]; @@ -325,22 +325,33 @@ JNIEXPORT jlong JNICALL Java_jogamp_nativewindow_ios_IOSUtil_CreateUIWindow0 // Allocate the window UIWindow *myWindow = [[[[UIWindow alloc] initWithFrame:boundsWin] autorelease] retain]; myWindow.rootViewController = [[[UIViewController alloc] initWithNibName:nil bundle:nil] autorelease]; +#ifdef VERBOSE_ON [myWindow setBackgroundColor: [UIColor redColor]]; +#endif // n/a iOS [myWindow setPreservesContentDuringLiveResize: YES]; - // FIXME invisible .. (we keep it visible for testing) - // FIXME [myWindow setOpaque: NO]; - // FIXME [myWindow setBackgroundColor: [UIColor clearColor]]; - [myWindow makeKeyAndVisible]; - + if( visible) { + [myWindow setOpaque: YES]; + [myWindow makeKeyAndVisible]; + } else { + [myWindow setOpaque: NO]; + [myWindow setBackgroundColor: [UIColor clearColor]]; + } CAEAGLUIView *uiView = [[CAEAGLUIView alloc] initWithFrame:boundsView]; CAEAGLLayer* l = (CAEAGLLayer*)[uiView layer]; - [l setOpaque: YES]; + if( visible ) { + [uiView setOpaque: YES]; + [l setOpaque: YES]; + } else { + [uiView setOpaque: NO]; + [uiView setBackgroundColor: [UIColor clearColor]]; + [l setOpaque: NO]; + [l setBackgroundColor: [UIColor clearColor]]; + } l.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys: /* defaults */ [NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil]; - [myWindow addSubview: uiView]; [CATransaction commit]; |