|
From: <ma...@us...> - 2007-08-15 20:14:33
|
Revision: 2872
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=2872&view=rev
Author: matzon
Date: 2007-08-15 13:14:29 -0700 (Wed, 15 Aug 2007)
Log Message:
-----------
fix: make sure that we return to the same display mode that was set in windowed mode when toggling between fullscreen and windowed mode
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2007-08-12 23:33:25 UTC (rev 2871)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2007-08-15 20:14:29 UTC (rev 2872)
@@ -82,6 +82,9 @@
/** Cached window icons, for when Display is recreated */
private static ByteBuffer[] cached_icons;
+
+ /** Display mode used prior to entering fullscreen */
+ private static DisplayMode windowed_display_mode;
/**
* Y coordinate of the window. Y in window coordinates is from the top of the display down,
@@ -298,6 +301,7 @@
private static void switchDisplayMode() throws LWJGLException {
if (!current_mode.isFullscreen()) {
LWJGLUtil.log("Switching to "+initial_mode);
+ windowed_display_mode = current_mode;
setDisplayMode(initial_mode);
}
display_impl.switchDisplayMode(current_mode);
@@ -473,6 +477,7 @@
switchDisplayMode();
} else {
display_impl.resetDisplayMode();
+ current_mode = windowed_display_mode;
}
createWindow();
makeCurrentAndSetSwapInterval();
@@ -844,6 +849,7 @@
destroyPeerInfo();
x = y = -1;
cached_icons = null;
+ windowed_display_mode = null;
reset();
removeShutdownHook();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|