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) |
2
|
3
|
4
|
|
5
|
6
(2) |
7
|
8
|
9
|
10
|
11
|
|
12
|
13
|
14
|
15
|
16
|
17
|
18
(3) |
|
19
|
20
|
21
|
22
|
23
|
24
|
25
|
|
26
|
27
|
28
(1) |
29
(1) |
|
|
|
|
From: <ka...@us...> - 2012-02-29 23:18:43
|
Revision: 3746
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3746&view=rev
Author: kappa1
Date: 2012-02-29 23:18:35 +0000 (Wed, 29 Feb 2012)
Log Message:
-----------
Implement a much more accurate Display.sync() method that auto adapts to the systems timer resolution and load.
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 2012-02-28 18:18:06 UTC (rev 3745)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2012-02-29 23:18:35 UTC (rev 3746)
@@ -79,9 +79,15 @@
/** The current display mode, if created */
private static DisplayMode current_mode;
- /** Timer for sync() */
- private static long timeThen;
+ /** time at last sync() */
+ private static long lastTime;
+ /** Whether the sync() method has been initiated */
+ private static boolean syncInitiated;
+
+ /** adaptive time to yield instead of sleeping in sync()*/
+ private static long adaptiveYieldTime = 1000*1000;
+
/** X coordinate of the window */
private static int x = -1;
@@ -401,41 +407,84 @@
}
}
- private static long timeLate;
-
/**
- * Best sync method that works reliably.
- *
+ * An accurate sync method that adapts automatically
+ * to the system it runs on to provide reliable results.
+ *
* @param fps The desired frame rate, in frames per second
*/
public static void sync(int fps) {
- long timeNow;
- long gapTo;
- long savedTimeLate;
- synchronized ( GlobalLock.lock ) {
- gapTo = Sys.getTimerResolution() / fps + timeThen;
- timeNow = Sys.getTime();
- savedTimeLate = timeLate;
- }
-
+ if (fps <= 0) return;
+ if (!syncInitiated) initiateSyncTimer();
+
+ long sleepTime = 1000000000 / fps; // nanoseconds to sleep this frame
+ // adaptiveYieldTime + remainder micro & nano seconds if smaller than sleepTime
+ long yieldTime = Math.min(sleepTime, adaptiveYieldTime + sleepTime % (1000*1000));
+ long overSleep = 0; // time the sync goes over by
+
try {
- while ( gapTo > timeNow + savedTimeLate ) {
- Thread.sleep(1);
- timeNow = Sys.getTime();
+ while (true) {
+ long t = getTime() - lastTime;
+
+ if (t < sleepTime - yieldTime) {
+ Thread.sleep(1);
+ }
+ else if (t < sleepTime) {
+ // burn the last few CPU cycles to ensure accuracy
+ Thread.yield();
+ }
+ else {
+ overSleep = t - sleepTime;
+ break; // exit while loop
+ }
}
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
+ } catch (InterruptedException e) {}
+
+ lastTime = getTime() - Math.min(overSleep, sleepTime);
+
+ // auto tune the amount of time to yield
+ if (overSleep > adaptiveYieldTime) {
+ // increase by 500 microseconds (half a ms)
+ adaptiveYieldTime = Math.min(adaptiveYieldTime + 500*1000, sleepTime);
}
-
- synchronized ( GlobalLock.lock ) {
- if ( gapTo < timeNow )
- timeLate = timeNow - gapTo;
- else
- timeLate = 0;
-
- timeThen = timeNow;
+ else if (overSleep < adaptiveYieldTime - 1000*1000) {
+ // decrease by 5 microseconds
+ adaptiveYieldTime = Math.max(adaptiveYieldTime - 5*1000, 1000*1000);
}
}
+
+ /**
+ * Get System Nano Time
+ * @return will return the current time in nano's
+ */
+ private static long getTime() {
+ return (Sys.getTime() * 1000000000) / Sys.getTimerResolution();
+ }
+
+ /**
+ * On windows the sleep functions can be highly inaccurate by
+ * over 10ms making in unusable. However it can be forced to
+ * be a bit more accurate by running a separate sleeping daemon
+ * thread.
+ */
+ private static void initiateSyncTimer() {
+ syncInitiated = true;
+
+ if (!System.getProperty("os.name").startsWith("Win")) {
+ return;
+ }
+
+ Thread timerAccuracyThread = new Thread(new Runnable() {
+ public void run() {
+ try {
+ Thread.sleep(Long.MAX_VALUE);
+ } catch (Exception e) {}
+ }
+ });
+
+ timerAccuracyThread.setDaemon(true);
+ timerAccuracyThread.start();
+ }
/** @return the title of the window */
public static String getTitle() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sp...@us...> - 2012-02-28 18:18:17
|
Revision: 3745
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3745&view=rev
Author: spasi
Date: 2012-02-28 18:18:06 +0000 (Tue, 28 Feb 2012)
Log Message:
-----------
Fixed clEnqueueNativeKernel crash.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java
trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c
trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java
Modified: trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java 2012-02-18 18:38:57 UTC (rev 3744)
+++ trunk/LWJGL/src/java/org/lwjgl/MemoryUtil.java 2012-02-28 18:18:06 UTC (rev 3745)
@@ -362,16 +362,18 @@
return getDeclaredFieldRecursive(ByteBuffer.class, "address");
}
- private static Field getDeclaredFieldRecursive(Class<?> type, final String fieldName) throws NoSuchFieldException {
- while ( type != null ) {
+ private static Field getDeclaredFieldRecursive(final Class<?> root, final String fieldName) throws NoSuchFieldException {
+ Class<?> type = root;
+
+ do {
try {
return type.getDeclaredField(fieldName);
} catch (NoSuchFieldException e) {
type = type.getSuperclass();
}
- }
+ } while ( type != null );
- throw new NoSuchFieldException(fieldName + " does not exist in " + type.getSimpleName() + " or any of its superclasses.");
+ throw new NoSuchFieldException(fieldName + " does not exist in " + root.getSimpleName() + " or any of its superclasses.");
}
}
Modified: trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c
===================================================================
--- trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c 2012-02-18 18:38:57 UTC (rev 3744)
+++ trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c 2012-02-28 18:18:06 UTC (rev 3745)
@@ -146,10 +146,10 @@
static void CL_CALLBACK nativeKernelCallback(void *args) {
JNIEnv *env = attachCurrentThread();
jobject user_func = (jobject)(intptr_t)*(jlong *)args;
- jint num_mem_objects = *(jint *)((char *)args + 8);
+ jsize num_mem_objects = *(jsize *)((char *)args + 8);
jobjectArray memobjs = NULL;
jobject buffer;
- jint i;
+ jsize i;
if ( env != NULL && !(*env)->ExceptionOccurred(env) && nativeKernelCallbackJ != NULL ) {
if ( num_mem_objects > 0 ) {
Modified: trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java 2012-02-18 18:38:57 UTC (rev 3744)
+++ trunk/LWJGL/src/templates/org/lwjgl/opencl/CL10.java 2012-02-28 18:18:06 UTC (rev 3745)
@@ -1073,7 +1073,7 @@
nativeAfterVars = "\tvoid **args_mem_loc = num_mem_objects == 0 ? NULL : (void **)malloc(num_mem_objects * sizeof(void *));",
nativeBeforeCall = "\t_ptr_i = 0;\n" +
"\twhile ( _ptr_i < num_mem_objects ) {\n" +
- "\t\targs_mem_loc[_ptr_i] = (cl_void *)((char *)args_address + (4 + _ptr_i * (4 + sizeof(void *))));\n" +
+ "\t\targs_mem_loc[_ptr_i] = (cl_void *)((char *)args_address + (12 + 4 + _ptr_i * (4 + sizeof(void *))));\n" +
"\t\t_ptr_i++;\n" +
"\t}",
nativeAfterCall = "\tfree(args_mem_loc);"
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: <ka...@us...> - 2012-02-18 16:30:45
|
Revision: 3743
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3743&view=rev
Author: kappa1
Date: 2012-02-18 16:30:38 +0000 (Sat, 18 Feb 2012)
Log Message:
-----------
Added the new public API's Display.getX() and Display.getY(). Currently implemented for Linux and Mac. Windows implementation pending.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
trunk/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java
trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java
trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java
trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2012-02-18 01:49:46 UTC (rev 3742)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2012-02-18 16:30:38 UTC (rev 3743)
@@ -1282,10 +1282,50 @@
}
/**
+ * @return this method will return the x position (top-left) of the Display window.
+ *
+ * If running in fullscreen mode it will return 0.
+ * If Display.setParent(Canvas parent) is being used, the x position of
+ * the parent will be returned.
+ */
+ public static int getX() {
+
+ if (Display.isFullscreen()) {
+ return 0;
+ }
+
+ if (parent != null) {
+ return parent.getX();
+ }
+
+ return display_impl.getX();
+ }
+
+ /**
+ * @return this method will return the y position (top-left) of the Display window.
+ *
+ * If running in fullscreen mode it will return 0.
+ * If Display.setParent(Canvas parent) is being used, the y position of
+ * the parent will be returned.
+ */
+ public static int getY() {
+
+ if (Display.isFullscreen()) {
+ return 0;
+ }
+
+ if (parent != null) {
+ return parent.getY();
+ }
+
+ return display_impl.getY();
+ }
+
+ /**
* @return this method will return the width of the Display window.
*
* If running in fullscreen mode it will return the width of the current set DisplayMode.
- * If running Display.setParent(Canvas parent) is being used, the width of the parent
+ * If Display.setParent(Canvas parent) is being used, the width of the parent
* will be returned.
*
* This value will be updated after a call to Display.update().
@@ -1307,7 +1347,7 @@
* @return this method will return the height of the Display window.
*
* If running in fullscreen mode it will return the height of the current set DisplayMode.
- * If running Display.setParent(Canvas parent) is being used, the height of the parent
+ * If Display.setParent(Canvas parent) is being used, the height of the parent
* will be returned.
*
* This value will be updated after a call to Display.update().
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java 2012-02-18 01:49:46 UTC (rev 3742)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java 2012-02-18 16:30:38 UTC (rev 3743)
@@ -174,12 +174,22 @@
boolean wasResized();
/**
- * @return this method will return a the width of the Display window.
+ * @return this method will return the width of the Display window.
*/
int getWidth();
/**
- * @return this method will return a the height of the Display window.
+ * @return this method will return the height of the Display window.
*/
int getHeight();
+
+ /**
+ * @return this method will return the top-left x position of the Display window.
+ */
+ int getX();
+
+ /**
+ * @return this method will return the top-left y position of the Display window.
+ */
+ int getY();
}
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2012-02-18 01:49:46 UTC (rev 3742)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2012-02-18 16:30:38 UTC (rev 3743)
@@ -473,6 +473,8 @@
parent_window = parent != null ? getHandle(parent) : getRootWindow(getDisplay(), getDefaultScreen());
resizable = Display.isResizable();
resized = false;
+ window_x = x;
+ window_y = y;
window_width = mode.getWidth();
window_height = mode.getHeight();
current_window = nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y, undecorated, parent_window, resizable);
@@ -1387,6 +1389,14 @@
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 getX() {
+ return window_x;
+ }
+
+ public int getY() {
+ return window_y;
+ }
+
public int getWidth() {
return window_width;
}
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java 2012-02-18 01:49:46 UTC (rev 3742)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java 2012-02-18 16:30:38 UTC (rev 3743)
@@ -495,7 +495,15 @@
// Don't use any icon, since Mac OS X windows don't have window icons
return 0;
}
+
+ public int getX() {
+ return frame.getX();
+ }
+ public int getY() {
+ return frame.getY();
+ }
+
public int getWidth() {
return frame.getWidth();
}
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-02-18 01:49:46 UTC (rev 3742)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2012-02-18 16:30:38 UTC (rev 3743)
@@ -1013,7 +1013,15 @@
return defWindowProc(hwnd, msg, wParam, lParam);
}
}
+
+ public int getX() {
+ return 0; // placeholder until implemented
+ }
+ public int getY() {
+ return 0; // placeholder until implemented
+ }
+
public int getWidth() {
return width;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ka...@us...> - 2012-02-18 01:49:52
|
Revision: 3742
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3742&view=rev
Author: kappa1
Date: 2012-02-18 01:49:46 +0000 (Sat, 18 Feb 2012)
Log Message:
-----------
Implement the ability for the native Display window on Linux to get its x and y position. In preparation for adding the new Display.getX() & getY() API's.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java
trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxEvent.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 2012-02-06 20:35:25 UTC (rev 3741)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2012-02-18 01:49:46 UTC (rev 3742)
@@ -144,6 +144,8 @@
private boolean resizable;
private boolean resized;
+ private int window_x;
+ private int window_y;
private int window_width;
private int window_height;
@@ -516,6 +518,8 @@
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 nGetX(long display, long window);
+ private static native int nGetY(long display, long window);
private static native int nGetWidth(long display, long window);
private static native int nGetHeight(long display, long window);
@@ -840,10 +844,17 @@
break;
case LinuxEvent.Expose:
dirty = true;
+ break;
+ case LinuxEvent.ConfigureNotify:
+ int x = nGetX(getDisplay(), getWindow());
+ int y = nGetY(getDisplay(), getWindow());
int width = nGetWidth(getDisplay(), getWindow());
int height = nGetHeight(getDisplay(), getWindow());
+ window_x = x;
+ window_y = y;
+
if (window_width != width || window_height != height) {
resized = true;
window_width = width;
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxEvent.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxEvent.java 2012-02-06 20:35:25 UTC (rev 3741)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxEvent.java 2012-02-18 01:49:46 UTC (rev 3742)
@@ -53,6 +53,7 @@
public static final int UnmapNotify = 18;
public static final int MapNotify = 19;
public static final int Expose = 12;
+ public static final int ConfigureNotify = 22;
public static final int ClientMessage = 33;
private final ByteBuffer event_buffer;
Modified: trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c 2012-02-06 20:35:25 UTC (rev 3741)
+++ trunk/LWJGL/src/native/linux/opengl/org_lwjgl_opengl_Display.c 2012-02-18 01:49:46 UTC (rev 3742)
@@ -283,6 +283,49 @@
return RootWindow(disp, screen);
}
+static Window getCurrentWindow(JNIEnv *env, jlong display_ptr, jlong window_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+
+ Window parent = (Window)window_ptr;
+ Window win, root;
+
+ Window *children;
+ unsigned int nchildren;
+
+ do {
+ win = parent;
+
+ if (XQueryTree(disp, win, &root, &parent, &children, &nchildren) == 0) {
+ throwException(env, "XQueryTree failed");
+ return 0;
+ }
+
+ if (children != NULL) XFree(children);
+ } while (parent != root);
+
+ return win;
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetX(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ Window win = getCurrentWindow(env, display_ptr, window_ptr);
+
+ XWindowAttributes win_attribs;
+ XGetWindowAttributes(disp, win, &win_attribs);
+
+ return win_attribs.x;
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetY(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ Window win = getCurrentWindow(env, display_ptr, window_ptr);
+
+ XWindowAttributes win_attribs;
+ XGetWindowAttributes(disp, win, &win_attribs);
+
+ return win_attribs.y;
+}
+
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;
@@ -381,7 +424,7 @@
setDecorations(disp, win, 0);
}
- if (RootWindow(disp, screen) == parent_handle) { // on set hints when Display.setParent isn't used
+ if (RootWindow(disp, screen) == parent_handle) { // only set hints when Display.setParent isn't used
updateWindowBounds(disp, win, x, y, width, height, JNI_TRUE, resizable);
updateWindowHints(env, disp, win);
}
Modified: trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c 2012-02-06 20:35:25 UTC (rev 3741)
+++ trunk/LWJGL/src/native/linux/opengles/org_lwjgl_opengl_Display.c 2012-02-18 01:49:46 UTC (rev 3742)
@@ -273,6 +273,49 @@
return RootWindow(disp, screen);
}
+static Window getCurrentWindow(JNIEnv *env, jlong display_ptr, jlong window_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+
+ Window parent = (Window)window_ptr;
+ Window win, root;
+
+ Window *children;
+ unsigned int nchildren;
+
+ do {
+ win = parent;
+
+ if (XQueryTree(disp, win, &root, &parent, &children, &nchildren) == 0) {
+ throwException(env, "XQueryTree failed");
+ return 0;
+ }
+
+ if (children != NULL) XFree(children);
+ } while (parent != root);
+
+ return win;
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetX(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ Window win = getCurrentWindow(env, display_ptr, window_ptr);
+
+ XWindowAttributes win_attribs;
+ XGetWindowAttributes(disp, win, &win_attribs);
+
+ return win_attribs.x;
+}
+
+JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetY(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr) {
+ Display *disp = (Display *)(intptr_t)display_ptr;
+ Window win = getCurrentWindow(env, display_ptr, window_ptr);
+
+ XWindowAttributes win_attribs;
+ XGetWindowAttributes(disp, win, &win_attribs);
+
+ return win_attribs.y;
+}
+
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;
@@ -375,7 +418,7 @@
setDecorations(disp, win, 0);
}
- if (RootWindow(disp, screen) == parent_handle) { // on set hints when Display.setParent isn't used
+ if (RootWindow(disp, screen) == parent_handle) { // only set hints when Display.setParent isn't used
updateWindowBounds(disp, win, x, y, width, height, JNI_TRUE, resizable);
updateWindowHints(env, disp, win);
}
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: <sp...@us...> - 2012-02-06 19:26:28
|
Revision: 3740
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3740&view=rev
Author: spasi
Date: 2012-02-06 19:26:21 +0000 (Mon, 06 Feb 2012)
Log Message:
-----------
Added support for AMD_media_ops2.
Added Paths:
-----------
trunk/LWJGL/src/templates/org/lwjgl/opencl/AMD_media_ops2.java
Added: trunk/LWJGL/src/templates/org/lwjgl/opencl/AMD_media_ops2.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opencl/AMD_media_ops2.java (rev 0)
+++ trunk/LWJGL/src/templates/org/lwjgl/opencl/AMD_media_ops2.java 2012-02-06 19:26:21 UTC (rev 3740)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2002-2010 LWJGL Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'LWJGL' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.lwjgl.opencl;
+
+import org.lwjgl.util.generator.opencl.CLDeviceExtension;
+
+@CLDeviceExtension
+public interface AMD_media_ops2 {
+
+}
\ No newline at end of file
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-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.
|