diff options
author | Sven Gothel <[email protected]> | 2023-08-02 15:44:25 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-08-02 15:44:25 +0200 |
commit | 7437eb0e4a6bbbfb96047677716d9306e9b2acbd (patch) | |
tree | e267de606171bcbdf3321761bfda58223bc49659 | |
parent | bb6ee81bc5514663bb7b22224fcdd5ba34a51ac6 (diff) |
Graph / GraphUI Demos: Don't use the color-channel if not required (mixing colors within one region)
Note, commit bb6ee81bc5514663bb7b22224fcdd5ba34a51ac6
relaxes the requirement for using a color-channel.
6 files changed, 17 insertions, 14 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBox01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBox01.java index 754614ed4..6acb50af7 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBox01.java +++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutBox01.java @@ -205,7 +205,7 @@ public class UILayoutBox01 { final Group groupA1 = new Group(new BoxLayout( 1f, 1f, new Margin(0.05f, 0.05f), new Padding(0.10f, 0.10f) ) ); { // groupA1.addShape( new BaseButton(options.renderModes, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) ); - groupA1.addShape( new BaseButton(options.renderModes | Region.COLORCHANNEL_RENDERING_BIT, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) + groupA1.addShape( new BaseButton(options.renderModes, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) .setBorder(0.01f).setPaddding(new Padding(0.0f)) ); groupA1.addShape( new Button(options.renderModes, font, "stack-1", 0.50f, 0.50f/2f).setCorner(0f).addMouseListener(dragZoomRotateListener) ); groupA1.addShape( new Label(options.renderModes, font, 0.70f/4f, "A1 pajq").setDragAndResizeable(false).setColor(0, 0, 1, 1) ); @@ -228,7 +228,7 @@ public class UILayoutBox01 { final Group groupA2 = new Group(new BoxLayout( 1f, 1f, new Margin(0.10f, Margin.CENTER), new Padding(0.05f, 0) ) ); { // groupA2.addShape( new BaseButton(options.renderModes, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) ); - groupA2.addShape( new BaseButton(options.renderModes | Region.COLORCHANNEL_RENDERING_BIT, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) + groupA2.addShape( new BaseButton(options.renderModes, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) .setBorder(0.01f).setPaddding(new Padding(0.0f)).setBorderColor(1, 0, 0, 1) ); groupA2.addShape( new Button(options.renderModes, font, "stack-2", 0.50f, 0.50f/2f).setCorner(0f).setDragAndResizeable(false) ); groupA2.addShape( new Label(options.renderModes, font, 0.70f/4f, "A2 pajq").setDragAndResizeable(false).setColor(0, 0, 1, 1) ); @@ -247,7 +247,7 @@ public class UILayoutBox01 { final Group groupA3 = new Group(new BoxLayout( 1f, 1f, new Margin(0.10f, Margin.CENTER), new Padding(0.05f, 0f) ) ); { // groupA3.addShape( new BaseButton(options.renderModes, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) ); - groupA3.addShape( new BaseButton(options.renderModes | Region.COLORCHANNEL_RENDERING_BIT, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) + groupA3.addShape( new BaseButton(options.renderModes, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) .setBorder(0.01f).setPaddding(new Padding(0.0f)).setBorderColor(0, 0, 1, 1) ); groupA3.addShape( new Button(options.renderModes, font, "stack-3", 0.50f, 0.50f/2f).setCorner(0f).setDragAndResizeable(false) ); groupA3.addShape( new Label(options.renderModes, font, 0.70f/4f, "A3 pajq").setDragAndResizeable(false).setColor(0, 0, 1, 1) ); @@ -265,7 +265,7 @@ public class UILayoutBox01 { final Group groupA4 = new Group(new BoxLayout( 1f, 1f, new Margin(Margin.CENTER), new Padding(0.0f, 0f) ) ); { // groupA4.addShape( new BaseButton(options.renderModes, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) ); - groupA4.addShape( new BaseButton(options.renderModes | Region.COLORCHANNEL_RENDERING_BIT, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) + groupA4.addShape( new BaseButton(options.renderModes, 0.70f, 0.70f).setCorner(0f).setInteractive(false).setColor(0, 1, 0, 1) .setBorder(0.01f).setPaddding(new Padding(0.0f)).setBorderColor(0f, 0f, 0f, 1) ); groupA4.addShape( new Button(options.renderModes, font, "stack-4", 0.50f, 0.50f/2f).setCorner(0f).setDragAndResizeable(false) ); groupA4.addShape( new Label(options.renderModes, font, 0.70f/4f, "A4 pajq").setDragAndResizeable(false).setColor(0, 0, 1, 1) ); diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutGrid01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutGrid01.java index a62a5a65a..2bd9c0dfb 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutGrid01.java +++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UILayoutGrid01.java @@ -113,7 +113,6 @@ public class UILayoutGrid01 { } } } - options.renderModes |= Region.COLORCHANNEL_RENDERING_BIT; System.err.println(options); final GLProfile reqGLP = GLProfile.get(options.glProfileName); diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemoU01a.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemoU01a.java index dd4c0766c..c3d12c8d3 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemoU01a.java +++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemoU01a.java @@ -91,7 +91,7 @@ import com.jogamp.opengl.util.PMVMatrix; * </p> */ public class UISceneDemoU01a { - static final GraphUIDemoArgs options = new GraphUIDemoArgs(1432, 770, Region.VBAA_RENDERING_BIT | Region.COLORCHANNEL_RENDERING_BIT); + static final GraphUIDemoArgs options = new GraphUIDemoArgs(1280, 720, Region.VBAA_RENDERING_BIT ); static final Vec4f text_color = new Vec4f( 0, 1, 0, 1 ); static Font font; static boolean projOrtho = true; diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UIShapeDemo01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UIShapeDemo01.java index fa2af1ea0..28dfe1068 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/ui/UIShapeDemo01.java +++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UIShapeDemo01.java @@ -108,8 +108,7 @@ public class UIShapeDemo01 implements GLEventListener { caps.setAlphaBits(4); System.out.println("Requested: " + caps); - final int renderModes = Region.COLORCHANNEL_RENDERING_BIT | Region.VBAA_RENDERING_BIT; - // final int renderModes = Region.COLORCHANNEL_RENDERING_BIT; + final int renderModes = Region.VBAA_RENDERING_BIT; final GLWindow window = GLWindow.create(caps); // window.setPosition(10, 10); diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UITypeDemo01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UITypeDemo01.java index 1640f1426..e26b1dbaa 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/ui/UITypeDemo01.java +++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UITypeDemo01.java @@ -121,8 +121,7 @@ public class UITypeDemo01 implements GLEventListener { caps.setAlphaBits(4); System.out.println("Requested: " + caps); - final int renderModes = Region.COLORCHANNEL_RENDERING_BIT | Region.VBAA_RENDERING_BIT; - // final int renderModes = Region.COLORCHANNEL_RENDERING_BIT; + final int renderModes = Region.VBAA_RENDERING_BIT; final GLWindow window = GLWindow.create(caps); // window.setPosition(10, 10); @@ -287,7 +286,7 @@ public class UITypeDemo01 implements GLEventListener { drawShape(gl, pmv, renderer, testObj); pmv.glPopMatrix(); } - // drawShape(gl, pmv, renderer, crossHair); + drawShape(gl, pmv, renderer, crossHair); { final float full_width_o; final float full_height_o; diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/util/GraphUIDemoArgs.java b/src/demos/com/jogamp/opengl/demos/graph/ui/util/GraphUIDemoArgs.java index 747ee771a..a7a79d589 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/ui/util/GraphUIDemoArgs.java +++ b/src/demos/com/jogamp/opengl/demos/graph/ui/util/GraphUIDemoArgs.java @@ -87,16 +87,22 @@ public class GraphUIDemoArgs { } else if(args[idx[0]].equals("-gnone")) { sceneMSAASamples = 0; renderModes = 0; + } else if(args[idx[0]].equals("-color")) { + renderModes |= Region.COLORCHANNEL_RENDERING_BIT; + } else if(args[idx[0]].equals("-no-color")) { + renderModes &= ~Region.COLORCHANNEL_RENDERING_BIT; } else if(args[idx[0]].equals("-smsaa")) { ++idx[0]; sceneMSAASamples = MiscUtils.atoi(args[idx[0]], 4); - renderModes = 0; + renderModes &= ~(Region.VBAA_RENDERING_BIT | Region.MSAA_RENDERING_BIT ); } else if(args[idx[0]].equals("-gmsaa")) { sceneMSAASamples = 0; - renderModes = Region.MSAA_RENDERING_BIT; + renderModes &= ~(Region.VBAA_RENDERING_BIT | Region.MSAA_RENDERING_BIT ); + renderModes |= Region.MSAA_RENDERING_BIT; } else if(args[idx[0]].equals("-gvbaa")) { sceneMSAASamples = 0; - renderModes = Region.VBAA_RENDERING_BIT; + renderModes &= ~(Region.VBAA_RENDERING_BIT | Region.MSAA_RENDERING_BIT ); + renderModes |= Region.VBAA_RENDERING_BIT; } else if (args[idx[0]].equals("-dbgbox")) { ++idx[0]; debugBoxThickness = MiscUtils.atof(args[idx[0]], debugBoxThickness); |