From 23fd08ac45bd0b50e7522d1aa0cb2d9cc58b98d0 Mon Sep 17 00:00:00 2001 From: "jul..om" Date: Thu, 25 Oct 2012 23:19:33 +0000 Subject: [PATCH] Displays the right display mode with the logger git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9897 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/system/jogl/JoglDisplay.java | 29 ++++--------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/engine/src/jogl/com/jme3/system/jogl/JoglDisplay.java b/engine/src/jogl/com/jme3/system/jogl/JoglDisplay.java index 055203023..3f38c8fbd 100644 --- a/engine/src/jogl/com/jme3/system/jogl/JoglDisplay.java +++ b/engine/src/jogl/com/jme3/system/jogl/JoglDisplay.java @@ -46,7 +46,6 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Level; import java.util.logging.Logger; import javax.media.opengl.GLAutoDrawable; -import javax.media.opengl.GLContext; import javax.swing.JFrame; import javax.swing.SwingUtilities; @@ -64,28 +63,11 @@ public class JoglDisplay extends JoglAbstractDisplay { return Type.Display; } - /*protected DisplayMode getFullscreenDisplayMode(DisplayMode[] modes, int width, int height, int bpp, int freq){ - for (DisplayMode mode : modes){ - if (mode.getWidth() == width - && mode.getHeight() == height - && (mode.getBitDepth() == DisplayMode.BIT_DEPTH_MULTI - || mode.getBitDepth() == bpp - || (mode.getBitDepth() == 32 && bpp==24)) - && mode.getRefreshRate() == freq){ - return mode; - } - } - return null; - }*/ - protected void createGLFrame(){ - //Container contentPane; if (useAwt){ frame = new Frame(settings.getTitle()); - //contentPane = frame; }else{ frame = new JFrame(settings.getTitle()); - //contentPane = ((JFrame)frame).getContentPane(); } frame.setResizable(false); frame.add(canvas); @@ -122,7 +104,8 @@ public class JoglDisplay extends JoglAbstractDisplay { canvas.setVisible(true); - final GLContext context = canvas.getContext(); + //this is the earliest safe opportunity to get the context + //final GLContext context = canvas.getContext(); /*canvas.invoke(true, new GLRunnable() { @Override @@ -242,10 +225,10 @@ public class JoglDisplay extends JoglAbstractDisplay { } logger.log(Level.INFO, "Selected display mode: {0}x{1}x{2} @{3}", - new Object[]{frame.getWidth(), - frame.getHeight(), - 0, - 0}); + new Object[]{gd.getDisplayMode().getWidth(), + gd.getDisplayMode().getHeight(), + gd.getDisplayMode().getBitDepth(), + gd.getDisplayMode().getRefreshRate()}); } private void initInEDT(){