From: <ka...@us...> - 2009-11-12 22:13:07
|
Revision: 3246 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3246&view=rev Author: kappa1 Date: 2009-11-12 22:12:49 +0000 (Thu, 12 Nov 2009) Log Message: ----------- FIX: Mouse Grab should now work on Windows when using Display.setParent() Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2009-10-12 11:56:46 UTC (rev 3245) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2009-11-12 22:12:49 UTC (rev 3246) @@ -131,6 +131,7 @@ private WindowsDisplayPeerInfo peer_info; private Object current_cursor; private Canvas parent; + private static boolean hasParent = false; private WindowsKeyboard keyboard; private WindowsMouse mouse; @@ -169,6 +170,7 @@ isFocused = false; did_maximize = false; this.parent = parent; + hasParent = parent != null; long parent_hwnd = parent != null ? getHwnd(parent) : 0; this.hwnd = nCreateWindow(x, y, mode.getWidth(), mode.getHeight(), Display.isFullscreen() || isUndecorated(), parent != null, parent_hwnd); if (hwnd == 0) { @@ -519,7 +521,7 @@ private static native long getForegroundWindow(); static void centerCursor(long hwnd) { - if (getForegroundWindow() != hwnd) + if (getForegroundWindow() != hwnd && !hasParent) return; getGlobalClientRect(hwnd, rect); int local_offset_x = rect.left; @@ -764,7 +766,7 @@ } private void updateClipping() { - if ((Display.isFullscreen() || (mouse != null && mouse.isGrabbed())) && !isMinimized && isFocused && getForegroundWindow() == getHwnd()) { + if ((Display.isFullscreen() || (mouse != null && mouse.isGrabbed())) && !isMinimized && isFocused && (getForegroundWindow() == getHwnd() || hasParent)) { try { setupCursorClipping(getHwnd()); } catch (LWJGLException e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <en...@us...> - 2010-03-12 20:15:44
|
Revision: 3280 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3280&view=rev Author: endolf Date: 2010-03-12 20:15:38 +0000 (Fri, 12 Mar 2010) Log Message: ----------- Try and find a sensible video driver to report on rather than assuming it's video0. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2010-03-11 21:06:49 UTC (rev 3279) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2010-03-12 20:15:38 UTC (rev 3280) @@ -341,18 +341,33 @@ public String getAdapter() { try { - String adapter_string = WindowsRegistry.queryRegistrationKey( + String maxObjNo = WindowsRegistry.queryRegistrationKey( WindowsRegistry.HKEY_LOCAL_MACHINE, "HARDWARE\\DeviceMap\\Video", - "\\Device\\Video0"); - String root_key = "\\registry\\machine\\"; - if (adapter_string.toLowerCase().startsWith(root_key)) { - String driver_value = WindowsRegistry.queryRegistrationKey( + "MaxObjectNumber"); + int maxObjectNumber = maxObjNo.charAt(0); + String vga_driver_value = ""; + for(int i=0;i<maxObjectNumber;i++) { + String adapter_string = WindowsRegistry.queryRegistrationKey( WindowsRegistry.HKEY_LOCAL_MACHINE, - adapter_string.substring(root_key.length()), - "InstalledDisplayDrivers"); - return driver_value; + "HARDWARE\\DeviceMap\\Video", + "\\Device\\Video" + i); + String root_key = "\\registry\\machine\\"; + if (adapter_string.toLowerCase().startsWith(root_key)) { + String driver_value = WindowsRegistry.queryRegistrationKey( + WindowsRegistry.HKEY_LOCAL_MACHINE, + adapter_string.substring(root_key.length()), + "InstalledDisplayDrivers"); + if(driver_value.toUpperCase().startsWith("VGA")) { + vga_driver_value = driver_value; + } else if(!driver_value.toUpperCase().startsWith("RDP") && !driver_value.toUpperCase().startsWith("NMNDD")) { + return driver_value; + } + } } + if(!vga_driver_value.equals("")) { + return vga_driver_value; + } } catch (LWJGLException e) { LWJGLUtil.log("Exception occurred while querying registry: " + e); } @@ -362,9 +377,12 @@ public String getVersion() { String driver = getAdapter(); if (driver != null) { - WindowsFileVersion version = nGetVersion(driver + ".dll"); - if (version != null) - return version.toString(); + String[] drivers = driver.split(","); + if(drivers.length>0) { + WindowsFileVersion version = nGetVersion(drivers[0] + ".dll"); + if (version != null) + return version.toString(); + } } return null; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2010-03-17 18:56:09
|
Revision: 3290 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3290&view=rev Author: matzon Date: 2010-03-17 18:55:59 +0000 (Wed, 17 Mar 2010) Log Message: ----------- patch as per http://lwjgl.org/forum/index.php/topic,3124.0.html Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2010-03-16 19:05:19 UTC (rev 3289) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2010-03-17 18:55:59 UTC (rev 3290) @@ -690,15 +690,16 @@ if (mouse != null) { mouse.handleMouseButton((byte)button, (byte)state, millis); + // need to capture? + if (captureMouse == -1 && button != -1 && state == 1) { + captureMouse = button; + nSetCapture(hwnd); + } + // done with capture? if(captureMouse != -1 && button == captureMouse && state == 0) { - nReleaseCapture(); captureMouse = -1; - - // force mouse update - else we will run into an issue where the - // button state is "stale" while captureMouse == -1 which causes - // handleMouseMoved to issue a setCapture. - Mouse.poll(); + nReleaseCapture(); } } @@ -714,16 +715,6 @@ private void handleMouseMoved(int x, int y, long millis) { if (mouse != null) { mouse.handleMouseMoved(x, y, millis, shouldGrab()); - - // Moving - while mouse is down? - // need to capture - if(!Mouse.isGrabbed()) { - int button = firstMouseButtonDown(); - if(captureMouse == -1 && button != -1) { - captureMouse = button; - nSetCapture(hwnd); - } - } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sp...@us...> - 2010-04-01 15:05:40
|
Revision: 3303 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3303&view=rev Author: spasi Date: 2010-04-01 15:05:32 +0000 (Thu, 01 Apr 2010) Log Message: ----------- Fix for grabbed mouse deltas. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2010-03-31 23:56:24 UTC (rev 3302) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2010-04-01 15:05:32 UTC (rev 3303) @@ -542,19 +542,17 @@ if (getForegroundWindow() != hwnd && !hasParent) return; getGlobalClientRect(hwnd, rect); - /* -- This is wrong on multi-monitor setups int local_offset_x = rect.left; int local_offset_y = rect.top; + /* -- This is wrong on multi-monitor setups getGlobalClientRect(getDesktopWindow(), rect2); Rect.intersect(rect, rect2, rect); + */ int center_x = (rect.left + rect.right)/2; int center_y = (rect.top + rect.bottom)/2; nSetCursorPosition(center_x, center_y); int local_x = center_x - local_offset_x; int local_y = center_y - local_offset_y; - */ - int local_x = (rect.right - rect.left) / 2; - int local_y = (rect.bottom - rect.top) / 2; if (current_display != null) current_display.setMousePosition(local_x, transformY(hwnd, local_y)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2010-11-26 20:38:46
|
Revision: 3457 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3457&view=rev Author: kappa1 Date: 2010-11-26 20:38:39 +0000 (Fri, 26 Nov 2010) Log Message: ----------- remove debug code left in WindowsDisplay, thx to MatthiasM. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2010-11-24 21:48:23 UTC (rev 3456) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2010-11-26 20:38:39 UTC (rev 3457) @@ -747,11 +747,6 @@ int scan_code = (int)((lParam >>> 16) & 0xFF); if (keyboard != null) { keyboard.handleKey((int)wParam, scan_code, extended != 0, state, millis, repeat); - - if(captureMouse != -1 && keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) { - nReleaseCapture(); - captureMouse = -1; - } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2011-04-16 18:38:54
|
Revision: 3516 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3516&view=rev Author: matzon Date: 2011-04-16 18:38:48 +0000 (Sat, 16 Apr 2011) Log Message: ----------- fixing icons as per dr_evil [http://lwjgl.org/forum/index.php/topic,3925.0.html] Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2011-04-16 16:41:19 UTC (rev 3515) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2011-04-16 18:38:48 UTC (rev 3516) @@ -668,16 +668,16 @@ int size = icon.limit() / 4; if ( (((int)Math.sqrt(size)) == small_icon_size) && (!done_small) ) { - freeSmallIcon(); small_icon = createIcon(small_icon_size, small_icon_size, icon.asIntBuffer()); sendMessage(hwnd, WM_SETICON, ICON_SMALL, small_icon); + freeSmallIcon(); used++; done_small = true; } if ( (((int)Math.sqrt(size)) == large_icon_size) && (!done_large) ) { - freeLargeIcon(); large_icon = createIcon(large_icon_size, large_icon_size, icon.asIntBuffer()); sendMessage(hwnd, WM_SETICON, ICON_BIG, large_icon); + freeLargeIcon(); used++; done_large = true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2011-04-16 21:13:34
|
Revision: 3517 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3517&view=rev Author: matzon Date: 2011-04-16 21:13:27 +0000 (Sat, 16 Apr 2011) Log Message: ----------- fixing icons as per dr_evil [http://lwjgl.org/forum/index.php/topic,3925.0.html] [proper] Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2011-04-16 18:38:48 UTC (rev 3516) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2011-04-16 21:13:27 UTC (rev 3517) @@ -668,16 +668,18 @@ int size = icon.limit() / 4; if ( (((int)Math.sqrt(size)) == small_icon_size) && (!done_small) ) { - small_icon = createIcon(small_icon_size, small_icon_size, icon.asIntBuffer()); - sendMessage(hwnd, WM_SETICON, ICON_SMALL, small_icon); + long small_new_icon = createIcon(small_icon_size, small_icon_size, icon.asIntBuffer()); + sendMessage(hwnd, WM_SETICON, ICON_SMALL, small_new_icon); freeSmallIcon(); + small_icon = small_new_icon; used++; done_small = true; } if ( (((int)Math.sqrt(size)) == large_icon_size) && (!done_large) ) { - large_icon = createIcon(large_icon_size, large_icon_size, icon.asIntBuffer()); - sendMessage(hwnd, WM_SETICON, ICON_BIG, large_icon); + long large_new_icon = createIcon(large_icon_size, large_icon_size, icon.asIntBuffer()); + sendMessage(hwnd, WM_SETICON, ICON_BIG, large_new_icon); freeLargeIcon(); + large_icon = large_new_icon; used++; done_large = true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2012-01-02 21:59:27
|
Revision: 3717 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3717&view=rev Author: matzon Date: 2012-01-02 21:59:20 +0000 (Mon, 02 Jan 2012) Log Message: ----------- Applied WM_SETCURSOR to fix issue with cursor Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2011-12-21 14:34:39 UTC (rev 3716) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-01-02 21:59:20 UTC (rev 3717) @@ -69,6 +69,8 @@ private static final int WM_ENTERSIZEMOVE = 0x0231; private static final int WM_EXITSIZEMOVE = 0x0232; private static final int WM_SIZING = 0x0214; + private static final int WM_MOVING = 0x0216; + private static final int WM_KEYDOWN = 256; private static final int WM_KEYUP = 257; private static final int WM_SYSKEYUP = 261; @@ -76,6 +78,7 @@ private static final int WM_SYSCHAR = 262; private static final int WM_CHAR = 258; private static final int WM_SETICON = 0x0080; + private static final int WM_SETCURSOR = 0x0020; private static final int WM_QUIT = 0x0012; private static final int WM_SYSCOMMAND = 0x0112; @@ -142,6 +145,8 @@ private static final int GWL_EXSTYLE = -20; private static final int WS_THICKFRAME = 0x00040000; + + private static final int HTCLIENT = 0x01; private static WindowsDisplay current_display; @@ -866,10 +871,24 @@ return defWindowProc(hwnd, msg, wParam, lParam); case WM_EXITSIZEMOVE: return defWindowProc(hwnd, msg, wParam, lParam); + case WM_MOVING: + Display.callReshapeCallbackAndSwap(); + return defWindowProc(hwnd, msg, wParam, lParam); case WM_SIZING: resized = true; updateWidthAndHeight(); + Display.callReshapeCallbackAndSwap(); return defWindowProc(hwnd, msg, wParam, lParam); + case WM_SETCURSOR: + if((lParam & 0xFFFF) == HTCLIENT) { + // if the cursor is inside the client area, reset it + // to the current LWJGL-cursor + updateCursor(); + return -1; //TRUE + } else { + // let Windows handle cursors outside the client area for resizing, etc. + return defWindowProc(hwnd, msg, wParam, lParam); + } case WM_KILLFOCUS: appActivate(false); return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2012-01-02 22:04:00
|
Revision: 3718 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3718&view=rev Author: matzon Date: 2012-01-02 22:03:53 +0000 (Mon, 02 Jan 2012) Log Message: ----------- undoing commit of r3717 Revision Links: -------------- http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3717&view=rev Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-01-02 21:59:20 UTC (rev 3717) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-01-02 22:03:53 UTC (rev 3718) @@ -69,8 +69,6 @@ private static final int WM_ENTERSIZEMOVE = 0x0231; private static final int WM_EXITSIZEMOVE = 0x0232; private static final int WM_SIZING = 0x0214; - private static final int WM_MOVING = 0x0216; - private static final int WM_KEYDOWN = 256; private static final int WM_KEYUP = 257; private static final int WM_SYSKEYUP = 261; @@ -78,7 +76,6 @@ private static final int WM_SYSCHAR = 262; private static final int WM_CHAR = 258; private static final int WM_SETICON = 0x0080; - private static final int WM_SETCURSOR = 0x0020; private static final int WM_QUIT = 0x0012; private static final int WM_SYSCOMMAND = 0x0112; @@ -145,8 +142,6 @@ private static final int GWL_EXSTYLE = -20; private static final int WS_THICKFRAME = 0x00040000; - - private static final int HTCLIENT = 0x01; private static WindowsDisplay current_display; @@ -871,24 +866,10 @@ return defWindowProc(hwnd, msg, wParam, lParam); case WM_EXITSIZEMOVE: return defWindowProc(hwnd, msg, wParam, lParam); - case WM_MOVING: - Display.callReshapeCallbackAndSwap(); - return defWindowProc(hwnd, msg, wParam, lParam); case WM_SIZING: resized = true; updateWidthAndHeight(); - Display.callReshapeCallbackAndSwap(); return defWindowProc(hwnd, msg, wParam, lParam); - case WM_SETCURSOR: - if((lParam & 0xFFFF) == HTCLIENT) { - // if the cursor is inside the client area, reset it - // to the current LWJGL-cursor - updateCursor(); - return -1; //TRUE - } else { - // let Windows handle cursors outside the client area for resizing, etc. - return defWindowProc(hwnd, msg, wParam, lParam); - } case WM_KILLFOCUS: appActivate(false); return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2012-01-02 22:06:19
|
Revision: 3719 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3719&view=rev Author: matzon Date: 2012-01-02 22:06:12 +0000 (Mon, 02 Jan 2012) Log Message: ----------- Applying WM_SETCURSOR patch to fix issue with cursor Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-01-02 22:03:53 UTC (rev 3718) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-01-02 22:06:12 UTC (rev 3719) @@ -76,6 +76,7 @@ private static final int WM_SYSCHAR = 262; private static final int WM_CHAR = 258; private static final int WM_SETICON = 0x0080; + private static final int WM_SETCURSOR = 0x0020; private static final int WM_QUIT = 0x0012; private static final int WM_SYSCOMMAND = 0x0112; @@ -142,6 +143,8 @@ private static final int GWL_EXSTYLE = -20; private static final int WS_THICKFRAME = 0x00040000; + + private static final int HTCLIENT = 0x01; private static WindowsDisplay current_display; @@ -870,6 +873,16 @@ resized = true; updateWidthAndHeight(); return defWindowProc(hwnd, msg, wParam, lParam); + case WM_SETCURSOR: + if((lParam & 0xFFFF) == HTCLIENT) { + // if the cursor is inside the client area, reset it + // to the current LWJGL-cursor + updateCursor(); + return -1; //TRUE + } else { + // let Windows handle cursors outside the client area for resizing, etc. + return defWindowProc(hwnd, msg, wParam, lParam); + } case WM_KILLFOCUS: appActivate(false); return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2012-01-29 20:26:19
|
Revision: 3734 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3734&view=rev Author: matzon Date: 2012-01-29 20:26:13 +0000 (Sun, 29 Jan 2012) Log Message: ----------- support for 5 buttons on windows Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-01-29 19:06:13 UTC (rev 3733) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-01-29 20:26:13 UTC (rev 3734) @@ -63,6 +63,9 @@ private static final int WM_MBUTTONDOWN = 0x0207; private static final int WM_MBUTTONUP = 0x0208; private static final int WM_MBUTTONDBLCLK = 0x0209; + private static final int WM_XBUTTONDOWN = 0x020B; + private static final int WM_XBUTTONUP = 0x020C; + private static final int WM_XBUTTONDBLCLK = 0x020D; private static final int WM_MOUSEWHEEL = 0x020A; private static final int WM_CAPTURECHANGED = 0x0215; private static final int WM_MOUSELEAVE = 0x02A3; @@ -146,8 +149,12 @@ private static final int WS_MAXIMIZEBOX = 0x00010000; private static final int HTCLIENT = 0x01; + + private static final int MK_XBUTTON1 = 0x0020; + private static final int MK_XBUTTON2 = 0x0040; + private static final int XBUTTON1 = 0x0001; + private static final int XBUTTON2 = 0x0002; - private static WindowsDisplay current_display; private static boolean cursor_clipped; @@ -924,6 +931,20 @@ case WM_MBUTTONUP: handleMouseButton(2, 0, millis); return 0; + case WM_XBUTTONUP: + if((wParam >> 16) == XBUTTON1) { + handleMouseButton(3, 0, millis); + } else { + handleMouseButton(4, 0, millis); + } + return 1; + case WM_XBUTTONDOWN: + if((wParam & 0xFF) == MK_XBUTTON1) { + handleMouseButton(3, 1, millis); + } else { + handleMouseButton(4, 1, millis); + } + return 1; case WM_SYSCHAR: case WM_CHAR: handleChar(wParam, lParam, millis); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2012-02-01 21:33:52
|
Revision: 3738 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3738&view=rev Author: matzon Date: 2012-02-01 21:33:45 +0000 (Wed, 01 Feb 2012) Log Message: ----------- applying suggested fix for resize issue Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-01-31 23:25:44 UTC (rev 3737) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-02-01 21:33:45 UTC (rev 3738) @@ -372,6 +372,7 @@ if (mode_set) { mode_set = false; nResetDisplayMode(); + setResizable(this.resizable); } resetCursorClipping(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2012-02-01 22:51:06
|
Revision: 3739 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3739&view=rev Author: matzon Date: 2012-02-01 22:50:59 +0000 (Wed, 01 Feb 2012) Log Message: ----------- updated fix for resizable Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-02-01 21:33:45 UTC (rev 3738) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-02-01 22:50:59 UTC (rev 3739) @@ -207,6 +207,7 @@ hasParent = parent != null; long parent_hwnd = parent != null ? getHwnd(parent) : 0; this.hwnd = nCreateWindow(x, y, mode.getWidth(), mode.getHeight(), Display.isFullscreen() || isUndecorated(), parent != null, parent_hwnd); + this.resizable=false; if (hwnd == 0) { throw new LWJGLException("Failed to create window"); } @@ -372,7 +373,6 @@ if (mode_set) { mode_set = false; nResetDisplayMode(); - setResizable(this.resizable); } resetCursorClipping(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2012-02-06 20:35:31
|
Revision: 3741 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3741&view=rev Author: matzon Date: 2012-02-06 20:35:25 +0000 (Mon, 06 Feb 2012) Log Message: ----------- applied dr_evil's maximized patch Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-02-06 19:26:21 UTC (rev 3740) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-02-06 20:35:25 UTC (rev 3741) @@ -125,6 +125,7 @@ private static final int SW_SHOWMINNOACTIVE = 7; private static final int SW_SHOWDEFAULT = 10; private static final int SW_RESTORE = 9; + private static final int SW_MAXIMIZE = 3; private static final int ICON_SMALL = 0; private static final int ICON_BIG = 1; @@ -176,10 +177,11 @@ private boolean mode_set; private boolean isMinimized; private boolean isFocused; - private boolean did_maximize; + private boolean redoMakeContextCurrent; private boolean inAppActivate; private boolean resized; private boolean resizable; + private boolean maximized; private int width; private int height; @@ -202,7 +204,8 @@ is_dirty = false; isMinimized = false; isFocused = false; - did_maximize = false; + redoMakeContextCurrent = false; + maximized = false; this.parent = parent; hasParent = parent != null; long parent_hwnd = parent != null ? getHwnd(parent) : 0; @@ -327,11 +330,15 @@ restoreDisplayMode(); } if (parent == null) { - showWindow(getHwnd(), SW_RESTORE); + if(maximized) { + showWindow(getHwnd(), SW_MAXIMIZE); + } else { + showWindow(getHwnd(), SW_RESTORE); + } setForegroundWindow(getHwnd()); setFocus(getHwnd()); } - did_maximize = true; + redoMakeContextCurrent = true; if (Display.isFullscreen()) updateClipping(); } else if (Display.isFullscreen()) { @@ -485,8 +492,8 @@ if (parent != null && parent.isFocusOwner()) { setFocus(getHwnd()); } - if (did_maximize) { - did_maximize = false; + if (redoMakeContextCurrent) { + redoMakeContextCurrent = false; /** * WORKAROUND: * Making the context current (redundantly) when the window @@ -867,6 +874,7 @@ switch ((int)wParam) { case SIZE_RESTORED: case SIZE_MAXIMIZED: + maximized = ((int)wParam) == SIZE_MAXIMIZED; resized = true; updateWidthAndHeight(); setMinimized(false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2012-02-18 18:39:04
|
Revision: 3744 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3744&view=rev Author: matzon Date: 2012-02-18 18:38:57 +0000 (Sat, 18 Feb 2012) Log Message: ----------- added win32 display get x/y Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-02-18 16:30:38 UTC (rev 3743) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-02-18 18:38:57 UTC (rev 3744) @@ -52,6 +52,7 @@ final class WindowsDisplay implements DisplayImplementation { private static final int GAMMA_LENGTH = 256; + private static final int WM_MOVE = 0x0003; private static final int WM_CANCELMODE = 0x001F; private static final int WM_MOUSEMOVE = 0x0200; private static final int WM_LBUTTONDOWN = 0x0201; @@ -182,6 +183,8 @@ private boolean resized; private boolean resizable; private boolean maximized; + private int x; + private int y; private int width; private int height; @@ -1009,17 +1012,21 @@ captureMouse = -1; } return 0; + case WM_MOVE: + x = (int)(short)(lParam & 0xFFFF); + y = (int)(short)(lParam >> 16); + return defWindowProc(hwnd, msg, wParam, lParam); default: return defWindowProc(hwnd, msg, wParam, lParam); } } public int getX() { - return 0; // placeholder until implemented + return x; } public int getY() { - return 0; // placeholder until implemented + return y; } public int getWidth() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2012-03-19 22:12:45
|
Revision: 3753 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3753&view=rev Author: matzon Date: 2012-03-19 22:12:38 +0000 (Mon, 19 Mar 2012) Log Message: ----------- applying white border fix from dr_evil Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-03-18 16:25:23 UTC (rev 3752) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-03-19 22:12:38 UTC (rev 3753) @@ -1058,7 +1058,7 @@ long styleex = getWindowLongPtr(hwnd, GWL_EXSTYLE); // update frame style - if(resizable) { + if(resizable && !Display.isFullscreen()) { setWindowLongPtr(hwnd, GWL_STYLE, style |= (WS_THICKFRAME | WS_MAXIMIZEBOX)); } else { setWindowLongPtr(hwnd, GWL_STYLE, style &= ~(WS_THICKFRAME | WS_MAXIMIZEBOX)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |