You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
|
2
(1) |
|
3
|
4
|
5
|
6
|
7
|
8
(1) |
9
(2) |
|
10
(8) |
11
(3) |
12
(13) |
13
(4) |
14
(2) |
15
|
16
(6) |
|
17
(1) |
18
|
19
|
20
|
21
(1) |
22
(2) |
23
(2) |
|
24
(1) |
25
|
26
|
27
|
28
|
29
(1) |
30
|
|
31
|
|
|
|
|
|
|
|
From: <ma...@us...> - 2011-07-21 22:52:23
|
Revision: 3596
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3596&view=rev
Author: matzon
Date: 2011-07-21 22:52:16 +0000 (Thu, 21 Jul 2011)
Log Message:
-----------
Initial stab at win32 resize api
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
trunk/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java
trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2011-07-17 09:37:35 UTC (rev 3595)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2011-07-21 22:52:16 UTC (rev 3596)
@@ -41,6 +41,7 @@
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
+import java.nio.LongBuffer;
import java.awt.Canvas;
import org.lwjgl.LWJGLException;
@@ -66,7 +67,10 @@
private static final int WM_MBUTTONDBLCLK = 0x0209;
private static final int WM_MOUSEWHEEL = 0x020A;
private static final int WM_CAPTURECHANGED = 0x0215;
- private static final int WM_MOUSELEAVE = 0x02A3;
+ private static final int WM_MOUSELEAVE = 0x02A3;
+ 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_KEYDOWN = 256;
private static final int WM_KEYUP = 257;
private static final int WM_SYSKEYUP = 261;
@@ -115,6 +119,7 @@
private static final int WA_INACTIVE = 0;
private static final int WA_ACTIVE = 1;
private static final int WA_CLICKACTIVE = 2;
+ private static final int SW_NORMAL = 1;
private static final int SW_SHOWMINNOACTIVE = 7;
private static final int SW_SHOWDEFAULT = 10;
private static final int SW_RESTORE = 9;
@@ -124,6 +129,23 @@
private static final IntBuffer rect_buffer = BufferUtils.createIntBuffer(4);
private static final Rect rect = new Rect();
+
+ private static final long HWND_TOP = 0;
+ private static final long HWND_BOTTOM = 1;
+ private static final long HWND_TOPMOST = -1;
+ private static final long HWND_NOTOPMOST = -2;
+
+ private static final int SWP_NOSIZE = 0x0001;
+ private static final int SWP_NOMOVE = 0x0002;
+ private static final int SWP_NOZORDER = 0x0004;
+ private static final int SWP_FRAMECHANGED = 0x0020;
+
+ private static final int GWL_STYLE = -16;
+ private static final int GWL_EXSTYLE = -20;
+
+ private static final int WS_THICKFRAME = 0x00040000;
+
+
private static WindowsDisplay current_display;
private static boolean cursor_clipped;
@@ -147,6 +169,10 @@
private boolean isFocused;
private boolean did_maximize;
private boolean inAppActivate;
+ private boolean resized;
+ private boolean resizable;
+ private int width;
+ private int height;
private long hwnd;
private long hdc;
@@ -191,7 +217,13 @@
}
peer_info.initDC(getHwnd(), getHdc());
showWindow(getHwnd(), SW_SHOWDEFAULT);
+
+ updateWidthAndHeight();
+
if ( parent == null ) {
+ if(Display.isResizable()) {
+ setResizable(true);
+ }
setForegroundWindow(getHwnd());
setFocus(getHwnd());
}
@@ -201,6 +233,14 @@
throw e;
}
}
+
+ private void updateWidthAndHeight() {
+ getClientRect(hwnd, rect_buffer);
+ rect.copyFromBuffer(rect_buffer);
+ width = rect.right - rect.left;
+ height = rect.bottom - rect.top;
+ }
+
private static native long nCreateWindow(int x, int y, int width, int height, boolean undecorated, boolean child_window, long parent_hwnd) throws LWJGLException;
private static boolean isUndecorated() {
@@ -695,6 +735,9 @@
private static native long createIcon(int width, int height, IntBuffer icon);
private static native void destroyIcon(long handle);
private static native long sendMessage(long hwnd, long msg, long wparam, long lparam);
+ private static native long setWindowLongPtr(long hwnd, int nindex, long longPtr);
+ private static native long getWindowLongPtr(long hwnd, int nindex);
+ private static native boolean setWindowPos(long hwnd, long hwnd_after, int x, int y, int cx, int cy, long uflags);
private void handleMouseButton(int button, int state, long millis) {
if (mouse != null) {
@@ -820,6 +863,14 @@
break;
}
return defWindowProc(hwnd, msg, wParam, lParam);
+ case WM_ENTERSIZEMOVE:
+ return defWindowProc(hwnd, msg, wParam, lParam);
+ case WM_EXITSIZEMOVE:
+ return defWindowProc(hwnd, msg, wParam, lParam);
+ case WM_SIZING:
+ resized = true;
+ updateWidthAndHeight();
+ return defWindowProc(hwnd, msg, wParam, lParam);
case WM_KILLFOCUS:
appActivate(false);
return 0;
@@ -900,10 +951,10 @@
case WM_PAINT:
is_dirty = true;
return defWindowProc(hwnd, msg, wParam, lParam);
- case WM_MOUSELEAVE:
- mouseInside = false;
- trackingMouse = false;
- return defWindowProc(hwnd, msg, wParam, lParam);
+ case WM_MOUSELEAVE:
+ mouseInside = false;
+ trackingMouse = false;
+ return defWindowProc(hwnd, msg, wParam, lParam);
case WM_CANCELMODE:
nReleaseCapture();
/* fall through */
@@ -919,11 +970,11 @@
}
public int getWidth() {
- return Display.getDisplayMode().getWidth();
+ return width;
}
public int getHeight() {
- return Display.getDisplayMode().getHeight();
+ return height;
}
private int firstMouseButtonDown() {
@@ -942,10 +993,40 @@
}
public void setResizable(boolean resizable) {
-
+ if(this.resizable != resizable) {
+ long style = getWindowLongPtr(hwnd, GWL_STYLE);
+ long styleex = getWindowLongPtr(hwnd, GWL_EXSTYLE);
+
+ // update frame style
+ if(resizable) {
+ setWindowLongPtr(hwnd, GWL_STYLE, style |= WS_THICKFRAME);
+ } else {
+ setWindowLongPtr(hwnd, GWL_STYLE, style &= ~WS_THICKFRAME);
+ }
+
+ // from the existing client rect, determine the new window rect
+ // based on the style changes - using AdjustWindowRectEx.
+ getClientRect(hwnd, rect_buffer);
+ rect.copyFromBuffer(rect_buffer);
+ adjustWindowRectEx(rect_buffer, style, false, styleex);
+ rect.copyFromBuffer(rect_buffer);
+
+ // force a frame update and resize accordingly
+ setWindowPos(hwnd, HWND_TOP, 0, 0, rect.right - rect.left, rect.bottom - rect.top, SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED);
+
+ updateWidthAndHeight();
+ resized = false;
+ }
+ this.resizable = resizable;
}
+ private native boolean adjustWindowRectEx(IntBuffer rectBuffer, long style, boolean menu, long styleex);
+
public boolean wasResized() {
+ if(resized) {
+ resized = false;
+ return true;
+ }
return false;
}
@@ -981,7 +1062,7 @@
}
public String toString() {
- return "Rect: top = " + top + " bottom = " + bottom + " left = " + left + " right = " + right;
+ return "Rect: top = " + top + " bottom = " + bottom + " left = " + left + " right = " + right + ", width: " + (right - left) + ", height: " + (bottom - top);
}
}
}
Modified: trunk/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java 2011-07-17 09:37:35 UTC (rev 3595)
+++ trunk/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java 2011-07-21 22:52:16 UTC (rev 3596)
@@ -354,6 +354,10 @@
if(Keyboard.getEventKey() == Keyboard.KEY_SPACE && Keyboard.getEventKeyState()) {
Mouse.setGrabbed(!Mouse.isGrabbed());
}
+
+ if(Keyboard.getEventKey() == Keyboard.KEY_R && Keyboard.getEventKeyState()) {
+ Display.setResizable(!Display.isResizable());
+ }
}
}
Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2011-07-17 09:37:35 UTC (rev 3595)
+++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2011-07-21 22:52:16 UTC (rev 3596)
@@ -427,6 +427,32 @@
return SendMessage(hwnd, (UINT)msg, (WPARAM)wparam, (LPARAM)lparam);
}
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_setWindowLongPtr
+ (JNIEnv *env, jclass clazz, jlong hwnd_ptr, jint nindex, jlong longPtr) {
+
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ return SetWindowLongPtr(hwnd, nindex, (LONG_PTR) longPtr);
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getWindowLongPtr
+ (JNIEnv *env, jclass clazz, jlong hwnd_ptr, jint nindex) {
+
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ jlong result = GetWindowLongPtr(hwnd, nindex);
+ return result;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsDisplay_setWindowPos
+ (JNIEnv *env, jclass clazz, jlong hwnd_ptr, jlong hwnd_after_ptr, jint x, jint y, jint width, jint height, jlong uflags) {
+
+ jboolean result;
+ HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ HWND hwnd_after = (HWND)(INT_PTR)hwnd_after_ptr;
+
+ result = SetWindowPos(hwnd, hwnd_after, x, y, width, height, (UINT) uflags);
+ return result;
+}
+
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetCursorPosition
(JNIEnv * env, jclass unused, jint x, jint y) {
if (!SetCursorPos(x, y))
@@ -441,6 +467,16 @@
copyRectToBuffer(env, &clientRect, rect_buffer);
}
+JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsDisplay_adjustWindowRectEx
+ (JNIEnv *env, jclass unused, jobject rect_buffer, jlong style, jboolean menu, jlong styleex) {
+ jboolean result;
+ RECT clientRect;
+ copyBufferToRect(env, rect_buffer, &clientRect);
+ result = AdjustWindowRectEx(&clientRect, style, menu, styleex);
+ copyRectToBuffer(env, &clientRect, rect_buffer);
+ return result;
+}
+
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetNativeCursor
(JNIEnv *env, jclass unused, jlong hwnd_int, jobject handle_buffer)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|