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
(2) |
4
(1) |
5
(1) |
6
(3) |
7
|
8
(2) |
|
9
|
10
(1) |
11
(6) |
12
(8) |
13
(2) |
14
(2) |
15
(6) |
|
16
|
17
(1) |
18
(1) |
19
|
20
(2) |
21
(1) |
22
|
|
23
|
24
|
25
(3) |
26
(1) |
27
|
28
|
29
|
|
30
(1) |
31
|
|
|
|
|
|
|
From: <ka...@us...> - 2011-10-02 20:41:40
|
Revision: 3645
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3645&view=rev
Author: kappa1
Date: 2011-10-02 20:41:33 +0000 (Sun, 02 Oct 2011)
Log Message:
-----------
Implement Resizing API for Linux.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java
trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c
trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2011-09-30 11:28:53 UTC (rev 3644)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2011-10-02 20:41:33 UTC (rev 3645)
@@ -141,7 +141,12 @@
private long current_cursor;
private long blank_cursor;
private boolean mouseInside = true;
-
+ private boolean resizable;
+ private boolean resized;
+
+ private int window_width;
+ private int window_height;
+
private Canvas parent;
private long parent_window;
private static boolean xembedded;
@@ -461,7 +466,11 @@
boolean undecorated = Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated") || (current_window_mode != WINDOWED && Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated_fs"));
this.parent = parent;
parent_window = parent != null ? getHandle(parent) : getRootWindow(getDisplay(), getDefaultScreen());
- current_window = nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y, undecorated, parent_window);
+ resizable = Display.isResizable();
+ resized = false;
+ window_width = mode.getWidth();
+ window_height = mode.getHeight();
+ current_window = nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y, undecorated, parent_window, resizable);
mapRaised(getDisplay(), current_window);
xembedded = parent != null && isAncestorXEmbedded(parent_window);
blank_cursor = createBlankCursor();
@@ -495,7 +504,7 @@
unlockAWT();
}
}
- private static native long nCreateWindow(long display, int screen, ByteBuffer peer_info_handle, DisplayMode mode, int window_mode, int x, int y, boolean undecorated, long parent_handle) throws LWJGLException;
+ private static native long nCreateWindow(long display, int screen, ByteBuffer peer_info_handle, DisplayMode mode, int window_mode, int x, int y, boolean undecorated, long parent_handle, boolean resizable) throws LWJGLException;
private static native long getRootWindow(long display, int screen);
private static native boolean hasProperty(long display, long window, long property);
private static native long getParentWindow(long display, long window) throws LWJGLException;
@@ -504,6 +513,9 @@
private static native void reparentWindow(long display, long window, long parent, int x, int y);
private static native long nGetInputFocus(long display) throws LWJGLException;
private static native void nSetInputFocus(long display, long window, long time);
+ private static native void nSetWindowSize(long display, long window, int width, int height, boolean resizable);
+ private static native int nGetWidth(long display, long window);
+ private static native int nGetHeight(long display, long window);
private static boolean isAncestorXEmbedded(long window) throws LWJGLException {
long xembed_atom = internAtom("_XEMBED_INFO", true);
@@ -823,6 +835,16 @@
break;
case LinuxEvent.Expose:
dirty = true;
+
+ int width = nGetWidth(getDisplay(), getWindow());
+ int height = nGetHeight(getDisplay(), getWindow());
+
+ if (window_width != width || window_height != height) {
+ resized = true;
+ window_width = width;
+ window_height = height;
+ }
+
break;
case LinuxEvent.EnterNotify:
mouseInside = true;
@@ -1346,11 +1368,11 @@
private static native void nSetWindowIcon(long display, long window, ByteBuffer icon_rgb, int icon_rgb_size, ByteBuffer icon_mask, int icon_mask_size, int width, int height);
public int getWidth() {
- return Display.getDisplayMode().getWidth();
+ return window_width;
}
public int getHeight() {
- return Display.getDisplayMode().getHeight();
+ return window_height;
}
public boolean isInsideWindow() {
@@ -1358,10 +1380,20 @@
}
public void setResizable(boolean resizable) {
-
+ if (this.resizable == resizable) {
+ return;
+ }
+
+ this.resizable = resizable;
+ nSetWindowSize(getDisplay(), getWindow(), window_width, window_height, resizable);
}
public boolean wasResized() {
+ if (resized) {
+ resized = false;
+ return true;
+ }
+
return false;
}
Modified: trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c 2011-09-30 11:28:53 UTC (rev 3644)
+++ trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c 2011-10-02 20:41:33 UTC (rev 3645)
@@ -278,6 +278,26 @@
return RootWindow(disp, screen);
}
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetWidth(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ Window win = (Window)window_ptr;
+ XWindowAttributes win_attribs;
+
+ XGetWindowAttributes(disp, win, &win_attribs);
+
+ return win_attribs.width;
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetHeight(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ Window win = (Window)window_ptr;
+ XWindowAttributes win_attribs;
+
+ XGetWindowAttributes(disp, win, &win_attribs);
+
+ return win_attribs.height;
+}
+
static void updateWindowHints(JNIEnv *env, Display *disp, Window window) {
XWMHints* win_hints = XAllocWMHints();
if (win_hints == NULL) {
@@ -301,7 +321,28 @@
XFlush(disp);
}
-static Window createWindow(JNIEnv* env, Display *disp, int screen, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height, jboolean undecorated, long parent_handle) {
+static void updateWindowBounds(Display *disp, Window win, int x, int y, int width, int height, jboolean position, jboolean resizable) {
+ XSizeHints *window_hints = XAllocSizeHints();
+
+ if (position) {
+ window_hints->flags |= PPosition;
+ window_hints->x = x;
+ window_hints->y = y;
+ }
+
+ if (!resizable) {
+ window_hints->flags |= PMinSize | PMaxSize;
+ window_hints->min_width = width;
+ window_hints->max_width = width;
+ window_hints->min_height = height;
+ window_hints->max_height = height;
+ }
+
+ XSetWMNormalHints(disp, win, window_hints);
+ XFree(window_hints);
+}
+
+static Window createWindow(JNIEnv* env, Display *disp, int screen, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height, jboolean undecorated, long parent_handle, jboolean resizable) {
Window parent = (Window)parent_handle;
Window win;
XSetWindowAttributes attribs;
@@ -334,17 +375,10 @@
// Use Motif decoration hint property and hope the window manager respects them
setDecorations(disp, win, 0);
}
- XSizeHints * window_hints = XAllocSizeHints();
- window_hints->flags = PPosition | PMinSize | PMaxSize;
- window_hints->x = x;
- window_hints->y = y;
- window_hints->min_width = width;
- window_hints->max_width = width;
- window_hints->min_height = height;
- window_hints->max_height = height;
- XSetWMNormalHints(disp, win, window_hints);
+
+ updateWindowBounds(disp, win, x, y, width, height, JNI_TRUE, resizable);
updateWindowHints(env, disp, win);
- XFree(window_hints);
+
#define NUM_ATOMS 1
Atom protocol_atoms[NUM_ATOMS] = {XInternAtom(disp, "WM_DELETE_WINDOW", False)/*, XInternAtom(disp, "WM_TAKE_FOCUS", False)*/};
XSetWMProtocols(disp, win, protocol_atoms, NUM_ATOMS);
@@ -437,7 +471,7 @@
XSetInputFocus(disp, window, RevertToParent, time);
}
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jobject mode, jint window_mode, jint x, jint y, jboolean undecorated, jlong parent_handle) {
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jobject mode, jint window_mode, jint x, jint y, jboolean undecorated, jlong parent_handle, jboolean resizable) {
Display *disp = (Display *)(intptr_t)display;
X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
GLXFBConfig *fb_config = NULL;
@@ -451,7 +485,7 @@
jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I");
int width = (*env)->GetIntField(env, mode, fid_width);
int height = (*env)->GetIntField(env, mode, fid_height);
- Window win = createWindow(env, disp, screen, window_mode, peer_info, x, y, width, height, undecorated, parent_handle);
+ Window win = createWindow(env, disp, screen, window_mode, peer_info, x, y, width, height, undecorated, parent_handle, resizable);
if ((*env)->ExceptionOccurred(env)) {
return 0;
}
@@ -466,6 +500,12 @@
return win;
}
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetWindowSize(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr, jint width, jint height, jboolean resizable) {
+ Display *disp = (Display *)(intptr_t)display;
+ Window win = (Window)window_ptr;
+ updateWindowBounds(disp, win, 0, 0, width, height, JNI_FALSE, resizable);
+}
+
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDestroyWindow(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr) {
Display *disp = (Display *)(intptr_t)display;
Window window = (Window)window_ptr;
Modified: trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c 2011-09-30 11:28:53 UTC (rev 3644)
+++ trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c 2011-10-02 20:41:33 UTC (rev 3645)
@@ -268,6 +268,26 @@
return RootWindow(disp, screen);
}
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetWidth(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ Window win = (Window)window_ptr;
+ XWindowAttributes win_attribs;
+
+ XGetWindowAttributes(disp, win, &win_attribs);
+
+ return win_attribs.width;
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetHeight(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ Window win = (Window)window_ptr;
+ XWindowAttributes win_attribs;
+
+ XGetWindowAttributes(disp, win, &win_attribs);
+
+ return win_attribs.height;
+}
+
static void updateWindowHints(JNIEnv *env, Display *disp, Window window) {
XWMHints* win_hints = XAllocWMHints();
if (win_hints == NULL) {
@@ -291,7 +311,28 @@
XFlush(disp);
}
-static Window createWindow(JNIEnv* env, Display *disp, int screen, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height, jboolean undecorated, long parent_handle) {
+static void updateWindowBounds(Display *disp, Window win, int x, int y, int width, int height, jboolean position, jboolean resizable) {
+ XSizeHints *window_hints = XAllocSizeHints();
+
+ if (position) {
+ window_hints->flags |= PPosition;
+ window_hints->x = x;
+ window_hints->y = y;
+ }
+
+ if (!resizable) {
+ window_hints->flags |= PMinSize | PMaxSize;
+ window_hints->min_width = width;
+ window_hints->max_width = width;
+ window_hints->min_height = height;
+ window_hints->max_height = height;
+ }
+
+ XSetWMNormalHints(disp, win, window_hints);
+ XFree(window_hints);
+}
+
+static Window createWindow(JNIEnv* env, Display *disp, int screen, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height, jboolean undecorated, long parent_handle, jboolean resizable) {
Window parent = (Window)parent_handle;
Window win;
XSetWindowAttributes attribs;
@@ -328,17 +369,10 @@
// Use Motif decoration hint property and hope the window manager respects them
setDecorations(disp, win, 0);
}
- XSizeHints * window_hints = XAllocSizeHints();
- window_hints->flags = PPosition | PMinSize | PMaxSize;
- window_hints->x = x;
- window_hints->y = y;
- window_hints->min_width = width;
- window_hints->max_width = width;
- window_hints->min_height = height;
- window_hints->max_height = height;
- XSetWMNormalHints(disp, win, window_hints);
+
+ updateWindowBounds(disp, win, x, y, width, height, JNI_TRUE, resizable);
updateWindowHints(env, disp, win);
- XFree(window_hints);
+
#define NUM_ATOMS 1
Atom protocol_atoms[NUM_ATOMS] = {XInternAtom(disp, "WM_DELETE_WINDOW", False)/*, XInternAtom(disp, "WM_TAKE_FOCUS", False)*/};
XSetWMProtocols(disp, win, protocol_atoms, NUM_ATOMS);
@@ -431,7 +465,7 @@
XSetInputFocus(disp, window, RevertToParent, time);
}
-JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jobject mode, jint window_mode, jint x, jint y, jboolean undecorated, jlong parent_handle) {
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jlong display, jint screen, jobject peer_info_handle, jobject mode, jint window_mode, jint x, jint y, jboolean undecorated, jlong parent_handle, jboolean resizable) {
Display *disp = (Display *)(intptr_t)display;
X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle);
@@ -443,7 +477,7 @@
int width = (*env)->GetIntField(env, mode, fid_width);
int height = (*env)->GetIntField(env, mode, fid_height);
- Window win = createWindow(env, disp, screen, window_mode, peer_info, x, y, width, height, undecorated, parent_handle);
+ Window win = createWindow(env, disp, screen, window_mode, peer_info, x, y, width, height, undecorated, parent_handle, resizable);
if ((*env)->ExceptionOccurred(env))
return 0;
@@ -454,6 +488,12 @@
return win;
}
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetWindowSize(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr, jint width, jint height, jboolean resizable) {
+ Display *disp = (Display *)(intptr_t)display;
+ Window win = (Window)window_ptr;
+ updateWindowBounds(disp, win, 0, 0, width, height, JNI_FALSE, resizable);
+}
+
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nDestroyWindow(JNIEnv *env, jclass clazz, jlong display, jlong window_ptr) {
Display *disp = (Display *)(intptr_t)display;
Window window = (Window)window_ptr;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|