From f9a00b91dcd146c72a50237b62270f33bd0da98e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 21 May 2014 08:53:54 +0200 Subject: Bug 742 HiDPI: [Core API Change] Distinguish window-units and pixel-units; Add HiDPI for AWT GLCanvas w/ OSX CALayer Core API Change: To support HiDPI thoroughly in JOGL (NativeWindow, JOGL, NEWT) we need to separate window- and pixel units. NativeWindow and NativeSurface now have distinguished access methods for window units and pixel units. NativeWindow: Using window units - getWindowWidth() * NEW Method * - getWindowHeight() * NEW Method * - getX(), getY(), ... NativeSurface: Using pixel units - getWidth() -> getSurfaceWidth() * RENAMED * - getHeight() -> getSurfaceHeight() * RENAMED * GLDrawable: Using pixel units - getWidth() -> getSurfaceWidth() * RENAMED, aligned w/ NativeSurface * - getHeight() -> getSurfaceHeight() * RENAMED, aligned w/ NativeSurface * Above changes also removes API collision w/ other windowing TK, e.g. AWT's getWidth()/getHeight() in GLCanvas and the same method names in GLDrawable before this change. +++ Now preliminary 'working': - AWT GLCanvas - AWT GLJPanel Tested manually on OSX w/ and w/o HiDPI Retina: java com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT -manual -noanim -time 1000000 java com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT -manual -noanim -time 1000000 +++ TODO: - NEWT - Change Window.setSize(..) to use pixel units ? - OSX HiDPI support - Testing .. - API refinement --- .../opengl/test/android/MovieSimpleActivity1.java | 4 ++-- .../com/jogamp/opengl/test/bugs/Issue326Test2.java | 2 +- .../test/junit/graph/TestTextRendererNEWT00.java | 2 +- .../test/junit/graph/TestTextRendererNEWT10.java | 6 ++--- .../test/junit/graph/TextRendererGLELBase.java | 2 +- .../graph/demos/GPURendererListenerBase01.java | 2 +- .../graph/demos/GPUTextRendererListenerBase01.java | 4 ++-- .../junit/graph/demos/GPUUISceneGLListener0A.java | 14 ++++++------ .../graph/demos/ui/GLEventListenerButton.java | 2 +- .../junit/graph/demos/ui/UIListenerBase01.java | 2 +- .../test/junit/jogl/acore/GLReadBuffer00Base.java | 2 +- .../jogl/acore/TestFBOAutoDrawableFactoryNEWT.java | 6 ++--- .../test/junit/jogl/acore/TestFBOMRTNEWT01.java | 10 ++++----- .../junit/jogl/acore/TestFBOMix2DemosES2NEWT.java | 14 ++++++------ ...tFBOOffThreadSharedContextMix2DemosES2NEWT.java | 14 ++++++------ .../TestFBOOnThreadSharedContext1DemoES2NEWT.java | 14 ++++++------ .../jogl/acore/TestGLAutoDrawableDelegateNEWT.java | 2 +- ...estGLAutoDrawableDelegateOnOffscrnCapsNEWT.java | 8 +++---- ...estGLAutoDrawableFactoryES2OffscrnCapsNEWT.java | 6 ++--- ...estGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java | 6 ++--- ...TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java | 6 ++--- ...TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java | 6 ++--- ...estGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java | 6 ++--- ...LAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java | 6 ++--- .../jogl/acore/TestGLContextSurfaceLockNEWT.java | 2 +- .../jogl/acore/TestGLReadBuffer01GLCanvasAWT.java | 2 +- .../jogl/acore/TestGLReadBuffer01GLJPanelAWT.java | 2 +- .../jogl/acore/TestGLReadBuffer01GLWindowNEWT.java | 4 ++-- .../junit/jogl/acore/TestX11DefaultDisplay.java | 2 +- .../glels/TestGLContextDrawableSwitch01NEWT.java | 2 +- .../glels/TestGLContextDrawableSwitch10NEWT.java | 2 +- .../TestBug816GLCanvasFrameHoppingB849B889AWT.java | 2 +- ...estBug816JTabbedPanelVisibilityB849B878AWT.java | 2 +- .../jogl/awt/TestBug816OSXCALayerPos01AWT.java | 8 +++---- .../awt/text/TextRendererGLEventListener01.java | 2 +- .../junit/jogl/caps/TestBug605FlippedImageAWT.java | 4 ++-- .../jogl/caps/TestBug605FlippedImageNEWT.java | 2 +- .../opengl/test/junit/jogl/demos/es1/GearsES1.java | 4 ++-- .../jogl/demos/es2/ElektronenMultiplizierer.java | 8 +++---- .../test/junit/jogl/demos/es2/FBOMix2DemosES2.java | 8 +++---- .../opengl/test/junit/jogl/demos/es2/GearsES2.java | 14 ++++++------ .../test/junit/jogl/demos/es2/LandscapeES2.java | 6 ++--- .../demos/es2/TextureDraw02ES2ListenerFBO.java | 2 +- .../jogl/demos/es2/TextureSequenceCubeES2.java | 6 ++--- .../test/junit/jogl/demos/es2/av/MovieCube.java | 2 +- .../test/junit/jogl/demos/es2/av/MovieSimple.java | 14 ++++++------ .../junit/jogl/demos/es2/awt/TestGearsES2AWT.java | 4 ++-- .../demos/es2/awt/TestGearsES2GLJPanelAWT.java | 2 +- .../jogl/demos/es2/newt/TestGearsES2NEWT.java | 26 +++++++++++----------- .../demos/es2/newt/TestGearsES2NewtCanvasAWT.java | 8 +++---- .../demos/es2/newt/TestGearsES2NewtCanvasSWT.java | 12 +++++----- .../jogl/demos/es2/newt/TestLandscapeES2NEWT.java | 2 +- .../es2/newt/TestLandscapeES2NewtCanvasAWT.java | 6 ++--- .../jogl/demos/es2/newt/TestRedSquareES2NEWT.java | 2 +- .../junit/jogl/demos/es2/swt/TestGearsES2SWT.java | 4 ++-- .../opengl/test/junit/jogl/demos/gl2/Gears.java | 4 ++-- .../demos/gl2/awt/TestGearsAWTAnalyzeBug455.java | 2 +- .../demos/gl2/newt/TestGearsNewtAWTWrapper.java | 6 ++--- .../junit/jogl/glsl/TestGLSLShaderState01NEWT.java | 16 ++++++------- .../junit/jogl/glsl/TestGLSLShaderState02NEWT.java | 8 +++---- .../test/junit/jogl/glsl/TestRulerNEWT01.java | 2 +- .../jogl/swt/TestBug672NewtCanvasSWTSashForm.java | 12 +++++----- .../TestBug672NewtCanvasSWTSashFormComposite.java | 12 +++++----- .../junit/jogl/swt/TestSWTAccessor03AWTGLn.java | 4 ++-- .../tile/TestRandomTiledRendering2GL2NEWT.java | 4 ++-- .../jogl/tile/TestRandomTiledRendering3GL2AWT.java | 4 ++-- .../jogl/tile/TestTiledRendering1GL2NEWT.java | 12 +++++----- .../junit/jogl/tile/TestTiledRendering2NEWT.java | 10 ++++----- .../junit/jogl/util/DemoGL2ES1ImmModeSink.java | 4 ++-- .../junit/jogl/util/DemoGL2ES2ImmModeSink.java | 4 ++-- .../TestGLReadBufferUtilTextureIOWrite02AWT.java | 4 ++-- .../TestGLReadBufferUtilTextureIOWrite02NEWT.java | 4 ++-- .../texture/TestJPEGJoglAWTCompareNewtAWT.java | 2 +- .../junit/newt/TestGLWindowWarpPointer01NEWT.java | 2 +- .../opengl/test/junit/newt/TestWindows01NEWT.java | 8 +++---- .../test/junit/newt/mm/TestScreenMode01bNEWT.java | 6 ++--- .../test/junit/newt/mm/TestScreenMode01cNEWT.java | 10 ++++----- .../test/junit/newt/mm/TestScreenMode01dNEWT.java | 16 ++++++------- .../parenting/NewtAWTReparentingKeyAdapter.java | 6 ++--- .../junit/newt/parenting/TestParenting02NEWT.java | 8 +++---- .../opengl/test/junit/util/AWTRobotUtil.java | 6 ++--- .../jogamp/opengl/test/junit/util/UITestCase.java | 6 ++--- 82 files changed, 247 insertions(+), 247 deletions(-) (limited to 'src/test') diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java index 1a81215ba..fc08301cb 100644 --- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java +++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java @@ -123,7 +123,7 @@ public class MovieSimpleActivity1 extends NewtBaseActivity { glWindowMain.setSize(scrn.getWidth()-padding, scrn.getHeight()-padding); glWindowMain.setUndecorated(true); // setContentView(getWindow(), glWindowMain); - viewGroup.addView(androidView, new android.widget.FrameLayout.LayoutParams(glWindowMain.getWidth(), glWindowMain.getHeight(), Gravity.BOTTOM|Gravity.RIGHT)); + viewGroup.addView(androidView, new android.widget.FrameLayout.LayoutParams(glWindowMain.getSurfaceWidth(), glWindowMain.getSurfaceHeight(), Gravity.BOTTOM|Gravity.RIGHT)); registerNEWTWindow(glWindowMain); } anim.add(glWindowMain); @@ -219,7 +219,7 @@ public class MovieSimpleActivity1 extends NewtBaseActivity { public void run() { final android.view.View androidView = ((jogamp.newt.driver.android.WindowDriver)glWindowHUD.getDelegatedWindow()).getAndroidView(); // addContentView(getWindow(), glWindowHUD, new android.view.ViewGroup.LayoutParams(glWindowHUD.getWidth(), glWindowHUD.getHeight())); - viewGroup.addView(androidView, new android.widget.FrameLayout.LayoutParams(glWindowHUD.getWidth(), glWindowHUD.getHeight(), Gravity.TOP|Gravity.LEFT)); + viewGroup.addView(androidView, new android.widget.FrameLayout.LayoutParams(glWindowHUD.getSurfaceWidth(), glWindowHUD.getSurfaceHeight(), Gravity.TOP|Gravity.LEFT)); registerNEWTWindow(glWindowHUD); anim.add(glWindowHUD); glWindowHUD.setVisible(true); diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue326Test2.java b/src/test/com/jogamp/opengl/test/bugs/Issue326Test2.java index ac5d819b3..2a8fd3a39 100644 --- a/src/test/com/jogamp/opengl/test/bugs/Issue326Test2.java +++ b/src/test/com/jogamp/opengl/test/bugs/Issue326Test2.java @@ -47,7 +47,7 @@ public class Issue326Test2 extends Frame implements GLEventListener { gl.glClearColor(0, 0, 0, 0); gl.glClear(GL2.GL_COLOR_BUFFER_BIT|GL2.GL_DEPTH_BUFFER_BIT); - tr.beginRendering(drawable.getWidth(), drawable.getHeight()); + tr.beginRendering(drawable.getSurfaceWidth(), drawable.getSurfaceHeight()); tr.draw("LA CLAPI\u00c8RE \nAlt: 1100-1700m \nGlissement de terrain majeur", 16, 80); tr.draw("dans la haute Tin\u00e9e, sur un flanc du Parc du Mercantour.", 16, 16); tr.endRendering(); diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT00.java b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT00.java index ae435961e..ad95b3502 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT00.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT00.java @@ -334,7 +334,7 @@ public class TestTextRendererNEWT00 extends UITestCase { final String modeS = Region.getRenderModeString(renderModes); final String bname = String.format("%s-msaa%02d-fontsz%02.1f-%03dx%03d-%s%04d", objName, drawable.getChosenGLCapabilities().getNumSamples(), - TestTextRendererNEWT00.fontSizeFixed, drawable.getWidth(), drawable.getHeight(), modeS, vbaaSampleCount[0]); + TestTextRendererNEWT00.fontSizeFixed, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), modeS, vbaaSampleCount[0]); final String filename = dir + bname +".png"; if(screenshot.readPixels(drawable.getGL(), false)) { screenshot.write(new File(filename)); diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java index 0235a78c2..de71f65d3 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java @@ -150,10 +150,10 @@ public class TestTextRendererNEWT10 extends UITestCase { rs.setColorStatic(0.1f, 0.1f, 0.1f, 1.0f); // reshape - gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight()); + gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight()); // renderer.reshapePerspective(gl, 45.0f, drawable.getWidth(), drawable.getHeight(), 0.1f, 1000.0f); - renderer.reshapeOrtho(drawable.getWidth(), drawable.getHeight(), 0.1f, 1000.0f); + renderer.reshapeOrtho(drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), 0.1f, 1000.0f); // display gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); @@ -181,7 +181,7 @@ public class TestTextRendererNEWT10 extends UITestCase { int lastRow = -1; void renderString(GLDrawable drawable, GL2ES2 gl, RegionRenderer renderer, TextRegionUtil textRenderUtil, String text, int column, int row, int z0) { - final int height = drawable.getHeight(); + final int height = drawable.getSurfaceHeight(); int dx = 0; int dy = height; diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java b/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java index ebd526899..f948b9beb 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java @@ -246,7 +246,7 @@ public abstract class TextRendererGLELBase implements GLEventListener { if( !exclusivePMVMatrix ) { dy = 1f-ty; } else { - final int height = drawable.getHeight(); + final int height = drawable.getSurfaceHeight(); dy = height-ty; } final int newLineCount = TextRegionUtil.getCharCount(text, '\n'); diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java index 72c2509cc..ef72b3d45 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java @@ -234,7 +234,7 @@ public abstract class GPURendererListenerBase01 implements GLEventListener { public void printScreen(GLAutoDrawable drawable, String dir, String tech, String objName, boolean exportAlpha) throws GLException, IOException { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); - pw.printf("-%03dx%03d-Z%04d-S%02d-%s", drawable.getWidth(), drawable.getHeight(), (int)Math.abs(zTran), sampleCount[0], objName); + pw.printf("-%03dx%03d-Z%04d-S%02d-%s", drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), (int)Math.abs(zTran), sampleCount[0], objName); final String filename = dir + tech + sw +".png"; if(screenshot.readPixels(drawable.getGL(), false)) { diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java index 891151e38..89aa4d0ee 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java @@ -199,8 +199,8 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB @Override public void display(GLAutoDrawable drawable) { - final int width = drawable.getWidth(); - final int height = drawable.getHeight(); + final int width = drawable.getSurfaceWidth(); + final int height = drawable.getSurfaceHeight(); GL2ES2 gl = drawable.getGL().getGL2ES2(); gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f); diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java index a2c3faecf..b52668294 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java @@ -631,7 +631,7 @@ public class GPUUISceneGLListener0A implements GLEventListener { sceneUIController.setRenderer(renderer); - final float pixelSizeFixed = fontSizeFixedPVP * drawable.getHeight(); + final float pixelSizeFixed = fontSizeFixedPVP * drawable.getSurfaceHeight(); jogampLabel = new Label(renderer.getRenderState().getVertexFactory(), renderModes, font, pixelSizeFixed, jogamp); jogampLabel.addMouseListener(dragZoomRotateListener); sceneUIController.addShape(jogampLabel); @@ -650,7 +650,7 @@ public class GPUUISceneGLListener0A implements GLEventListener { * [Label] Display 112.88889 dpi, fontSize 12.0 ppi -> pixelSize 18.814816 * [FPS] Display 112.88889 dpi, fontSize 12.0 ppi -> pixelSize 15.679012 */ - final float pixelSizeFPS = fontSizeFpsPVP * drawable.getHeight(); + final float pixelSizeFPS = fontSizeFpsPVP * drawable.getSurfaceHeight(); fpsLabel = new Label(renderer.getRenderState().getVertexFactory(), renderModes, font, pixelSizeFPS, "Nothing there yet"); fpsLabel.addMouseListener(dragZoomRotateListener); sceneUIController.addShape(fpsLabel); @@ -663,7 +663,7 @@ public class GPUUISceneGLListener0A implements GLEventListener { crossHairCtr.setEnabled(true); crossHairCtr.translate(0f, 0f, -1f); - initButtons(gl, drawable.getWidth(), drawable.getHeight(), renderer); + initButtons(gl, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), renderer); for(int i=0; i 1) { @@ -224,7 +224,7 @@ public class TestFBOMRTNEWT01 extends UITestCase { texCoords0.enableBuffer(gl, true); gl.glDrawBuffers(1, bck_buffers, 0); - gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight()); + gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight()); gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit0.intValue()); fbo_mrt.use(gl, texA0); @@ -241,11 +241,11 @@ public class TestFBOMRTNEWT01 extends UITestCase { { final NativeSurface ns = gl.getContext().getGLReadDrawable().getNativeSurface(); - if(last_snap_size[0] != ns.getWidth() && last_snap_size[1] != ns.getHeight()) { + if(last_snap_size[0] != ns.getSurfaceWidth() && last_snap_size[1] != ns.getSurfaceHeight()) { gl.glFinish(); // sync .. no swap buffers yet! snapshot(step_i, null, gl, screenshot, TextureIO.PNG, null); // overwrite ok - last_snap_size[0] = ns.getWidth(); - last_snap_size[1] = ns.getHeight(); + last_snap_size[0] = ns.getSurfaceWidth(); + last_snap_size[1] = ns.getSurfaceHeight(); } } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMix2DemosES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMix2DemosES2NEWT.java index 42f7ba652..d337bf938 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMix2DemosES2NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMix2DemosES2NEWT.java @@ -102,8 +102,8 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase { public void display(GLAutoDrawable drawable) { if(mainRun) return; - final int dw = drawable.getWidth(); - final int dh = drawable.getHeight(); + final int dw = drawable.getSurfaceWidth(); + final int dh = drawable.getSurfaceHeight(); c++; if(dw<800) { @@ -147,10 +147,10 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase { glWindow.addWindowListener(new WindowAdapter() { public void windowResized(WindowEvent e) { - System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()); + System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()); } public void windowMoved(WindowEvent e) { - System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()); + System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()); } }); @@ -163,9 +163,9 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase { if(e.getKeyChar()=='f') { new Thread() { public void run() { - System.err.println("[set fullscreen pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); + System.err.println("[set fullscreen pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); glWindow.setFullscreen(!glWindow.isFullscreen()); - System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); + System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); } }.start(); } else if(e.getKeyChar()=='d') { demo.setDemo0Only(!demo.getDemo0Only()); @@ -187,7 +187,7 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase { System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities()); System.err.println("GL chosen: "+glWindow.getChosenCapabilities()); - System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); + System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets()); animator.setUpdateFPSFrames(60, showFPS ? System.err : null); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java index 51dd9df37..f1c019f2c 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java @@ -134,7 +134,7 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase { // FBOD1 final GLOffscreenAutoDrawable.FBO fbod1 = (GLOffscreenAutoDrawable.FBO) - factory.createOffscreenAutoDrawable(null, fbodCaps, null, glWindow.getWidth(), glWindow.getHeight()); + factory.createOffscreenAutoDrawable(null, fbodCaps, null, glWindow.getSurfaceWidth(), glWindow.getSurfaceHeight()); fbod1.setSharedAutoDrawable(glWindow); fbod1.setUpstreamWidget(glWindow); // connect the real GLWindow (mouse/key) to offscreen! fbod1.setTextureUnit(fbod1_texUnit); @@ -155,7 +155,7 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase { // FBOD2 final GLOffscreenAutoDrawable.FBO fbod2 = (GLOffscreenAutoDrawable.FBO) - factory.createOffscreenAutoDrawable(null, fbodCaps, null, glWindow.getWidth(), glWindow.getHeight()); + factory.createOffscreenAutoDrawable(null, fbodCaps, null, glWindow.getSurfaceWidth(), glWindow.getSurfaceHeight()); fbod2.setSharedAutoDrawable(glWindow); fbod2.setTextureUnit(fbod2_texUnit); fbod2.addGLEventListener(new RedSquareES2(-1)); @@ -181,8 +181,8 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase { public void display(GLAutoDrawable drawable) { if(mainRun) return; - final int dw = drawable.getWidth(); - final int dh = drawable.getHeight(); + final int dw = drawable.getSurfaceWidth(); + final int dh = drawable.getSurfaceHeight(); c++; if(dw<800) { @@ -222,10 +222,10 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase { glWindow.addWindowListener(new WindowAdapter() { public void windowResized(WindowEvent e) { - System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()); + System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()); } public void windowMoved(WindowEvent e) { - System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()); + System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()); } }); @@ -237,7 +237,7 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase { System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities()); System.err.println("GL chosen: "+glWindow.getChosenCapabilities()); - System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); + System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets()); animator0.setUpdateFPSFrames(30, showFPS ? System.err : null); animator1.setUpdateFPSFrames(60, showFPS ? System.err : null); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java index 3c6c61f80..baa8a965b 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java @@ -131,7 +131,7 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase { // FBOD1 final GLOffscreenAutoDrawable.FBO fbod1 = (GLOffscreenAutoDrawable.FBO) - factory.createOffscreenAutoDrawable(null, fbodCaps, null, glWindow.getWidth(), glWindow.getHeight()); + factory.createOffscreenAutoDrawable(null, fbodCaps, null, glWindow.getSurfaceWidth(), glWindow.getSurfaceHeight()); fbod1.setSharedAutoDrawable(glWindow); fbod1.setUpstreamWidget(glWindow); // connect the real GLWindow (mouse/key) to offscreen! fbod1.setTextureUnit(fbod1_texUnit); @@ -156,7 +156,7 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase { glWindow.addWindowListener(new WindowAdapter() { @Override public void windowResized(WindowEvent e) { - fbod1.setSize(glWindow.getWidth(), glWindow.getHeight()); + fbod1.setSize(glWindow.getSurfaceWidth(), glWindow.getSurfaceHeight()); } }); glWindow.addGLEventListener(mixerDemo); @@ -167,8 +167,8 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase { public void display(GLAutoDrawable drawable) { if(mainRun) return; - final int dw = drawable.getWidth(); - final int dh = drawable.getHeight(); + final int dw = drawable.getSurfaceWidth(); + final int dh = drawable.getSurfaceHeight(); c++; if(dw<800) { @@ -202,10 +202,10 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase { glWindow.addWindowListener(new WindowAdapter() { public void windowResized(WindowEvent e) { - System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()); + System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()); } public void windowMoved(WindowEvent e) { - System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()); + System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()); } }); @@ -216,7 +216,7 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase { System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities()); System.err.println("GL chosen: "+glWindow.getChosenCapabilities()); - System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); + System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets()); animator1.setUpdateFPSFrames(60, showFPS ? System.err : null); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateNEWT.java index 91bae16d7..597d72269 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateNEWT.java @@ -111,7 +111,7 @@ public class TestGLAutoDrawableDelegateNEWT extends UITestCase { @Override public void windowResized(WindowEvent e) { - glad.windowResizedOp(window.getWidth(), window.getHeight()); + glad.windowResizedOp(window.getSurfaceWidth(), window.getSurfaceHeight()); } }); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java index 3d49a0dce..82fa6422d 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java @@ -185,7 +185,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase { @Override public void windowResized(WindowEvent e) { - glad.windowResizedOp(window.getWidth(), window.getHeight()); + glad.windowResizedOp(window.getSurfaceWidth(), window.getSurfaceHeight()); } }); @@ -197,7 +197,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase { glad.display(); // initial resize/display // 1 - szStep = 2 - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -205,7 +205,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase { // 2, 3 (resize + display) szStep = 1; window.setSize(widthStep*szStep, heightStep*szStep); - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -213,7 +213,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase { // 4, 5 (resize + display) szStep = 4; window.setSize(widthStep*szStep, heightStep*szStep); - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java index a5799a6cb..33c0508a1 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java @@ -127,7 +127,7 @@ public class TestGLAutoDrawableFactoryES2OffscrnCapsNEWT extends UITestCase { glad.display(); // initial resize/display // 1 - szStep = 2 - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -135,7 +135,7 @@ public class TestGLAutoDrawableFactoryES2OffscrnCapsNEWT extends UITestCase { // 2, 3 (resize + display) szStep = 1; glad.setSize(widthStep*szStep, heightStep*szStep); - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -143,7 +143,7 @@ public class TestGLAutoDrawableFactoryES2OffscrnCapsNEWT extends UITestCase { // 4, 5 (resize + display) szStep = 4; glad.setSize(widthStep*szStep, heightStep*szStep); - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java index 09e211332..f482a4468 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java @@ -127,7 +127,7 @@ public class TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT extends UITestCase { glad.display(); // initial resize/display // 1 - szStep = 2 - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -135,7 +135,7 @@ public class TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT extends UITestCase { // 2, 3 (resize + display) szStep = 1; glad.setSize(widthStep*szStep, heightStep*szStep); - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -143,7 +143,7 @@ public class TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT extends UITestCase { // 4, 5 (resize + display) szStep = 4; glad.setSize(widthStep*szStep, heightStep*szStep); - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java index f35f8c8b0..2f3c8c7e8 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java @@ -119,7 +119,7 @@ public class TestGLAutoDrawableFactoryGLnBitmapCapsNEWT extends UITestCase { glad.display(); // initial resize/display // 1 - szStep = 2 - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -127,7 +127,7 @@ public class TestGLAutoDrawableFactoryGLnBitmapCapsNEWT extends UITestCase { // 2, 3 (resize + display) szStep = 1; glad.setSize(widthStep*szStep, heightStep*szStep); - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -135,7 +135,7 @@ public class TestGLAutoDrawableFactoryGLnBitmapCapsNEWT extends UITestCase { // 4, 5 (resize + display) szStep = 4; glad.setSize(widthStep*szStep, heightStep*szStep); - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java index ab64b5def..888572444 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java @@ -196,7 +196,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase { glad.display(); // initial resize/display // 1 - szStep = 2 - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -204,7 +204,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase { // 2, 3 (resize + display) szStep = 1; setGLCanvasSize(frame, glad, widthStep*szStep, heightStep*szStep); - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); glad.display(); snapshotGLEventListener.setMakeSnapshot(); @@ -213,7 +213,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase { // 4, 5 (resize + display) szStep = 4; setGLCanvasSize(frame, glad, widthStep*szStep, heightStep*szStep); - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); glad.display(); snapshotGLEventListener.setMakeSnapshot(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java index 9332b0f2e..4cdbb6fb0 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java @@ -152,7 +152,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase { glad.display(); // initial resize/display // 1 - szStep = 2 - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -160,7 +160,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase { // 2, 3 (resize + display) szStep = 1; glad.setSize(widthStep*szStep, heightStep*szStep); - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -168,7 +168,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase { // 4, 5 (resize + display) szStep = 4; glad.setSize(widthStep*szStep, heightStep*szStep); - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java index ae5dc614b..22a515f42 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java @@ -208,7 +208,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase glad.display(); // initial resize/display // 1 - szStep = 2 - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -216,7 +216,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase // 2, 3 (resize + display) szStep = 1; setComponentSize(frame, nca, widthStep*szStep, heightStep*szStep); - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); glad.display(); snapshotGLEventListener.setMakeSnapshot(); @@ -225,7 +225,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase // 4, 5 (resize + display) szStep = 4; setComponentSize(frame, nca, widthStep*szStep, heightStep*szStep); - Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), + Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); glad.display(); snapshotGLEventListener.setMakeSnapshot(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLContextSurfaceLockNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLContextSurfaceLockNEWT.java index c64bb3854..1e78e492c 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLContextSurfaceLockNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLContextSurfaceLockNEWT.java @@ -108,7 +108,7 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase { win.runOnEDTIfAvail(true, new Runnable() { public void run() { // Normal resize, may trigger immediate display within lock - win.setSize(win.getWidth()+1, win.getHeight()+1); + win.setSize(win.getSurfaceWidth()+1, win.getSurfaceHeight()+1); // Force display within surface lock. // This procedure emulates the sensitive behavior diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLCanvasAWT.java index 0f77affe1..1da40728a 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLCanvasAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLCanvasAWT.java @@ -201,7 +201,7 @@ public class TestGLReadBuffer01GLCanvasAWT extends GLReadBuffer00Base { final GLDrawable drawable = gl.getContext().getGLReadDrawable(); final String postSNDetail = String.format("awt-usr%03d", textRendererGLEL.userCounter); final String filenameAWT = getSnapshotFilename(sn, postSNDetail, - drawable.getChosenGLCapabilities(), drawable.getWidth(), drawable.getHeight(), + drawable.getChosenGLCapabilities(), drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), glReadBufferUtil.hasAlpha(), fileSuffix, destPath); if( swapBuffersBeforeRead ) { drawable.swapBuffers(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLJPanelAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLJPanelAWT.java index e93356d50..633a54ecc 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLJPanelAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLJPanelAWT.java @@ -203,7 +203,7 @@ public class TestGLReadBuffer01GLJPanelAWT extends GLReadBuffer00Base { final GLDrawable drawable = gl.getContext().getGLReadDrawable(); final String postSNDetail = String.format("awt-usr%03d", textRendererGLEL.userCounter); final String filenameAWT = getSnapshotFilename(sn, postSNDetail, - drawable.getChosenGLCapabilities(), drawable.getWidth(), drawable.getHeight(), + drawable.getChosenGLCapabilities(), drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), glReadBufferUtil.hasAlpha(), fileSuffix, destPath); if( swapBuffersBeforeRead ) { drawable.swapBuffers(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLWindowNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLWindowNEWT.java index a170d9b14..e6ce9e548 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLWindowNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLWindowNEWT.java @@ -86,7 +86,7 @@ public class TestGLReadBuffer01GLWindowNEWT extends GLReadBuffer00Base { throwable.printStackTrace(); Assume.assumeNoException( throwable ); } - final DimensionImmutable size0 = new Dimension(glad.getWidth(), glad.getHeight()); + final DimensionImmutable size0 = new Dimension(glad.getSurfaceWidth(), glad.getSurfaceHeight()); final DimensionImmutable size1 = new Dimension(size0.getWidth()+100, size0.getHeight()+100); final DimensionImmutable size2 = new Dimension(size0.getWidth()-100, size0.getHeight()-100); try { @@ -155,7 +155,7 @@ public class TestGLReadBuffer01GLWindowNEWT extends GLReadBuffer00Base { final GL gl = drawable.getGL(); final String postSNDetail = String.format("jgl-usr%03d", textRendererGLEL.userCounter); final String filenameJGL = getSnapshotFilename(sn, postSNDetail, - drawable.getChosenGLCapabilities(), drawable.getWidth(), drawable.getHeight(), + drawable.getChosenGLCapabilities(), drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), glReadBufferUtil.hasAlpha(), fileSuffix, destPath); if( swapBuffersBeforeRead ) { drawable.swapBuffers(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestX11DefaultDisplay.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestX11DefaultDisplay.java index fca2beb73..deb800441 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestX11DefaultDisplay.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestX11DefaultDisplay.java @@ -89,7 +89,7 @@ public class TestX11DefaultDisplay extends UITestCase { System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities()); System.err.println("GL chosen: "+glWindow.getChosenCapabilities()); - System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); + System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets()); animator.setUpdateFPSFrames(60, System.err); snap.setMakeSnapshot(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch01NEWT.java index 633d9de3b..8ad3e0242 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch01NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch01NEWT.java @@ -123,7 +123,7 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase { } @Override public void windowResized(WindowEvent e) { - glad.windowResizedOp(window.getWidth(), window.getHeight()); + glad.windowResizedOp(window.getSurfaceWidth(), window.getSurfaceHeight()); } }); window.addWindowListener(wl); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch10NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch10NEWT.java index 4225cd988..52743d819 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch10NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch10NEWT.java @@ -135,7 +135,7 @@ public class TestGLContextDrawableSwitch10NEWT extends UITestCase { } @Override public void windowResized(WindowEvent e) { - glad.windowResizedOp(window.getWidth(), window.getHeight()); + glad.windowResizedOp(window.getSurfaceWidth(), window.getSurfaceHeight()); } }); window.addWindowListener(wl); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816GLCanvasFrameHoppingB849B889AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816GLCanvasFrameHoppingB849B889AWT.java index 51d00a5a1..913dad8d0 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816GLCanvasFrameHoppingB849B889AWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816GLCanvasFrameHoppingB849B889AWT.java @@ -245,7 +245,7 @@ public class TestBug816GLCanvasFrameHoppingB849B889AWT extends UITestCase { static void dumpGLCanvasStats(GLCanvas glCanvas) { System.err.println("XXXX GLCanvas: comp "+glCanvas+", visible "+glCanvas.isVisible()+", showing "+glCanvas.isShowing()+ - ", displayable "+glCanvas.isDisplayable()+", "+glCanvas.getWidth()+"x"+glCanvas.getHeight()); + ", displayable "+glCanvas.isDisplayable()+", "+glCanvas.getSurfaceWidth()+"x"+glCanvas.getSurfaceHeight()); } public static void main(String args[]) { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java index 84af232d4..091dc5378 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java @@ -178,7 +178,7 @@ public class TestBug816JTabbedPanelVisibilityB849B878AWT extends UITestCase { static void dumpGLCanvasStats(GLCanvas glCanvas) { System.err.println("XXXX GLCanvas: comp "+glCanvas+", visible "+glCanvas.isVisible()+", showing "+glCanvas.isShowing()+ - ", displayable "+glCanvas.isDisplayable()+", "+glCanvas.getWidth()+"x"+glCanvas.getHeight()); + ", displayable "+glCanvas.isDisplayable()+", "+glCanvas.getSurfaceWidth()+"x"+glCanvas.getSurfaceHeight()); } public static void main(String args[]) { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos01AWT.java index ace578e7a..443908ff8 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos01AWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos01AWT.java @@ -259,9 +259,9 @@ public class TestBug816OSXCALayerPos01AWT extends UITestCase { Assert.assertTrue(animator.isStarted()); Assert.assertTrue(animator.isAnimating()); - System.err.println("canvas1 pos/siz: "+glCanvas1.getX()+"/"+glCanvas1.getY()+" "+glCanvas1.getWidth()+"x"+glCanvas1.getHeight()); + System.err.println("canvas1 pos/siz: "+glCanvas1.getX()+"/"+glCanvas1.getY()+" "+glCanvas1.getSurfaceWidth()+"x"+glCanvas1.getSurfaceHeight()); if( twoCanvas ) { - System.err.println("canvas2 pos/siz: "+glCanvas2.getX()+"/"+glCanvas2.getY()+" "+glCanvas2.getWidth()+"x"+glCanvas2.getHeight()); + System.err.println("canvas2 pos/siz: "+glCanvas2.getX()+"/"+glCanvas2.getY()+" "+glCanvas2.getSurfaceWidth()+"x"+glCanvas2.getSurfaceHeight()); } Thread.sleep(Math.max(1000, duration/2)); @@ -273,9 +273,9 @@ public class TestBug816OSXCALayerPos01AWT extends UITestCase { } else { setFrameSize(frame, true, frameRSizeHalf); } - System.err.println("resize canvas1 pos/siz: "+glCanvas1.getX()+"/"+glCanvas1.getY()+" "+glCanvas1.getWidth()+"x"+glCanvas1.getHeight()); + System.err.println("resize canvas1 pos/siz: "+glCanvas1.getX()+"/"+glCanvas1.getY()+" "+glCanvas1.getSurfaceWidth()+"x"+glCanvas1.getSurfaceHeight()); if( twoCanvas ) { - System.err.println("resize canvas2 pos/siz: "+glCanvas2.getX()+"/"+glCanvas2.getY()+" "+glCanvas2.getWidth()+"x"+glCanvas2.getHeight()); + System.err.println("resize canvas2 pos/siz: "+glCanvas2.getX()+"/"+glCanvas2.getY()+" "+glCanvas2.getSurfaceWidth()+"x"+glCanvas2.getSurfaceHeight()); } } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererGLEventListener01.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererGLEventListener01.java index c96684598..3a9f643dc 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererGLEventListener01.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererGLEventListener01.java @@ -96,7 +96,7 @@ public class TextRendererGLEventListener01 implements GLEventListener { public void display(GLAutoDrawable drawable) { if (disallowedMethodCalls.equals("")) { if (testNumber == 1) { - renderer.beginRendering(drawable.getWidth(), drawable.getHeight()); + renderer.beginRendering(drawable.getSurfaceWidth(), drawable.getSurfaceHeight()); renderer.setColor(1.0f, 1.0f, 1.0f, 1.0f); renderer.draw(text, 0, 0); renderer.endRendering(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageAWT.java index e87c34419..25883f641 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageAWT.java @@ -82,8 +82,8 @@ public class TestBug605FlippedImageAWT extends UITestCase { } gl.glFinish(); - final int width = drawable.getWidth(); - final int height = drawable.getHeight(); + final int width = drawable.getSurfaceWidth(); + final int height = drawable.getSurfaceHeight(); final String fname = getSnapshotFilename(0, null, caps, width, height, false, TextureIO.PNG, null); try { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageNEWT.java index 28fcb9885..ed4e702f4 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageNEWT.java @@ -130,7 +130,7 @@ public class TestBug605FlippedImageNEWT extends UITestCase { glad.display(); System.err.println("XXX "+glad.getChosenGLCapabilities()); System.err.println("XXX "+glad.getContext().getGLVersion()); - testFlipped((ByteBuffer)rbu.getPixelBuffer().buffer, glad.getWidth(), glad.getHeight(), 3); + testFlipped((ByteBuffer)rbu.getPixelBuffer().buffer, glad.getSurfaceWidth(), glad.getSurfaceHeight(), 3); glad.destroy(); } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java index f4c5e8b2f..218093689 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java @@ -325,8 +325,8 @@ public class GearsES1 implements GLEventListener { Object source = e.getSource(); if(source instanceof Window) { Window window = (Window) source; - width=window.getWidth(); - height=window.getHeight(); + width=window.getSurfaceWidth(); + height=window.getSurfaceHeight(); } else if (GLProfile.isAWTAvailable() && source instanceof java.awt.Component) { java.awt.Component comp = (java.awt.Component) source; width=comp.getWidth(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/ElektronenMultiplizierer.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/ElektronenMultiplizierer.java index 3120a1832..6080ed2c2 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/ElektronenMultiplizierer.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/ElektronenMultiplizierer.java @@ -244,8 +244,8 @@ public class ElektronenMultiplizierer implements GLEventListener { sp0.add(gl, fp0, System.err); st.attachShaderProgram(gl, sp0, true); - final float XRESf = (float) drawable.getWidth(); - final float YRESf = (float) drawable.getHeight(); + final float XRESf = (float) drawable.getSurfaceWidth(); + final float YRESf = (float) drawable.getSurfaceHeight(); mScreenDimensionUniform = new GLUniformData("resolution", 2, Buffers.newDirectFloatBuffer(2)); final FloatBuffer mScreenDimensionV = (FloatBuffer) mScreenDimensionUniform.getBuffer(); @@ -334,8 +334,8 @@ public class ElektronenMultiplizierer implements GLEventListener { GL2ES2 gl = drawable.getGL().getGL2ES2(); - final int XRES = drawable.getWidth(); - final int YRES = drawable.getHeight(); + final int XRES = drawable.getSurfaceWidth(); + final int YRES = drawable.getSurfaceHeight(); // if (!getBaseMusic().isOffline()) { // //if music IS used sync to first second of music ... diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java index add11ff8c..1de15f594 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java @@ -154,8 +154,8 @@ public class FBOMix2DemosES2 implements GLEventListener { fbo0.detachAllColorbuffer(gl); fbo1.detachAllColorbuffer(gl); - fbo0.reset(gl, drawable.getWidth(), drawable.getHeight(), numSamples, false); - fbo1.reset(gl, drawable.getWidth(), drawable.getHeight(), numSamples, false); + fbo0.reset(gl, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), numSamples, false); + fbo1.reset(gl, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), numSamples, false); if(fbo0.getNumSamples() != fbo1.getNumSamples()) { throw new InternalError("sample size mismatch: \n\t0: "+fbo0+"\n\t1: "+fbo1); } @@ -180,8 +180,8 @@ public class FBOMix2DemosES2 implements GLEventListener { } private void resetFBOs(GL gl, GLAutoDrawable drawable) { - fbo0.reset(gl, drawable.getWidth(), drawable.getHeight(), numSamples, true); - fbo1.reset(gl, drawable.getWidth(), drawable.getHeight(), numSamples, true); + fbo0.reset(gl, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), numSamples, true); + fbo1.reset(gl, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), numSamples, true); if(fbo0.getNumSamples() != fbo1.getNumSamples()) { throw new InternalError("sample size mismatch: \n\t0: "+fbo0+"\n\t1: "+fbo1); } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java index 653937a7e..09fd911a7 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java @@ -449,7 +449,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL if(null != sharedGears && !sharedGears.isInit() ) { return; } GLAnimatorControl anim = drawable.getAnimator(); if( verbose && ( null == anim || !anim.isAnimating() ) ) { - System.err.println(Thread.currentThread()+" GearsES2.display "+sid()+" "+drawable.getWidth()+"x"+drawable.getHeight()+", swapInterval "+swapInterval+", drawable 0x"+Long.toHexString(drawable.getHandle())); + System.err.println(Thread.currentThread()+" GearsES2.display "+sid()+" "+drawable.getSurfaceWidth()+"x"+drawable.getSurfaceHeight()+", swapInterval "+swapInterval+", drawable 0x"+Long.toHexString(drawable.getHandle())); } // Turn the gears' teeth if(doRotate) { @@ -611,12 +611,12 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL Window window = null; if(source instanceof Window) { window = (Window) source; - width=window.getWidth(); - height=window.getHeight(); + width=window.getSurfaceWidth(); + height=window.getSurfaceHeight(); } else if (source instanceof GLAutoDrawable) { GLAutoDrawable glad = (GLAutoDrawable) source; - width = glad.getWidth(); - height = glad.getHeight(); + width = glad.getSurfaceWidth(); + height = glad.getSurfaceHeight(); } else if (GLProfile.isAWTAvailable() && source instanceof java.awt.Component) { java.awt.Component comp = (java.awt.Component) source; width=comp.getWidth(); @@ -629,8 +629,8 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL view_rotx += thetaX; view_roty += thetaY; if(e.isConfined() && confinedFixedCenter && null!=window) { - x=window.getWidth()/2; - y=window.getHeight()/2; + x=window.getSurfaceWidth()/2; + y=window.getSurfaceHeight()/2; window.warpPointer(x, y); } prevMouseX = x; diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/LandscapeES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/LandscapeES2.java index e7f980ccd..641aed7d7 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/LandscapeES2.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/LandscapeES2.java @@ -94,7 +94,7 @@ public class LandscapeES2 implements GLEventListener { shaderState = new ShaderState(); shaderState.attachShaderProgram(gl, shaderProg, true); - resolution = new float[] { drawable.getWidth(), drawable.getHeight(), 0}; + resolution = new float[] { drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), 0}; resolutionUni = new GLUniformData("iResolution", 3, FloatBuffer.wrap(resolution)); shaderState.ownUniform(resolutionUni); shaderState.uniform(gl, resolutionUni); @@ -127,8 +127,8 @@ public class LandscapeES2 implements GLEventListener { shaderState.useProgram(gl, true); - resolution[0] = drawable.getWidth(); - resolution[1] = drawable.getHeight(); + resolution[0] = drawable.getSurfaceWidth(); + resolution[1] = drawable.getSurfaceHeight(); shaderState.uniform(gl, resolutionUni); shaderState.useProgram(gl, false); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java index aac0080f2..3cc667f99 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java @@ -183,7 +183,7 @@ public class TextureDraw02ES2ListenerFBO implements GLEventListener { if( fbo0.getNumSamples() != numSamples ) { System.err.println("**** NumSamples: "+fbo0.getNumSamples()+" -> "+numSamples); - resetFBOs(gl, drawable.getWidth(), drawable.getHeight()); + resetFBOs(gl, drawable.getSurfaceWidth(), drawable.getSurfaceHeight()); } if(0 < numSamples) { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java index cdee78fe9..17332a4e2 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java @@ -96,8 +96,8 @@ public class TextureSequenceCubeES2 implements GLEventListener { Window window = null; if(source instanceof Window) { window = (Window) source; - width=window.getWidth(); - height=window.getHeight(); + width=window.getSurfaceWidth(); + height=window.getSurfaceHeight(); } else if (GLProfile.isAWTAvailable() && source instanceof java.awt.Component) { java.awt.Component comp = (java.awt.Component) source; width=comp.getWidth(); @@ -217,7 +217,7 @@ public class TextureSequenceCubeES2 implements GLEventListener { st.useProgram(gl, true); pmvMatrix = new PMVMatrix(); - reshapePMV(drawable.getWidth(), drawable.getHeight()); + reshapePMV(drawable.getSurfaceWidth(), drawable.getSurfaceHeight()); pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv if(!st.uniform(gl, pmvMatrixUniform)) { throw new GLException("Error setting PMVMatrix in shader: "+st); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java index c3d1d8ae5..730e6e562 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java @@ -448,7 +448,7 @@ public class MovieCube implements GLEventListener { System.err.println("XXX resetGLState"); disposeImpl(drawable, false); init(drawable); - reshape(drawable, 0, 0, drawable.getWidth(), drawable.getHeight()); + reshape(drawable, 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight()); } final long currentPos = System.currentTimeMillis(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java index 9cb395826..7afd31352 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java @@ -181,7 +181,7 @@ public class MovieSimple implements GLEventListener { // Note: MODELVIEW is from [ 0 .. height ] - final int height = drawable.getHeight(); + final int height = drawable.getSurfaceHeight(); final float aspect = (float)mPlayer.getWidth() / (float)mPlayer.getHeight(); @@ -526,7 +526,7 @@ public class MovieSimple implements GLEventListener { // Push the 1st uniform down the path st.useProgram(gl, true); - int[] viewPort = new int[] { 0, 0, drawable.getWidth(), drawable.getHeight()}; + int[] viewPort = new int[] { 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight()}; pmvMatrix = new PMVMatrix(); reshapePMV(viewPort[2], viewPort[3]); pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); @@ -537,8 +537,8 @@ public class MovieSimple implements GLEventListener { throw new GLException("Error setting mgl_ActiveTexture in shader: "+st); } - float dWidth = drawable.getWidth(); - float dHeight = drawable.getHeight(); + float dWidth = drawable.getSurfaceWidth(); + float dHeight = drawable.getSurfaceHeight(); float mWidth = mPlayer.getWidth(); float mHeight = mPlayer.getHeight(); float mAspect = mWidth/mHeight; @@ -602,8 +602,8 @@ public class MovieSimple implements GLEventListener { final Window window = (Window) upstreamWidget; window.addMouseListener(mouseAction); window.addKeyListener(keyAction); - winWidth = window.getWidth(); - winHeight = window.getHeight(); + winWidth = window.getSurfaceWidth(); + winHeight = window.getSurfaceHeight(); } final int rmode = drawable.getChosenGLCapabilities().getSampleBuffers() ? 0 : Region.VBAA_RENDERING_BIT; final boolean lowPerfDevice = gl.isGLES(); @@ -755,7 +755,7 @@ public class MovieSimple implements GLEventListener { System.err.println("XXX resetGLState"); disposeImpl(drawable, false); init(drawable); - reshape(drawable, 0, 0, drawable.getWidth(), drawable.getHeight()); + reshape(drawable, 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight()); } final long currentPos = System.currentTimeMillis(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java index 58600dacd..96a120c62 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java @@ -237,14 +237,14 @@ public class TestGearsES2AWT extends UITestCase { animator.setUpdateFPSFrames(60, System.err); } - System.err.println("canvas pos/siz: "+glCanvas.getX()+"/"+glCanvas.getY()+" "+glCanvas.getWidth()+"x"+glCanvas.getHeight()); + System.err.println("canvas pos/siz: "+glCanvas.getX()+"/"+glCanvas.getY()+" "+glCanvas.getSurfaceWidth()+"x"+glCanvas.getSurfaceHeight()); snap.setMakeSnapshot(); if( null != rwsize ) { Thread.sleep(500); // 500ms delay setSize(resizeBy, frame, true, glCanvas, rwsize); - System.err.println("window resize pos/siz: "+glCanvas.getX()+"/"+glCanvas.getY()+" "+glCanvas.getWidth()+"x"+glCanvas.getHeight()); + System.err.println("window resize pos/siz: "+glCanvas.getX()+"/"+glCanvas.getY()+" "+glCanvas.getSurfaceWidth()+"x"+glCanvas.getSurfaceHeight()); } snap.setMakeSnapshot(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java index 46e39bebf..55616c15f 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java @@ -148,7 +148,7 @@ public class TestGearsES2GLJPanelAWT extends UITestCase { if( null != rwsize ) { Thread.sleep(500); // 500ms delay setFrameSize(frame, true, rwsize); - System.err.println("window resize pos/siz: "+glJPanel.getX()+"/"+glJPanel.getY()+" "+glJPanel.getWidth()+"x"+glJPanel.getHeight()); + System.err.println("window resize pos/siz: "+glJPanel.getX()+"/"+glJPanel.getY()+" "+glJPanel.getSurfaceWidth()+"x"+glJPanel.getSurfaceHeight()); } snap.setMakeSnapshot(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java index 5d5b0c9a1..a96bb1973 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java @@ -173,10 +173,10 @@ public class TestGearsES2NEWT extends UITestCase { glWindow.addWindowListener(new WindowAdapter() { public void windowResized(WindowEvent e) { - System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()); + System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()); } public void windowMoved(WindowEvent e) { - System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()); + System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()); } }); @@ -238,7 +238,7 @@ public class TestGearsES2NEWT extends UITestCase { new Thread() { public void run() { final Thread t = glWindow.setExclusiveContextThread(null); - System.err.println("[set fullscreen pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); + System.err.println("[set fullscreen pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); if( glWindow.isFullscreen() ) { glWindow.setFullscreen( false ); } else { @@ -248,16 +248,16 @@ public class TestGearsES2NEWT extends UITestCase { glWindow.setFullscreen( true ); } } - System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); + System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); glWindow.setExclusiveContextThread(t); } }.start(); } else if(e.getKeyChar()=='a') { new Thread() { public void run() { final Thread t = glWindow.setExclusiveContextThread(null); - System.err.println("[set alwaysontop pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); + System.err.println("[set alwaysontop pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); glWindow.setAlwaysOnTop(!glWindow.isAlwaysOnTop()); - System.err.println("[set alwaysontop post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); + System.err.println("[set alwaysontop post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); glWindow.setExclusiveContextThread(t); } }.start(); } else if(e.getKeyChar()=='d') { @@ -265,18 +265,18 @@ public class TestGearsES2NEWT extends UITestCase { public void run() { final Thread t = glWindow.setExclusiveContextThread(null); // while( null != glWindow.getExclusiveContextThread() ) ; - System.err.println("[set undecorated pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", d "+glWindow.isUndecorated()+", "+glWindow.getInsets()); + System.err.println("[set undecorated pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", d "+glWindow.isUndecorated()+", "+glWindow.getInsets()); glWindow.setUndecorated(!glWindow.isUndecorated()); - System.err.println("[set undecorated post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", d "+glWindow.isUndecorated()+", "+glWindow.getInsets()); + System.err.println("[set undecorated post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", d "+glWindow.isUndecorated()+", "+glWindow.getInsets()); glWindow.setExclusiveContextThread(t); } }.start(); } else if(e.getKeyChar()=='s') { new Thread() { public void run() { final Thread t = glWindow.setExclusiveContextThread(null); - System.err.println("[set position pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); + System.err.println("[set position pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets()); glWindow.setPosition(100, 100); - System.err.println("[set position post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); + System.err.println("[set position post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets()); glWindow.setExclusiveContextThread(t); } }.start(); } else if(e.getKeyChar()=='c') { @@ -332,7 +332,7 @@ public class TestGearsES2NEWT extends UITestCase { public void run() { final Thread t = glWindow.setExclusiveContextThread(null); System.err.println("[set mouse pos pre]"); - glWindow.warpPointer(glWindow.getWidth()/2, glWindow.getHeight()/2); + glWindow.warpPointer(glWindow.getSurfaceWidth()/2, glWindow.getSurfaceHeight()/2); System.err.println("[set mouse pos post]"); glWindow.setExclusiveContextThread(t); } }.start(); @@ -406,14 +406,14 @@ public class TestGearsES2NEWT extends UITestCase { System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities()); System.err.println("GL chosen: "+glWindow.getChosenCapabilities()); - System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); + System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets()); snap.setMakeSnapshot(); if( null != rwsize ) { Thread.sleep(500); // 500ms delay glWindow.setSize(rwsize.getWidth(), rwsize.getHeight()); - System.err.println("window resize pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); + System.err.println("window resize pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets()); } snap.setMakeSnapshot(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java index 5d091bb6d..c7a00350b 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java @@ -259,10 +259,10 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase { glWindow.addWindowListener(new WindowAdapter() { public void windowResized(WindowEvent e) { - System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()); + System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()); } public void windowMoved(WindowEvent e) { - System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()); + System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()); } }); @@ -295,12 +295,12 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase { System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities()); System.err.println("GL chosen: "+glWindow.getChosenCapabilities()); - System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); + System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets()); if( null != rwsize ) { Thread.sleep(500); // 500ms delay setSize(resizeBy, frame, true, newtCanvasAWT, glWindow, rwsize); - System.err.println("window resize "+rwsize+" -> pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); + System.err.println("window resize "+rwsize+" -> pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets()); } final long t0 = System.currentTimeMillis(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java index 9b2db6bcc..d04846c2a 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java @@ -175,10 +175,10 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase { glWindow.addWindowListener(new WindowAdapter() { public void windowResized(WindowEvent e) { - System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()); + System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()); } public void windowMoved(WindowEvent e) { - System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()); + System.err.println("window moved: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()); } }); @@ -191,9 +191,9 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase { new Thread() { public void run() { final Thread t = glWindow.setExclusiveContextThread(null); - System.err.println("[set fullscreen pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); + System.err.println("[set fullscreen pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); glWindow.setFullscreen(!glWindow.isFullscreen()); - System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); + System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); glWindow.setExclusiveContextThread(t); } }.start(); } @@ -224,7 +224,7 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase { System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities()); System.err.println("GL chosen: "+glWindow.getChosenCapabilities()); - System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); + System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets()); if( null != rwsize ) { for(int i=0; i<50; i++) { // 500 ms dispatched delay @@ -238,7 +238,7 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase { shell.setSize( rwsize.getWidth(), rwsize.getHeight() ); } }); - System.err.println("window resize pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets()); + System.err.println("window resize pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets()); } while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration() monitorModes = monitor.getSupportedModes(); @@ -308,7 +308,7 @@ public class TestScreenMode01dNEWT extends UITestCase { Animator animator = new Animator(window); animator.start(); - final RectangleImmutable winRect = new Rectangle(window.getX(), window.getY(), window.getWidth(), window.getHeight()); + final RectangleImmutable winRect = new Rectangle(window.getX(), window.getY(), window.getSurfaceWidth(), window.getSurfaceHeight()); final MonitorDevice monitor = screen.getMainMonitor(winRect); MonitorMode mmCurrent = monitor.queryCurrentMode(); Assert.assertNotNull(mmCurrent); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java index dc9aac8ea..005579352 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java @@ -82,9 +82,9 @@ public class NewtAWTReparentingKeyAdapter extends KeyAdapter { new Thread() { public void run() { final Thread t = glWindow.setExclusiveContextThread(null); - System.err.println("[set fullscreen pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); + System.err.println("[set fullscreen pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); glWindow.setFullscreen(!glWindow.isFullscreen()); - System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); + System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets()); glWindow.setExclusiveContextThread(t); if( null != quitAdapter ) { quitAdapter.clear(); @@ -226,7 +226,7 @@ public class NewtAWTReparentingKeyAdapter extends KeyAdapter { new Thread() { public void run() { System.err.println("[set mouse pos pre]"); - glWindow.warpPointer(glWindow.getWidth()/2, glWindow.getHeight()/2); + glWindow.warpPointer(glWindow.getSurfaceWidth()/2, glWindow.getSurfaceHeight()/2); System.err.println("[set mouse pos post]"); } }.start(); } diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java index 9f56ecdbf..417a1c506 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java @@ -110,8 +110,8 @@ public class TestParenting02NEWT extends UITestCase { GLWindow glWindow1 = GLWindow.create(window1); Assert.assertNotNull(glWindow1); glWindow1.setSize(width, height); - Assert.assertEquals(width,glWindow1.getWidth()); - Assert.assertEquals(height,glWindow1.getHeight()); + Assert.assertEquals(width,glWindow1.getSurfaceWidth()); + Assert.assertEquals(height,glWindow1.getSurfaceHeight()); glWindow1.setTitle("test01NewtOnNewtParentChildDraw - PARENT"); glWindow1.setPosition(x,y); //glWindow1.addKeyListener(new TraceKeyAdapter(new KeyAction(eventFifo))); @@ -134,7 +134,7 @@ public class TestParenting02NEWT extends UITestCase { //Assert.assertEquals(width/2,glWindow2.getWidth()); //Assert.assertEquals(height/2,glWindow2.getHeight()); glWindow2.setTitle("test01NewtOnNewtParentChildDraw - CHILD"); - glWindow2.setPosition(glWindow1.getWidth()/2, glWindow1.getHeight()/2); + glWindow2.setPosition(glWindow1.getSurfaceWidth()/2, glWindow1.getSurfaceHeight()/2); //glWindow2.addKeyListener(new TraceKeyAdapter(new KeyAction(eventFifo))); //glWindow2.addWindowListener(new TraceWindowAdapter(new WindowAction(eventFifo))); // glWindow2.addMouseListener(new TraceMouseAdapter()); @@ -163,7 +163,7 @@ public class TestParenting02NEWT extends UITestCase { x += 1; y += 1; // glWindow1.setPosition(x,y); - glWindow2.setPosition(glWindow1.getWidth()/2,glWindow1.getHeight()/2-y); + glWindow2.setPosition(glWindow1.getSurfaceWidth()/2,glWindow1.getSurfaceHeight()/2-y); Thread.sleep(step); while( null != ( event = eventFifo.get() ) ) { diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java index 599a6dc9f..45df52220 100644 --- a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java +++ b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java @@ -137,9 +137,9 @@ public class AWTRobotUtil { javax.media.nativewindow.util.Point p0 = win.getLocationOnScreen(null); if( onTitleBarIfWindow ) { javax.media.nativewindow.util.InsetsImmutable insets = win.getInsets(); - p0.translate(win.getWidth()/2, insets.getTopHeight()/2); + p0.translate(win.getSurfaceWidth()/2, insets.getTopHeight()/2); } else { - p0.translate(win.getWidth()/2, win.getHeight()/2); + p0.translate(win.getSurfaceWidth()/2, win.getSurfaceHeight()/2); } return new int[] { p0.getX(), p0.getY() }; } @@ -671,7 +671,7 @@ public class AWTRobotUtil { */ public static boolean waitForSize(GLDrawable drawable, int width, int height) throws InterruptedException { int wait; - for (wait=0; wait