diff options
author | Julien Gouesse <[email protected]> | 2015-10-12 20:38:23 +0200 |
---|---|---|
committer | Julien Gouesse <[email protected]> | 2015-10-12 20:38:23 +0200 |
commit | ecd68023b29227d384a9aba859450dc80a4f4711 (patch) | |
tree | 4a97c59de0a191b4136ed3214291d2088eafa2dd /ardor3d-jogl-awt/src/main/java/com | |
parent | b3a4fc6b96432a2921fcb1d4cb63033fb4fe3727 (diff) |
Disables HiDPI by default, see the issue #14: https://github.com/gouessej/Ardor3D/issues/14
Diffstat (limited to 'ardor3d-jogl-awt/src/main/java/com')
3 files changed, 12 insertions, 0 deletions
diff --git a/ardor3d-jogl-awt/src/main/java/com/ardor3d/framework/jogl/awt/JoglAwtCanvas.java b/ardor3d-jogl-awt/src/main/java/com/ardor3d/framework/jogl/awt/JoglAwtCanvas.java index 0fad0c6..19d7d9f 100644 --- a/ardor3d-jogl-awt/src/main/java/com/ardor3d/framework/jogl/awt/JoglAwtCanvas.java +++ b/ardor3d-jogl-awt/src/main/java/com/ardor3d/framework/jogl/awt/JoglAwtCanvas.java @@ -13,6 +13,7 @@ package com.ardor3d.framework.jogl.awt; import java.lang.reflect.InvocationTargetException; import java.util.concurrent.CountDownLatch; +import com.jogamp.nativewindow.ScalableSurface; import com.jogamp.opengl.GLAutoDrawable; import com.jogamp.opengl.GLRunnable; import com.jogamp.opengl.awt.GLCanvas; @@ -61,6 +62,9 @@ public class JoglAwtCanvas extends GLCanvas implements Canvas { setSize(_settings.getWidth(), _settings.getHeight()); setIgnoreRepaint(true); setAutoSwapBufferMode(false); + // disables HiDPI, see https://github.com/gouessej/Ardor3D/issues/14 + setSurfaceScale(new float[] { ScalableSurface.IDENTITY_PIXELSCALE, + ScalableSurface.IDENTITY_PIXELSCALE }); } @Override diff --git a/ardor3d-jogl-awt/src/main/java/com/ardor3d/framework/jogl/awt/JoglNewtAwtCanvas.java b/ardor3d-jogl-awt/src/main/java/com/ardor3d/framework/jogl/awt/JoglNewtAwtCanvas.java index 345dea3..1eb901d 100644 --- a/ardor3d-jogl-awt/src/main/java/com/ardor3d/framework/jogl/awt/JoglNewtAwtCanvas.java +++ b/ardor3d-jogl-awt/src/main/java/com/ardor3d/framework/jogl/awt/JoglNewtAwtCanvas.java @@ -21,6 +21,7 @@ import com.ardor3d.framework.jogl.CapsUtil; import com.ardor3d.framework.jogl.JoglCanvasRenderer; import com.ardor3d.framework.jogl.JoglDrawerRunnable; import com.ardor3d.framework.jogl.NewtWindowContainer; +import com.jogamp.nativewindow.ScalableSurface; import com.jogamp.newt.awt.NewtCanvasAWT; import com.jogamp.newt.opengl.GLWindow; @@ -51,6 +52,9 @@ public class JoglNewtAwtCanvas extends NewtCanvasAWT implements Canvas, NewtWind setSize(_settings.getWidth(), _settings.getHeight()); setIgnoreRepaint(true); getNewtWindow().setAutoSwapBufferMode(false); + // disables HiDPI, see https://github.com/gouessej/Ardor3D/issues/14 + getNewtWindow().setSurfaceScale(new float[] { ScalableSurface.IDENTITY_PIXELSCALE, + ScalableSurface.IDENTITY_PIXELSCALE }); } @Override diff --git a/ardor3d-jogl-awt/src/main/java/com/ardor3d/framework/jogl/awt/JoglSwingCanvas.java b/ardor3d-jogl-awt/src/main/java/com/ardor3d/framework/jogl/awt/JoglSwingCanvas.java index 8fa3982..c924a35 100644 --- a/ardor3d-jogl-awt/src/main/java/com/ardor3d/framework/jogl/awt/JoglSwingCanvas.java +++ b/ardor3d-jogl-awt/src/main/java/com/ardor3d/framework/jogl/awt/JoglSwingCanvas.java @@ -21,6 +21,7 @@ import com.ardor3d.framework.DisplaySettings; import com.ardor3d.framework.jogl.CapsUtil; import com.ardor3d.framework.jogl.JoglCanvasRenderer; import com.ardor3d.framework.jogl.JoglDrawerRunnable; +import com.jogamp.nativewindow.ScalableSurface; import com.jogamp.opengl.GLAutoDrawable; import com.jogamp.opengl.GLRunnable; import com.jogamp.opengl.awt.GLJPanel; @@ -64,6 +65,9 @@ public class JoglSwingCanvas extends GLJPanel implements Canvas { setSize(_settings.getWidth(), _settings.getHeight()); setIgnoreRepaint(true); setAutoSwapBufferMode(false); + // disables HiDPI, see https://github.com/gouessej/Ardor3D/issues/14 + setSurfaceScale(new float[] { ScalableSurface.IDENTITY_PIXELSCALE, + ScalableSurface.IDENTITY_PIXELSCALE }); } @Override |