aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-jogl-awt/src/main/java/com
diff options
context:
space:
mode:
authorJulien Gouesse <[email protected]>2015-10-13 21:32:48 +0200
committerJulien Gouesse <[email protected]>2015-10-13 21:32:48 +0200
commit644c9542f9fb1949c08fedfc15722b451de1ab1b (patch)
treefb30526cfef41adc0aead16b919989e734b5f052 /ardor3d-jogl-awt/src/main/java/com
parentecd68023b29227d384a9aba859450dc80a4f4711 (diff)
Improves the fix of the issue #14
Diffstat (limited to 'ardor3d-jogl-awt/src/main/java/com')
-rw-r--r--ardor3d-jogl-awt/src/main/java/com/ardor3d/framework/jogl/awt/JoglNewtAwtCanvas.java16
1 files changed, 13 insertions, 3 deletions
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 1eb901d..6d048ab 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
@@ -42,7 +42,12 @@ public class JoglNewtAwtCanvas extends NewtCanvasAWT implements Canvas, NewtWind
public JoglNewtAwtCanvas(final DisplaySettings settings, final JoglCanvasRenderer canvasRenderer,
final CapsUtil capsUtil) {
- super(GLWindow.create(capsUtil.getCapsForSettings(settings)));
+ this(createNewtChildWindow(settings, capsUtil), settings, canvasRenderer, capsUtil);
+ }
+
+ public JoglNewtAwtCanvas(final GLWindow newtChildWindow, final DisplaySettings settings, final JoglCanvasRenderer canvasRenderer,
+ final CapsUtil capsUtil) {
+ super(newtChildWindow);
_drawerGLRunnable = new JoglDrawerRunnable(canvasRenderer);
getNewtWindow().setUndecorated(true);
_settings = settings;
@@ -52,9 +57,14 @@ 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,
+ }
+
+ private static GLWindow createNewtChildWindow(final DisplaySettings settings, final CapsUtil capsUtil) {
+ final GLWindow newtChildWindow = GLWindow.create(capsUtil.getCapsForSettings(settings));
+ // disables HiDPI, see https://github.com/gouessej/Ardor3D/issues/14
+ newtChildWindow.setSurfaceScale(new float[] { ScalableSurface.IDENTITY_PIXELSCALE,
ScalableSurface.IDENTITY_PIXELSCALE });
+ return newtChildWindow;
}
@Override