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/demos/com/jogamp | |
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/demos/com/jogamp')
-rw-r--r-- | src/demos/com/jogamp/opengl/demos/ios/Hello.java | 4 | ||||
-rw-r--r-- | src/demos/com/jogamp/opengl/demos/ios/Hello1.java | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/ios/Hello.java b/src/demos/com/jogamp/opengl/demos/ios/Hello.java index 378868bea..5750c7b90 100644 --- a/src/demos/com/jogamp/opengl/demos/ios/Hello.java +++ b/src/demos/com/jogamp/opengl/demos/ios/Hello.java @@ -67,6 +67,7 @@ public class Hello { int secondsDuration = 10; // 10s int width = 832, height = 480; // ipad pro 11: 2388x1668 px (scale: 2) int fboDepthBits = -1; // CAEAGLLayer fails with depth 16 + 24 in Simulation; -1 means don't change + boolean translucent = false; boolean exitJVM = false; String demoName = "com.jogamp.opengl.demos.es2.GearsES2"; for(int i=0; i<args.length; i++) { @@ -85,6 +86,8 @@ public class Hello { reqSurfacePixelScale[1] = reqSurfacePixelScale[0]; } else if(args[i].equals("-seconds") && i+1<args.length) { secondsDuration = parseInt(args[++i], secondsDuration); + } else if(args[i].equals("-translucent")) { + translucent = true; } else { System.err.println("ignoring arg["+i+"]: "+args[i]); } @@ -131,6 +134,7 @@ public class Hello { if( 0 <= fboDepthBits) { reqCaps.setDepthBits(fboDepthBits); } + reqCaps.setBackgroundOpaque(!translucent); System.out.println("Requested GL Caps: "+reqCaps); // 2) Create newt native window diff --git a/src/demos/com/jogamp/opengl/demos/ios/Hello1.java b/src/demos/com/jogamp/opengl/demos/ios/Hello1.java index e0c3be871..5dc7b14a2 100644 --- a/src/demos/com/jogamp/opengl/demos/ios/Hello1.java +++ b/src/demos/com/jogamp/opengl/demos/ios/Hello1.java @@ -117,7 +117,7 @@ public class Hello1 { System.err.println(""); GLAutoDrawableDelegate glad = null; - final long uiWindow = IOSUtil.CreateUIWindow(0, 0, width, height); + final long uiWindow = IOSUtil.CreateUIWindow(0, 0, width, height, true); try { // 1) Config .. final GLProfile glp = GLProfile.getGL2ES2(); |