From 23b6e400eb8fdbf4aa547a8089b9ad44171551b2 Mon Sep 17 00:00:00 2001 From: Caspian Rychlik-Prince Date: Mon, 22 Nov 2004 21:12:51 +0000 Subject: [PATCH] Centres windowed mode now. --- src/java/org/lwjgl/opengl/Display.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java/org/lwjgl/opengl/Display.java b/src/java/org/lwjgl/opengl/Display.java index a0443c1c..947b3f2a 100644 --- a/src/java/org/lwjgl/opengl/Display.java +++ b/src/java/org/lwjgl/opengl/Display.java @@ -200,8 +200,8 @@ public final class Display { * A native context must exist, and it will be attached to the window. */ private static void createWindow() throws LWJGLException { - x = Math.max(0, Math.min(initial_mode.getWidth() - current_mode.getWidth(), x)); - y = Math.max(0, Math.min(initial_mode.getHeight() - current_mode.getHeight(), y)); + x = Math.max(0, (initial_mode.getWidth() - current_mode.getWidth()) / 2); + y = Math.max(0, (initial_mode.getHeight() - current_mode.getHeight()) / 2); display_impl.createWindow(current_mode, fullscreen, (fullscreen) ? 0 : x, (fullscreen) ? 0 : y); setTitle(title); initControls();