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
(1) |
2
|
3
(1) |
|
4
(1) |
5
|
6
|
7
|
8
(1) |
9
|
10
(1) |
|
11
|
12
(1) |
13
|
14
|
15
|
16
(1) |
17
(1) |
|
18
|
19
|
20
|
21
(1) |
22
|
23
(3) |
24
(1) |
|
25
(1) |
26
|
27
|
28
|
|
|
|
|
From: <eli...@us...> - 2007-02-25 21:52:12
|
Revision: 2746
http://svn.sourceforge.net/java-game-lib/?rev=2746&view=rev
Author: elias_naur
Date: 2007-02-25 13:52:11 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
Updated jinput.jar and libjinput.jnilib to the latest version
Modified Paths:
--------------
trunk/LWJGL/libs/jinput.jar
trunk/LWJGL/libs/macosx/libjinput-osx.jnilib
Modified: trunk/LWJGL/libs/jinput.jar
===================================================================
(Binary files differ)
Modified: trunk/LWJGL/libs/macosx/libjinput-osx.jnilib
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2007-02-24 18:41:44
|
Revision: 2745
http://svn.sourceforge.net/java-game-lib/?rev=2745&view=rev
Author: elias_naur
Date: 2007-02-24 10:41:41 -0800 (Sat, 24 Feb 2007)
Log Message:
-----------
Added a Pbuffer constructor that omits the RenderTexture parameter, and added a note that FBOs should be used instead, if available. Render-to-texture pbuffers can only be available on Windows platforms and is thus not portable.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/Pbuffer.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Pbuffer.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/Pbuffer.java 2007-02-23 10:14:18 UTC (rev 2744)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Pbuffer.java 2007-02-24 18:41:41 UTC (rev 2745)
@@ -165,9 +165,28 @@
* or, if <code>shared_context</code> is <code>null</code>, the Display context if it is created. The Pbuffer
* will have its own OpenGL state. Therefore, state changes to a pbuffer will not be seen in the window context and vice versa.
* <p/>
+ *
+ * @param width Pbuffer width
+ * @param height Pbuffer height
+ * @param pixel_format Minimum Pbuffer context properties
+ * @param shared_drawable If non-null the Pbuffer will share display lists and textures with it. Otherwise, the Pbuffer will share
+ * with the Display context (if created).
+ */
+ public Pbuffer(int width, int height, PixelFormat pixel_format, Drawable shared_drawable) throws LWJGLException {
+ this(width, height, pixel_format, null, shared_drawable);
+ }
+
+ /**
+ * Create an instance of a Pbuffer with a unique OpenGL context. The buffer is single-buffered.
+ * <p/>
+ * NOTE: The Pbuffer will have its own context that shares display lists and textures with <code>shared_context</code>,
+ * or, if <code>shared_context</code> is <code>null</code>, the Display context if it is created. The Pbuffer
+ * will have its own OpenGL state. Therefore, state changes to a pbuffer will not be seen in the window context and vice versa.
+ * <p/>
* The renderTexture parameter defines the necessary state for enabling render-to-texture. When this parameter is null,
* render-to-texture is not available. Before using render-to-texture, the Pbuffer capabilities must be queried to ensure that
- * it is supported.
+ * it is supported. Currently only windows platform can support this feature, so it is recommended that EXT_framebuffer_object
+ * or similar is used if available, for maximum portability.
* <p/>
*
* @param width Pbuffer width
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2007-02-23 10:14:20
|
Revision: 2744
http://svn.sourceforge.net/java-game-lib/?rev=2744&view=rev
Author: elias_naur
Date: 2007-02-23 02:14:18 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
Linux: When creating a window don't loop waiting for the MapNotify event. Instead, make sure we don't immediately go from fullscreen to minimized by checking if the window has been focused at least once before minimizing (and resetting display mode).
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java
trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-02-23 08:31:59 UTC (rev 2743)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-02-23 10:14:18 UTC (rev 2744)
@@ -110,6 +110,7 @@
private boolean minimized;
private boolean dirty;
private boolean close_requested;
+ private boolean focused_at_least_once;
private long current_cursor;
private long blank_cursor;
@@ -398,6 +399,7 @@
pointer_grabbed = false;
keyboard_grabbed = false;
close_requested = false;
+ focused_at_least_once = false;
grab = false;
minimized = false;
dirty = true;
@@ -750,8 +752,9 @@
private void checkInput() {
focused = nGetInputFocus(getDisplay()) == getWindow();
if (focused) {
+ focused_at_least_once = true;
acquireInput();
- } else {
+ } else if (focused_at_least_once) {
releaseInput();
}
}
Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2007-02-23 08:31:59 UTC (rev 2743)
+++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2007-02-23 10:14:18 UTC (rev 2744)
@@ -127,13 +127,6 @@
return atom;
}
-static void waitMapped(Display *disp, Window win) {
- XEvent event;
- do {
- XMaskEvent(disp, StructureNotifyMask, &event);
- } while ((event.type != MapNotify) || (event.xmap.event != win));
-}
-
static void __attribute__ ((destructor)) my_fini(void) {
Display *disp = XOpenDisplay(NULL);
if (disp == NULL) {
@@ -294,7 +287,6 @@
XInternAtom(disp, "ATOM", False), 32, PropModeReplace, (const unsigned char*)&fullscreen_atom, 1);
}
XMapRaised(disp, win);
- waitMapped(disp, win);
if (!checkXError(env, disp)) {
destroyWindow(env, disp, win);
return 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2007-02-23 08:32:00
|
Revision: 2743
http://svn.sourceforge.net/java-game-lib/?rev=2743&view=rev
Author: elias_naur
Date: 2007-02-23 00:31:59 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
Linux: Don't call XSetInputFocus when creating a window. XSetInputFocus can fail if the window is not mapped when calling it, and it seems that it's rude to call XSetInputFocus according to the ICCCM when the application doesn't already have the focus in one of its subwindows.
Modified Paths:
--------------
trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c
Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2007-02-23 08:21:02 UTC (rev 2742)
+++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2007-02-23 08:31:59 UTC (rev 2743)
@@ -295,7 +295,6 @@
}
XMapRaised(disp, win);
waitMapped(disp, win);
- XSetInputFocus(disp, win, RevertToNone, CurrentTime);
if (!checkXError(env, disp)) {
destroyWindow(env, disp, win);
return 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2007-02-23 08:21:04
|
Revision: 2742
http://svn.sourceforge.net/java-game-lib/?rev=2742&view=rev
Author: elias_naur
Date: 2007-02-23 00:21:02 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
Linux: Don't use XClearWindow to clear the window, but rely on the OpenGL clearing instead. Also, remove redundant attributes in XCreateWindow
Modified Paths:
--------------
trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c
Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2007-02-21 13:44:33 UTC (rev 2741)
+++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2007-02-23 08:21:02 UTC (rev 2742)
@@ -258,9 +258,7 @@
cmap = XCreateColormap(disp, root_win, vis_info->visual, AllocNone);
attribs.colormap = cmap;
attribs.event_mask = ExposureMask | /*FocusChangeMask | */VisibilityChangeMask | StructureNotifyMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask;
- attribs.background_pixel = 0xFF000000;
- attribs.win_gravity = NorthWestGravity;
- attribmask = CWColormap | CWBackPixel | CWEventMask | CWWinGravity;
+ attribmask = CWColormap | CWEventMask;
if (isLegacyFullscreen(window_mode)) {
attribmask |= CWOverrideRedirect;
attribs.override_redirect = True;
@@ -297,7 +295,6 @@
}
XMapRaised(disp, win);
waitMapped(disp, win);
- XClearWindow(disp, win);
XSetInputFocus(disp, win, RevertToNone, CurrentTime);
if (!checkXError(env, disp)) {
destroyWindow(env, disp, win);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sp...@us...> - 2007-02-21 13:44:36
|
Revision: 2741
http://svn.sourceforge.net/java-game-lib/?rev=2741&view=rev
Author: spasi
Date: 2007-02-21 05:44:33 -0800 (Wed, 21 Feb 2007)
Log Message:
-----------
Added NV_geometry_shader4
Modified Paths:
--------------
trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java
Added Paths:
-----------
trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_geometry_shader4.java
Modified: trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java
===================================================================
--- trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java 2007-02-17 09:49:44 UTC (rev 2740)
+++ trunk/LWJGL/src/generated/org/lwjgl/opengl/ContextCapabilities.java 2007-02-21 13:44:33 UTC (rev 2741)
@@ -140,6 +140,7 @@
public final boolean GL_NV_fragment_program_option;
public final boolean GL_NV_framebuffer_multisample_coverage;
public final boolean GL_NV_geometry_program4;
+ public final boolean GL_NV_geometry_shader4;
public final boolean GL_NV_gpu_program4;
public final boolean GL_NV_half_float;
public final boolean GL_NV_light_max_exponent;
@@ -2736,6 +2737,7 @@
this.GL_NV_fragment_program_option = supported_extensions.contains("GL_NV_fragment_program_option");
this.GL_NV_framebuffer_multisample_coverage = supported_extensions.contains("GL_NV_framebuffer_multisample_coverage");
this.GL_NV_geometry_program4 = supported_extensions.contains("GL_NV_geometry_program4");
+ this.GL_NV_geometry_shader4 = supported_extensions.contains("GL_NV_geometry_shader4");
this.GL_NV_gpu_program4 = supported_extensions.contains("GL_NV_gpu_program4");
this.GL_NV_half_float = supported_extensions.contains("GL_NV_half_float");
this.GL_NV_light_max_exponent = supported_extensions.contains("GL_NV_light_max_exponent");
Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_geometry_shader4.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_geometry_shader4.java (rev 0)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_geometry_shader4.java 2007-02-21 13:44:33 UTC (rev 2741)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2002-2004 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.opengl;
+
+public interface NV_geometry_shader4 {
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <eli...@us...> - 2007-02-17 09:49:53
|
Revision: 2740
http://svn.sourceforge.net/java-game-lib/?rev=2740&view=rev
Author: elias_naur
Date: 2007-02-17 01:49:44 -0800 (Sat, 17 Feb 2007)
Log Message:
-----------
Windows: Don't exclude PFD_GENERIC_ACCELERATED formats when selecting pixel formats. Hopefully this will enable LWJGL to use the directx emulated opengl implementation on vista
Modified Paths:
--------------
trunk/LWJGL/src/native/windows/context.c
Modified: trunk/LWJGL/src/native/windows/context.c
===================================================================
--- trunk/LWJGL/src/native/windows/context.c 2007-02-12 12:18:26 UTC (rev 2739)
+++ trunk/LWJGL/src/native/windows/context.c 2007-02-17 09:49:44 UTC (rev 2740)
@@ -339,7 +339,7 @@
return -1;
}
- if ((desc.dwFlags & PFD_GENERIC_FORMAT) != 0 || (desc.dwFlags & PFD_GENERIC_ACCELERATED) != 0) {
+ if ((desc.dwFlags & PFD_GENERIC_FORMAT) != 0) {
jboolean allowSoftwareOpenGL = getBooleanProperty(env, "org.lwjgl.opengl.Display.allowSoftwareOpenGL");
// secondary check for software override
if(!allowSoftwareOpenGL) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Standard <msa...@cr...> - 2007-02-16 04:17:58
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2900.2912" name=3D"GENERATOR"> </HEAD> <BODY> <DIV align=3Dleft><FONT face=3DArial size=3D2><B>*** POTENTIAL POWERHOUSE GAINS POSSIBLE WITH ***HXPN***</B></FONT></DIV><BR> <DIV align=3Dleft><FONT face=3DArial size=3D2><I>Harris Exploration Inc</I></FONT></DIV> <DIV align=3Dleft><FONT face=3DArial size=3D2><I>Acquisition, Exploration and Development</I></FONT></DIV><BR> <DIV align=3Dleft><FONT face=3DArial size=3D2>Tick: <B>HXPN</B> </FONT></DIV> <DIV align=3Dleft><FONT face=3DArial size=3D2>Opening: <B>$1.50</B> </FONT></DIV> <DIV align=3Dleft><FONT face=3DArial size=3D2>GET IN ON FRIDAY FEBRUARY 16th 2007!</FONT></DIV> <DIV align=3Dleft><FONT face=3DArial size=3D2>Extended Day Target: <B>$2.00</B></FONT></DIV><BR> <DIV align=3Dleft><FONT face=3DArial size=3D2>Breaking News Headline:</FONT></DIV> <DIV align=3Dleft><FONT face=3DArial size=3D2><I>Harris Exploration Inc. Ecuador Gold Project</I></FONT></DIV><BR> <DIV align=3Dleft><FONT face=3DArial size=3D2>GUAYAQUIL, ECUADOR -- (MRKT WIRE) -- 02/15/07</FONT></DIV> <DIV align=3Dleft><FONT face=3DArial size=3D2><I>Harris Exploration Inc., (PKSHEET: HXPN). The geographic location of the Balsapamba property is identified as the Balsapamba Parish, Canton San Miguel de Bolivar, Bolivar Province in the Republic of Ecuador. The property is described as a polymetallic property, indicating the presence of several various mineral resources which have been divided into five mineralized blocks. These blocks are identified as Andres, Juan, Gilbert, El Cangrejo and Diana.</I></FONT></DIV><BR> <DIV align=3Dleft><FONT face=3DArial size=3D2><B><U>INFORMED INVESTORS ARE WINNERS, WATCH HXPN Trade on FRIDAY!<U></B></FONT></DIV></BODY></HTML> |
|
From: <eli...@us...> - 2007-02-12 12:18:36
|
Revision: 2739
http://svn.sourceforge.net/java-game-lib/?rev=2739&view=rev
Author: elias_naur
Date: 2007-02-12 04:18:26 -0800 (Mon, 12 Feb 2007)
Log Message:
-----------
Make the rest of LWJGL thread safe. No attempt have been done to make the locking minimal. Instead, one global lock is shared by Display, Mouse, Keyboard and Cursor. The lock surrounds all public methods.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/input/Cursor.java
trunk/LWJGL/src/java/org/lwjgl/input/Keyboard.java
trunk/LWJGL/src/java/org/lwjgl/input/Mouse.java
trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java
trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
Added Paths:
-----------
trunk/LWJGL/src/java/org/lwjgl/input/OpenGLPackageAccess.java
trunk/LWJGL/src/java/org/lwjgl/opengl/GlobalLock.java
Modified: trunk/LWJGL/src/java/org/lwjgl/input/Cursor.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/input/Cursor.java 2007-02-08 22:00:51 UTC (rev 2738)
+++ trunk/LWJGL/src/java/org/lwjgl/input/Cursor.java 2007-02-12 12:18:26 UTC (rev 2739)
@@ -83,27 +83,29 @@
* @throws LWJGLException if the cursor could not be created for any reason
*/
public Cursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
- if ((getCapabilities() & CURSOR_ONE_BIT_TRANSPARENCY) == 0)
- throw new LWJGLException("Native cursors not supported");
- BufferChecks.checkBuffer(images, width*height*numImages);
- if (!Mouse.isCreated())
- throw new IllegalStateException("Mouse must be created before creating cursor objects");
- if (width*height*numImages > images.remaining())
- throw new IllegalArgumentException("width*height*numImages > images.remaining()");
- if (delays != null && numImages > delays.remaining())
- BufferChecks.checkBuffer(delays, numImages);
- if (xHotspot >= width || xHotspot < 0)
- throw new IllegalArgumentException("xHotspot > width || xHotspot < 0");
- if (yHotspot >= height || yHotspot < 0)
- throw new IllegalArgumentException("yHotspot > height || yHotspot < 0");
-
- Sys.initialize();
-
- // Hmm
- yHotspot = height - 1 - yHotspot;
-
- // create cursor (or cursors if multiple images supplied)
- cursors = createCursors(width, height, xHotspot, yHotspot, numImages, images, delays);
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if ((getCapabilities() & CURSOR_ONE_BIT_TRANSPARENCY) == 0)
+ throw new LWJGLException("Native cursors not supported");
+ BufferChecks.checkBuffer(images, width*height*numImages);
+ if (!Mouse.isCreated())
+ throw new IllegalStateException("Mouse must be created before creating cursor objects");
+ if (width*height*numImages > images.remaining())
+ throw new IllegalArgumentException("width*height*numImages > images.remaining()");
+ if (delays != null && numImages > delays.remaining())
+ BufferChecks.checkBuffer(delays, numImages);
+ if (xHotspot >= width || xHotspot < 0)
+ throw new IllegalArgumentException("xHotspot > width || xHotspot < 0");
+ if (yHotspot >= height || yHotspot < 0)
+ throw new IllegalArgumentException("yHotspot > height || yHotspot < 0");
+
+ Sys.initialize();
+
+ // Hmm
+ yHotspot = height - 1 - yHotspot;
+
+ // create cursor (or cursors if multiple images supplied)
+ cursors = createCursors(width, height, xHotspot, yHotspot, numImages, images, delays);
+ }
}
/**
@@ -114,9 +116,11 @@
* @return the maximum size of a native cursor
*/
public static int getMinCursorSize() {
- if (!Mouse.isCreated())
- throw new IllegalStateException("Mouse must be created.");
- return Mouse.getImplementation().getMinCursorSize();
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!Mouse.isCreated())
+ throw new IllegalStateException("Mouse must be created.");
+ return Mouse.getImplementation().getMinCursorSize();
+ }
}
/**
@@ -127,9 +131,11 @@
* @return the maximum size of a native cursor
*/
public static int getMaxCursorSize() {
- if (!Mouse.isCreated())
- throw new IllegalStateException("Mouse must be created.");
- return Mouse.getImplementation().getMaxCursorSize();
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!Mouse.isCreated())
+ throw new IllegalStateException("Mouse must be created.");
+ return Mouse.getImplementation().getMaxCursorSize();
+ }
}
/**
@@ -141,10 +147,12 @@
* @return A bit mask with native cursor capabilities.
*/
public static int getCapabilities() {
- if (Mouse.getImplementation() != null)
- return Mouse.getImplementation().getNativeCursorCapabilities();
- else
- return Mouse.createImplementation().getNativeCursorCapabilities();
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (Mouse.getImplementation() != null)
+ return Mouse.getImplementation().getNativeCursorCapabilities();
+ else
+ return OpenGLPackageAccess.createImplementation().getNativeCursorCapabilities();
+ }
}
/**
@@ -247,19 +255,21 @@
* OS cursor)
*/
public void destroy() {
- if (destroyed)
- return;
- if (Mouse.getNativeCursor() == this) {
- try {
- Mouse.setNativeCursor(null);
- } catch (LWJGLException e) {
- // ignore
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (destroyed)
+ return;
+ if (Mouse.getNativeCursor() == this) {
+ try {
+ Mouse.setNativeCursor(null);
+ } catch (LWJGLException e) {
+ // ignore
+ }
}
+ for(int i=0; i<cursors.length; i++) {
+ Mouse.getImplementation().destroyCursor(cursors[i].cursorHandle);
+ }
+ destroyed = true;
}
- for(int i=0; i<cursors.length; i++) {
- Mouse.getImplementation().destroyCursor(cursors[i].cursorHandle);
- }
- destroyed = true;
}
/**
Modified: trunk/LWJGL/src/java/org/lwjgl/input/Keyboard.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/input/Keyboard.java 2007-02-08 22:00:51 UTC (rev 2738)
+++ trunk/LWJGL/src/java/org/lwjgl/input/Keyboard.java 2007-02-12 12:18:26 UTC (rev 2739)
@@ -307,9 +307,11 @@
* @throws LWJGLException if the keyboard could not be created for any reason
*/
public static synchronized void create() throws LWJGLException {
- if (!Display.isCreated()) throw new IllegalStateException("Display must be created.");
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!Display.isCreated()) throw new IllegalStateException("Display must be created.");
- create(Mouse.createImplementation());
+ create(OpenGLPackageAccess.createImplementation());
+ }
}
private static void reset() {
@@ -325,18 +327,22 @@
* @return true if the keyboard has been created
*/
public static synchronized boolean isCreated() {
- return created;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return created;
+ }
}
/**
* "Destroy" the keyboard
*/
public static synchronized void destroy() {
- if (!created)
- return;
- created = false;
- implementation.destroyKeyboard();
- reset();
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created)
+ return;
+ created = false;
+ implementation.destroyKeyboard();
+ reset();
+ }
}
/**
@@ -358,10 +364,12 @@
* @see org.lwjgl.input.Keyboard#getEventCharacter()
*/
public static synchronized void poll() {
- if (!created)
- throw new IllegalStateException("Keyboard must be created before you can poll the device");
- implementation.pollKeyboard(keyDownBuffer);
- read();
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created)
+ throw new IllegalStateException("Keyboard must be created before you can poll the device");
+ implementation.pollKeyboard(keyDownBuffer);
+ read();
+ }
}
private static void read() {
@@ -376,9 +384,11 @@
* @return true if the key is down according to the last poll()
*/
public static synchronized boolean isKeyDown(int key) {
- if (!created)
- throw new IllegalStateException("Keyboard must be created before you can query key state");
- return keyDownBuffer.get(key) != 0;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created)
+ throw new IllegalStateException("Keyboard must be created before you can query key state");
+ return keyDownBuffer.get(key) != 0;
+ }
}
/**
@@ -419,9 +429,11 @@
* @return the number of keyboard events
*/
public static synchronized int getNumKeyboardEvents() {
- if (!created)
- throw new IllegalStateException("Keyboard must be created before you can read events");
- return readBuffer.remaining()/EVENT_SIZE;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created)
+ throw new IllegalStateException("Keyboard must be created before you can read events");
+ return readBuffer.remaining()/EVENT_SIZE;
+ }
}
/**
@@ -436,17 +448,19 @@
* @return true if a keyboard event was read, false otherwise
*/
public static synchronized boolean next() {
- if (!created)
- throw new IllegalStateException("Keyboard must be created before you can read events");
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created)
+ throw new IllegalStateException("Keyboard must be created before you can read events");
- if (readBuffer.hasRemaining()) {
- eventKey = readBuffer.getInt() & 0xFF;
- eventState = readBuffer.get() != 0;
- eventCharacter = readBuffer.getInt();
- eventNanos = readBuffer.getLong();
- return true;
- } else {
- return false;
+ if (readBuffer.hasRemaining()) {
+ eventKey = readBuffer.getInt() & 0xFF;
+ eventState = readBuffer.get() != 0;
+ eventCharacter = readBuffer.getInt();
+ eventNanos = readBuffer.getLong();
+ return true;
+ } else {
+ return false;
+ }
}
}
@@ -454,14 +468,18 @@
* @return Number of keys on this keyboard
*/
public static synchronized int getKeyCount() {
- return keyCount;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return keyCount;
+ }
}
/**
* @return The character from the current event
*/
public static synchronized char getEventCharacter() {
- return (char)eventCharacter;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return (char)eventCharacter;
+ }
}
/**
@@ -472,7 +490,9 @@
* @return The key from the current event
*/
public static synchronized int getEventKey() {
- return eventKey;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return eventKey;
+ }
}
/**
@@ -482,7 +502,9 @@
* @return True if key was down, or false if released
*/
public static synchronized boolean getEventKeyState() {
- return eventState;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return eventState;
+ }
}
/**
@@ -493,6 +515,8 @@
* @return The time in nanoseconds of the current event
*/
public static synchronized long getEventNanoseconds() {
- return eventNanos;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return eventNanos;
+ }
}
}
Modified: trunk/LWJGL/src/java/org/lwjgl/input/Mouse.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/input/Mouse.java 2007-02-08 22:00:51 UTC (rev 2738)
+++ trunk/LWJGL/src/java/org/lwjgl/input/Mouse.java 2007-02-12 12:18:26 UTC (rev 2739)
@@ -43,12 +43,7 @@
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.InputImplementation;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedExceptionAction;
-import java.security.PrivilegedActionException;
-
/**
* <br>
* A raw Mouse interface. This can be used to poll the current state of the
@@ -152,7 +147,9 @@
* @return the currently bound native cursor, if any.
*/
public static synchronized Cursor getNativeCursor() {
- return currentCursor;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return currentCursor;
+ }
}
/**
@@ -167,19 +164,21 @@
* @throws LWJGLException if the cursor could not be set for any reason
*/
public static synchronized Cursor setNativeCursor(Cursor cursor) throws LWJGLException {
- if ((Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) == 0)
- throw new IllegalStateException("Mouse doesn't support native cursors");
- Cursor oldCursor = currentCursor;
- currentCursor = cursor;
- if (isCreated()) {
- if (currentCursor != null) {
- implementation.setNativeCursor(currentCursor.getHandle());
- currentCursor.setTimeout();
- } else {
- implementation.setNativeCursor(null);
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if ((Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) == 0)
+ throw new IllegalStateException("Mouse doesn't support native cursors");
+ Cursor oldCursor = currentCursor;
+ currentCursor = cursor;
+ if (isCreated()) {
+ if (currentCursor != null) {
+ implementation.setNativeCursor(currentCursor.getHandle());
+ currentCursor.setTimeout();
+ } else {
+ implementation.setNativeCursor(null);
+ }
}
+ return oldCursor;
}
- return oldCursor;
}
/**
@@ -192,12 +191,14 @@
* to the window origin.
*/
public static synchronized void setCursorPosition(int new_x, int new_y) {
- if (!isCreated())
- throw new IllegalStateException("Mouse is not created");
- x = event_x = new_x;
- y = event_y = new_y;
- if (!isGrabbed() && (Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) != 0)
- implementation.setCursorPosition(x, y);
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!isCreated())
+ throw new IllegalStateException("Mouse is not created");
+ x = event_x = new_x;
+ y = event_y = new_y;
+ if (!isGrabbed() && (Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) != 0)
+ implementation.setCursorPosition(x, y);
+ }
}
/**
@@ -225,23 +226,6 @@
return implementation;
}
- static InputImplementation createImplementation() {
- /* Use reflection since we can't make Display.getImplementation
- * public
- */
- try {
- return (InputImplementation)AccessController.doPrivileged(new PrivilegedExceptionAction() {
- public Object run() throws Exception {
- Method getImplementation_method = Display.class.getDeclaredMethod("getImplementation", null);
- getImplementation_method.setAccessible(true);
- return getImplementation_method.invoke(null, null);
- }
- });
- } catch (PrivilegedActionException e) {
- throw new Error(e);
- }
- }
-
/**
* "Create" the mouse with the given custom implementation. This is used
* reflectively by AWTInputAdapter.
@@ -277,28 +261,34 @@
* @throws LWJGLException if the mouse could not be created for any reason
*/
public static synchronized void create() throws LWJGLException {
- if (!Display.isCreated()) throw new IllegalStateException("Display must be created.");
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!Display.isCreated()) throw new IllegalStateException("Display must be created.");
- create(createImplementation());
+ create(OpenGLPackageAccess.createImplementation());
+ }
}
/**
* @return true if the mouse has been created
*/
public static synchronized boolean isCreated() {
- return created;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return created;
+ }
}
/**
* "Destroy" the mouse.
*/
public static synchronized void destroy() {
- if (!created) return;
- created = false;
- buttons = null;
- coord_buffer = null;
-
- implementation.destroyMouse();
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created) return;
+ created = false;
+ buttons = null;
+ coord_buffer = null;
+
+ implementation.destroyMouse();
+ }
}
/**
@@ -323,30 +313,32 @@
* @see org.lwjgl.input.Mouse#getDWheel()
*/
public static synchronized void poll() {
- if (!created) throw new IllegalStateException("Mouse must be created before you can poll it");
- implementation.pollMouse(coord_buffer, buttons);
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created) throw new IllegalStateException("Mouse must be created before you can poll it");
+ implementation.pollMouse(coord_buffer, buttons);
- /* If we're grabbed, poll returns mouse deltas, if not it returns absolute coordinates */
- int poll_coord1 = coord_buffer.get(0);
- int poll_coord2 = coord_buffer.get(1);
- /* The wheel is always relative */
- int poll_dwheel = coord_buffer.get(2);
+ /* If we're grabbed, poll returns mouse deltas, if not it returns absolute coordinates */
+ int poll_coord1 = coord_buffer.get(0);
+ int poll_coord2 = coord_buffer.get(1);
+ /* The wheel is always relative */
+ int poll_dwheel = coord_buffer.get(2);
- if (isGrabbed()) {
- dx += poll_coord1;
- dy += poll_coord2;
- x += poll_coord1;
- y += poll_coord2;
- } else {
- dx = poll_coord1 - x;
- dy = poll_coord2 - y;
- x = poll_coord1;
- y = poll_coord2;
+ if (isGrabbed()) {
+ dx += poll_coord1;
+ dy += poll_coord2;
+ x += poll_coord1;
+ y += poll_coord2;
+ } else {
+ dx = poll_coord1 - x;
+ dy = poll_coord2 - y;
+ x = poll_coord1;
+ y = poll_coord2;
+ }
+ x = Math.min(implementation.getWidth() - 1, Math.max(0, x));
+ y = Math.min(implementation.getHeight() - 1, Math.max(0, y));
+ dwheel += poll_dwheel;
+ read();
}
- x = Math.min(implementation.getWidth() - 1, Math.max(0, x));
- y = Math.min(implementation.getHeight() - 1, Math.max(0, y));
- dwheel += poll_dwheel;
- read();
}
private static void read() {
@@ -362,11 +354,13 @@
* @return true if the specified button is down
*/
public static synchronized boolean isButtonDown(int button) {
- if (!created) throw new IllegalStateException("Mouse must be created before you can poll the button state");
- if (button >= buttonCount || button < 0)
- return false;
- else
- return buttons.get(button) == 1;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created) throw new IllegalStateException("Mouse must be created before you can poll the button state");
+ if (button >= buttonCount || button < 0)
+ return false;
+ else
+ return buttons.get(button) == 1;
+ }
}
/**
@@ -375,10 +369,12 @@
* @return a String with the button's human readable name in it or null if the button is unnamed
*/
public static synchronized String getButtonName(int button) {
- if (button >= buttonName.length || button < 0)
- return null;
- else
- return buttonName[button];
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (button >= buttonName.length || button < 0)
+ return null;
+ else
+ return buttonName[button];
+ }
}
/**
@@ -386,11 +382,13 @@
* @param buttonName The button name
*/
public static synchronized int getButtonIndex(String buttonName) {
- Integer ret = (Integer) buttonMap.get(buttonName);
- if (ret == null)
- return -1;
- else
- return ret.intValue();
+ synchronized (OpenGLPackageAccess.global_lock) {
+ Integer ret = (Integer) buttonMap.get(buttonName);
+ if (ret == null)
+ return -1;
+ else
+ return ret.intValue();
+ }
}
/**
@@ -403,37 +401,41 @@
* @return true if a mouse event was read, false otherwise
*/
public static synchronized boolean next() {
- if (!created) throw new IllegalStateException("Mouse must be created before you can read events");
- if (readBuffer.hasRemaining()) {
- eventButton = readBuffer.get();
- eventState = readBuffer.get() != 0;
- if (isGrabbed()) {
- event_dx = readBuffer.getInt();
- event_dy = readBuffer.getInt();
- event_x += event_dx;
- event_y += event_dy;
- } else {
- int new_event_x = readBuffer.getInt();
- int new_event_y = readBuffer.getInt();
- event_dx = new_event_x - event_x;
- event_dy = new_event_y - event_y;
- event_x = new_event_x;
- event_y = new_event_y;
- }
- event_x = Math.min(implementation.getWidth() - 1, Math.max(0, event_x));
- event_y = Math.min(implementation.getHeight() - 1, Math.max(0, event_y));
- event_dwheel = readBuffer.getInt();
- event_nanos = readBuffer.getLong();
- return true;
- } else
- return false;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (!created) throw new IllegalStateException("Mouse must be created before you can read events");
+ if (readBuffer.hasRemaining()) {
+ eventButton = readBuffer.get();
+ eventState = readBuffer.get() != 0;
+ if (isGrabbed()) {
+ event_dx = readBuffer.getInt();
+ event_dy = readBuffer.getInt();
+ event_x += event_dx;
+ event_y += event_dy;
+ } else {
+ int new_event_x = readBuffer.getInt();
+ int new_event_y = readBuffer.getInt();
+ event_dx = new_event_x - event_x;
+ event_dy = new_event_y - event_y;
+ event_x = new_event_x;
+ event_y = new_event_y;
+ }
+ event_x = Math.min(implementation.getWidth() - 1, Math.max(0, event_x));
+ event_y = Math.min(implementation.getHeight() - 1, Math.max(0, event_y));
+ event_dwheel = readBuffer.getInt();
+ event_nanos = readBuffer.getLong();
+ return true;
+ } else
+ return false;
+ }
}
/**
* @return Current events button. Returns -1 if no button state was changed
*/
public static synchronized int getEventButton() {
- return eventButton;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return eventButton;
+ }
}
/**
@@ -441,42 +443,54 @@
* @return Current events button state.
*/
public static synchronized boolean getEventButtonState() {
- return eventState;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return eventState;
+ }
}
/**
* @return Current events delta x. Only valid when the mouse is grabbed.
*/
public static synchronized int getEventDX() {
- return event_dx;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return event_dx;
+ }
}
/**
* @return Current events delta y. Only valid when the mouse is grabbed.
*/
public static synchronized int getEventDY() {
- return event_dy;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return event_dy;
+ }
}
/**
* @return Current events absolute x. Only valid when the mouse is not grabbed.
*/
public static synchronized int getEventX() {
- return event_x;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return event_x;
+ }
}
/**
* @return Current events absolute y. Only valid when the mouse is not grabbed.
*/
public static synchronized int getEventY() {
- return event_y;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return event_y;
+ }
}
/**
* @return Current events delta z
*/
public static synchronized int getEventDWheel() {
- return event_dwheel;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return event_dwheel;
+ }
}
/**
@@ -488,7 +502,9 @@
* @return The time in nanoseconds of the current event
*/
public static synchronized long getEventNanoseconds() {
- return event_nanos;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return event_nanos;
+ }
}
/**
@@ -498,7 +514,9 @@
* @return Absolute x axis position of mouse
*/
public static synchronized int getX() {
- return x;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return x;
+ }
}
/**
@@ -508,55 +526,69 @@
* @return Absolute y axis position of mouse
*/
public static synchronized int getY() {
- return y;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return y;
+ }
}
/**
* @return Movement on the x axis since last time getDX() was called. Only valid when the mouse is grabbed.
*/
public static synchronized int getDX() {
- int result = dx;
- dx = 0;
- return result;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ int result = dx;
+ dx = 0;
+ return result;
+ }
}
/**
* @return Movement on the y axis since last time getDY() was called. Only valid when the mouse is grabbed.
*/
public static synchronized int getDY() {
- int result = dy;
- dy = 0;
- return result;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ int result = dy;
+ dy = 0;
+ return result;
+ }
}
/**
* @return Movement of the wheel since last time getDWheel() was called
*/
public static synchronized int getDWheel() {
- int result = dwheel;
- dwheel = 0;
- return result;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ int result = dwheel;
+ dwheel = 0;
+ return result;
+ }
}
/**
* @return Number of buttons on this mouse
*/
public static synchronized int getButtonCount() {
- return buttonCount;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return buttonCount;
+ }
}
/**
* @return Whether or not this mouse has wheel support
*/
public static synchronized boolean hasWheel() {
- return hasWheel;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return hasWheel;
+ }
}
/**
* @return whether or not the mouse has grabbed the cursor
*/
public static synchronized boolean isGrabbed() {
- return isGrabbed;
+ synchronized (OpenGLPackageAccess.global_lock) {
+ return isGrabbed;
+ }
}
/**
@@ -568,14 +600,16 @@
* @param grab whether the mouse should be grabbed
*/
public static synchronized void setGrabbed(boolean grab) {
- isGrabbed = grab;
- if (isCreated()) {
- implementation.grabMouse(isGrabbed);
- // Get latest values from native side
- poll();
- event_x = x;
- event_y = y;
- resetMouse();
+ synchronized (OpenGLPackageAccess.global_lock) {
+ isGrabbed = grab;
+ if (isCreated()) {
+ implementation.grabMouse(isGrabbed);
+ // Get latest values from native side
+ poll();
+ event_x = x;
+ event_y = y;
+ resetMouse();
+ }
}
}
@@ -585,12 +619,14 @@
* shouldn't be called otherwise
*/
public static synchronized void updateCursor() {
- if (emulateCursorAnimation && currentCursor != null && currentCursor.hasTimedOut()) {
- currentCursor.nextCursor();
- try {
- setNativeCursor(currentCursor);
- } catch (LWJGLException e) {
- if (LWJGLUtil.DEBUG) e.printStackTrace();
+ synchronized (OpenGLPackageAccess.global_lock) {
+ if (emulateCursorAnimation && currentCursor != null && currentCursor.hasTimedOut()) {
+ currentCursor.nextCursor();
+ try {
+ setNativeCursor(currentCursor);
+ } catch (LWJGLException e) {
+ if (LWJGLUtil.DEBUG) e.printStackTrace();
+ }
}
}
}
Added: trunk/LWJGL/src/java/org/lwjgl/input/OpenGLPackageAccess.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/input/OpenGLPackageAccess.java (rev 0)
+++ trunk/LWJGL/src/java/org/lwjgl/input/OpenGLPackageAccess.java 2007-02-12 12:18:26 UTC (rev 2739)
@@ -0,0 +1,49 @@
+package org.lwjgl.input;
+
+import org.lwjgl.opengl.InputImplementation;
+import org.lwjgl.opengl.Display;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedExceptionAction;
+import java.security.PrivilegedActionException;
+
+/**
+ * This class contains utilities for accessing the org.lwjgl.opengl
+ * package through (privileged) reflection.
+ */
+final class OpenGLPackageAccess {
+ final static Object global_lock;
+
+ static {
+ try {
+ global_lock = AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws Exception {
+ Field lock_field = Class.forName("org.lwjgl.opengl.GlobalLock").getDeclaredField("lock");
+ lock_field.setAccessible(true);
+ return lock_field.get(null);
+ }
+ });
+ } catch (PrivilegedActionException e) {
+ throw new Error(e);
+ }
+ }
+
+ static InputImplementation createImplementation() {
+ /* Use reflection since we can't make Display.getImplementation
+ * public
+ */
+ try {
+ return (InputImplementation)AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ public Object run() throws Exception {
+ Method getImplementation_method = Display.class.getDeclaredMethod("getImplementation", null);
+ getImplementation_method.setAccessible(true);
+ return getImplementation_method.invoke(null, null);
+ }
+ });
+ } catch (PrivilegedActionException e) {
+ throw new Error(e);
+ }
+ }
+}
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2007-02-08 22:00:51 UTC (rev 2738)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2007-02-12 12:18:26 UTC (rev 2739)
@@ -102,6 +102,9 @@
private static PeerInfo peer_info;
private static Context context;
+ /** The Drawable instance that tracks the current Display context */
+ private final static Drawable drawable;
+
private static boolean window_created = false;
static {
@@ -113,23 +116,22 @@
} catch (LWJGLException e) {
throw new RuntimeException(e);
}
+ drawable = new Drawable() {
+ public Context getContext() {
+ synchronized (GlobalLock.lock) {
+ return isCreated() ? context : null;
+ }
+ }
+ };
}
/**
* Fetch the Drawable from the Display.
*
- * @return the Drawable corresponding to the Display context, or null if display is
- * not created.
+ * @return the Drawable corresponding to the Display context
*/
public static Drawable getDrawable() {
- if (context != null) {
- return new Drawable() {
- public Context getContext() {
- return context;
- }
- };
- } else
- return null;
+ return drawable;
}
private static DisplayImplementation createDisplayImplementation() {
@@ -167,22 +169,24 @@
* @return an array of all display modes the system reckons it can handle.
*/
public static DisplayMode[] getAvailableDisplayModes() throws LWJGLException {
- DisplayMode[] unfilteredModes = display_impl.getAvailableDisplayModes();
+ synchronized (GlobalLock.lock) {
+ DisplayMode[] unfilteredModes = display_impl.getAvailableDisplayModes();
- if (unfilteredModes == null) {
- return new DisplayMode[0];
- }
+ if (unfilteredModes == null) {
+ return new DisplayMode[0];
+ }
- // We'll use a HashSet to filter out the duplicated modes
- HashSet modes = new HashSet(unfilteredModes.length);
+ // We'll use a HashSet to filter out the duplicated modes
+ HashSet modes = new HashSet(unfilteredModes.length);
- modes.addAll(Arrays.asList(unfilteredModes));
- DisplayMode[] filteredModes = new DisplayMode[modes.size()];
- modes.toArray(filteredModes);
+ modes.addAll(Arrays.asList(unfilteredModes));
+ DisplayMode[] filteredModes = new DisplayMode[modes.size()];
+ modes.toArray(filteredModes);
- LWJGLUtil.log("Removed " + (unfilteredModes.length - filteredModes.length) + " duplicate displaymodes");
+ LWJGLUtil.log("Removed " + (unfilteredModes.length - filteredModes.length) + " duplicate displaymodes");
- return filteredModes;
+ return filteredModes;
+ }
}
/**
@@ -190,7 +194,9 @@
* @return The current display mode
*/
public static DisplayMode getDisplayMode() {
- return current_mode;
+ synchronized (GlobalLock.lock) {
+ return current_mode;
+ }
}
/**
@@ -204,24 +210,26 @@
* @throws LWJGLException if the display mode could not be set
*/
public static void setDisplayMode(DisplayMode mode) throws LWJGLException {
- if (mode == null)
- throw new NullPointerException("mode must be non-null");
- current_mode = mode;
- if (isCreated()) {
- destroyWindow();
- // If mode is not fullscreen capable, make sure we are in windowed mode
- if (!mode.isFullscreen())
- resetFullscreen();
- try {
- if (fullscreen)
- switchDisplayMode();
- createWindow();
- makeCurrent();
- } catch (LWJGLException e) {
- destroyContext();
- destroyPeerInfo();
- display_impl.resetDisplayMode();
- throw e;
+ synchronized (GlobalLock.lock) {
+ if (mode == null)
+ throw new NullPointerException("mode must be non-null");
+ current_mode = mode;
+ if (isCreated()) {
+ destroyWindow();
+ // If mode is not fullscreen capable, make sure we are in windowed mode
+ if (!mode.isFullscreen())
+ resetFullscreen();
+ try {
+ if (fullscreen)
+ switchDisplayMode();
+ createWindow();
+ makeCurrent();
+ } catch (LWJGLException e) {
+ destroyContext();
+ destroyPeerInfo();
+ display_impl.resetDisplayMode();
+ throw e;
+ }
}
}
}
@@ -304,35 +312,37 @@
* @param contrast The contrast, larger than 0.0.
*/
public static void setDisplayConfiguration(float gamma, float brightness, float contrast) throws LWJGLException {
- if (!isCreated()) {
- throw new LWJGLException("Display not yet created.");
+ synchronized (GlobalLock.lock) {
+ if (!isCreated()) {
+ throw new LWJGLException("Display not yet created.");
+ }
+ if (brightness < -1.0f || brightness > 1.0f)
+ throw new IllegalArgumentException("Invalid brightness value");
+ if (contrast < 0.0f)
+ throw new IllegalArgumentException("Invalid contrast value");
+ int rampSize = display_impl.getGammaRampLength();
+ if (rampSize == 0) {
+ throw new LWJGLException("Display configuration not supported");
+ }
+ FloatBuffer gammaRamp = BufferUtils.createFloatBuffer(rampSize);
+ for (int i = 0; i < rampSize; i++) {
+ float intensity = (float)i/(rampSize - 1);
+ // apply gamma
+ float rampEntry = (float)java.lang.Math.pow(intensity, gamma);
+ // apply brightness
+ rampEntry += brightness;
+ // apply contrast
+ rampEntry = (rampEntry - 0.5f)*contrast + 0.5f;
+ // Clamp entry to [0, 1]
+ if (rampEntry > 1.0f)
+ rampEntry = 1.0f;
+ else if (rampEntry < 0.0f)
+ rampEntry = 0.0f;
+ gammaRamp.put(i, rampEntry);
+ }
+ display_impl.setGammaRamp(gammaRamp);
+ LWJGLUtil.log("Gamma set, gamma = " + gamma + ", brightness = " + brightness + ", contrast = " + contrast);
}
- if (brightness < -1.0f || brightness > 1.0f)
- throw new IllegalArgumentException("Invalid brightness value");
- if (contrast < 0.0f)
- throw new IllegalArgumentException("Invalid contrast value");
- int rampSize = display_impl.getGammaRampLength();
- if (rampSize == 0) {
- throw new LWJGLException("Display configuration not supported");
- }
- FloatBuffer gammaRamp = BufferUtils.createFloatBuffer(rampSize);
- for (int i = 0; i < rampSize; i++) {
- float intensity = (float)i/(rampSize - 1);
- // apply gamma
- float rampEntry = (float)java.lang.Math.pow(intensity, gamma);
- // apply brightness
- rampEntry += brightness;
- // apply contrast
- rampEntry = (rampEntry - 0.5f)*contrast + 0.5f;
- // Clamp entry to [0, 1]
- if (rampEntry > 1.0f)
- rampEntry = 1.0f;
- else if (rampEntry < 0.0f)
- rampEntry = 0.0f;
- gammaRamp.put(i, rampEntry);
- }
- display_impl.setGammaRamp(gammaRamp);
- LWJGLUtil.log("Gamma set, gamma = " + gamma + ", brightness = " + brightness + ", contrast = " + contrast);
}
/**
@@ -342,14 +352,16 @@
* @param fps The desired frame rate, in frames per second
*/
public static void sync3(int fps) {
- float frameTime = 1.0f / (fps > 1 ? fps - 1 : 1);
- timeNow = Sys.getTime();
- while (timeNow > timeThen && (float) (timeNow - timeThen) / (float) Sys.getTimerResolution() < frameTime) {
- // This is a system-friendly way of allowing other stuff to use CPU if it wants to
- Thread.yield();
+ synchronized (GlobalLock.lock) {
+ float frameTime = 1.0f / (fps > 1 ? fps - 1 : 1);
timeNow = Sys.getTime();
+ while (timeNow > timeThen && (float) (timeNow - timeThen) / (float) Sys.getTimerResolution() < frameTime) {
+ // This is a system-friendly way of allowing other stuff to use CPU if it wants to
+ Thread.yield();
+ timeNow = Sys.getTime();
+ }
+ timeThen = timeNow;
}
- timeThen = timeNow;
}
private static long timeLate;
@@ -360,20 +372,22 @@
* @param fps The desired frame rate, in frames per second
*/
public static void sync2(int fps) {
- long gapTo = Sys.getTimerResolution() / fps + timeThen;
- timeNow = Sys.getTime();
-
- while (gapTo > timeNow + timeLate) {
- Thread.yield();
+ synchronized (GlobalLock.lock) {
+ long gapTo = Sys.getTimerResolution() / fps + timeThen;
timeNow = Sys.getTime();
- }
- if (gapTo < timeNow)
- timeLate = timeNow - gapTo;
- else
- timeLate = 0;
+ while (gapTo > timeNow + timeLate) {
+ Thread.yield();
+ timeNow = Sys.getTime();
+ }
- timeThen = timeNow;
+ if (gapTo < timeNow)
+ timeLate = timeNow - gapTo;
+ else
+ timeLate = 0;
+
+ timeThen = timeNow;
+ }
}
/**
@@ -382,23 +396,25 @@
* @param fps The desired frame rate, in frames per second
*/
public static void sync(int fps) {
- long gapTo = Sys.getTimerResolution() / fps + timeThen;
- timeNow = Sys.getTime();
+ synchronized (GlobalLock.lock) {
+ long gapTo = Sys.getTimerResolution() / fps + timeThen;
+ timeNow = Sys.getTime();
- while (gapTo > timeNow + timeLate) {
- try {
- Thread.sleep(1);
- } catch (InterruptedException e) {
+ while (gapTo > timeNow + timeLate) {
+ try {
+ Thread.sleep(1);
+ } catch (InterruptedException e) {
+ }
+ timeNow = Sys.getTime();
}
- timeNow = Sys.getTime();
- }
- if (gapTo < timeNow)
- timeLate = timeNow - gapTo;
- else
- timeLate = 0;
+ if (gapTo < timeNow)
+ timeLate = timeNow - gapTo;
+ else
+ timeLate = 0;
- timeThen = timeNow;
+ timeThen = timeNow;
+ }
}
/**
@@ -420,13 +436,17 @@
* @return the title of the window
*/
public static String getTitle() {
- return title;
+ synchronized (GlobalLock.lock) {
+ return title;
+ }
}
private static void resetFullscreen() {
- if (Display.fullscreen) {
- Display.fullscreen = false;
- display_impl.resetDisplayMode();
+ synchronized (GlobalLock.lock) {
+ if (Display.fullscreen) {
+ Display.fullscreen = false;
+ display_impl.resetDisplayMode();
+ }
}
}
@@ -442,24 +462,26 @@
* from getAvailableDisplayModes() or if the mode switch fails.
*/
public static void setFullscreen(boolean fullscreen) throws LWJGLException {
- if (Display.fullscreen != fullscreen) {
- Display.fullscreen = fullscreen;
- if (!isCreated())
- return;
- destroyWindow();
- try {
- if (fullscreen) {
- switchDisplayMode();
- } else {
+ synchronized (GlobalLock.lock) {
+ if (Display.fullscreen != fullscreen) {
+ Display.fullscreen = fullscreen;
+ if (!isCreated())
+ return;
+ destroyWindow();
+ try {
+ if (fullscreen) {
+ switchDisplayMode();
+ } else {
+ display_impl.resetDisplayMode();
+ }
+ createWindow();
+ makeCurrent();
+ } catch (LWJGLException e) {
+ destroyContext();
+ destroyPeerInfo();
display_impl.resetDisplayMode();
+ throw e;
}
- createWindow();
- makeCurrent();
- } catch (LWJGLException e) {
- destroyContext();
- destroyPeerInfo();
- display_impl.resetDisplayMode();
- throw e;
}
}
}
@@ -468,7 +490,9 @@
* @return whether the Display is in fullscreen mode
*/
public static boolean isFullscreen() {
- return fullscreen;
+ synchronized (GlobalLock.lock) {
+ return fullscreen;
+ }
}
/**
@@ -476,42 +500,50 @@
* @param newTitle The new window title
*/
public static void setTitle(String newTitle) {
- if (newTitle == null) {
- newTitle = "";
+ synchronized (GlobalLock.lock) {
+ if (newTitle == null) {
+ newTitle = "";
+ }
+ title = newTitle;
+ if (isCreated())
+ display_impl.setTitle(title);
}
- title = newTitle;
- if (isCreated())
- display_impl.setTitle(title);
}
/**
* @return true if the user or operating system has asked the window to close
*/
public static boolean isCloseRequested() {
- if (!isCreated())
- throw new IllegalStateException("Cannot determine close requested state of uncreated window");
- display_impl.update();
- return display_impl.isCloseRequested();
+ synchronized (GlobalLock.lock) {
+ if (!isCreated())
+ throw new IllegalStateException("Cannot determine close requested state of uncreated window");
+ display_impl.update();
+ return display_impl.isCloseRequested();
+ }
}
/**
* @return true if the window is visible, false if not
*/
public static boolean isVisible() {
- if (!isCreated())
- throw new IllegalStateException("Cannot determine minimized state of uncreated window");
- display_impl.update();
- return display_impl.isVisible();
+ synchronized (GlobalLock.lock) {
+ if (!isCreated())
+ throw new IllegalStateException("Cannot determine minimized state of uncreated window");
+ display_impl.update();
+ return display_impl.isVisible();
+ }
}
/**
* @return true if window is active, that is, the foreground display of the operating system.
*/
public static boolean isActive() {
- if (!isCreated())
- throw new IllegalStateException("Cannot determine focused state of uncreated window");
- display_impl.update();
- return display_impl.isActive();
+ synchronized (GlobalLock.lock) {
+ if (!isCreated())
+ throw new IllegalStateException("Cannot determine focused state of uncreated window");
+ display_impl.update();
+ return display_impl.isActive();
+ }
}
/**
@@ -525,10 +557,12 @@
* and needs to repaint itself
*/
public static boolean isDirty() {
- if (!isCreated())
- throw new IllegalStateException("Cannot determine dirty state of uncreated window");
- display_impl.update();
- return display_impl.isDirty();
+ synchronized (GlobalLock.lock) {
+ if (!isCreated())
+ throw new IllegalStateException("Cannot determine dirty state of uncreated window");
+ display_impl.update();
+ return display_impl.isDirty();
+ }
}
/**
@@ -537,10 +571,12 @@
* the application.
*/
public static void processMessages() {
- if (!isCreated())
- throw new IllegalStateException("Display not created");
+ synchronized (GlobalLock.lock) {
+ if (!isCreated())
+ throw new IllegalStateException("Display not created");
- display_impl.update();
+ display_impl.update();
+ }
}
/**
@@ -549,11 +585,13 @@
* @throws OpenGLException if an OpenGL error has occured since the last call to GL11.glGetError()
*/
public static void swapBuffers() throws LWJGLException {
- if (!isCreated())
- throw new IllegalStateException("Display not created");
+ synchronized (GlobalLock.lock) {
+ if (!isCreated())
+ throw new IllegalStateException("Display not created");
- Util.checkGLError();
- Context.swapBuffers();
+ Util.checkGLError();
+ Context.swapBuffers();
+ }
}
/**
@@ -562,20 +600,22 @@
* @throws OpenGLException if an OpenGL error has occured since the last call to GL11.glGetError()
*/
public static void update() {
- if (!isCreated())
- throw new IllegalStateException("Display not created");
+ synchronized (GlobalLock.lock) {
+ if (!isCreated())
+ throw new IllegalStateException("Display not created");
- // We paint only when the window is visible or dirty
- if (isVisible() || isDirty()) {
- try {
- swapBuffers();
- } catch (LWJGLException e) {
- throw new RuntimeException(e);
+ // We paint only when the window is visible or dirty
+ if (isVisible() || isDirty()) {
+ try {
+ swapBuffers();
+ } catch (LWJGLException e) {
+ throw new RuntimeException(e);
+ }
}
+
+ processMessages();
+ pollDevices();
}
-
- processMessages();
- pollDevices();
}
static void pollDevices() {
@@ -600,10 +640,12 @@
* @throws LWJGLException If the context could not be released
*/
public static void releaseContext() throws LWJGLException {
- if (!isCreated())
- throw new IllegalStateException("Display is not created");
- if (context.isCurrent())
- Context.releaseCurrentContext();
+ synchronized (GlobalLock.lock) {
+ if (!isCreated())
+ throw new IllegalStateException("Display is not created");
+ if (context.isCurrent())
+ Context.releaseCurrentContext();
+ }
}
/**
@@ -612,9 +654,11 @@
* @throws LWJGLException If the context could not be made current
*/
public static void makeCurrent() throws LWJGLException {
- if (!isCreated())
- throw new IllegalStateException("Display is not created");
- context.makeCurrent();
+ synchronized (GlobalLock.lock) {
+ if (!isCreated())
+ throw new IllegalStateException("Display is not created");
+ context.makeCurrent();
+ }
}
/**
@@ -629,7 +673,9 @@
* @throws LWJGLException
*/
public static void create() throws LWJGLException {
- create(new PixelFormat());
+ synchronized (GlobalLock.lock) {
+ create(new PixelFormat());
+ }
}
/**
@@ -645,7 +691,9 @@
* @throws LWJGLException
*/
public static void create(PixelFormat pixel_format) throws LWJGLException {
- create(pixel_format, null);
+ synchronized (GlobalLock.lock) {
+ create(pixel_format, null);
+ }
}
private static void removeShutdownHook() {
@@ -680,38 +728,40 @@
* @throws LWJGLException
*/
public static void create(PixelFormat pixel_format, Drawable shared_drawable) throws LWJGLException {
- if (isCreated())
- throw new IllegalStateException("Only one LWJGL context may be instantiated at any one time.");
- if (pixel_format == null)
- throw new NullPointerException("pixel_format cannot be null");
- removeShutdownHook();
- registerShutdownHook();
- if (fullscreen)
- switchDisplayMode();
- try {
- peer_info = display_impl.createPeerInfo(pixel_format);
+ synchronized (GlobalLock.lock) {
+ if (isCreated())
+ throw new IllegalStateException("Only one LWJGL context may be instantiated at any one time.");
+ if (pixel_format == null)
+ throw new NullPointerException("pixel_format cannot be null");
+ removeShutdownHook();
+ registerShutdownHook();
+ if (fullscreen)
+ switchDisplayMode();
try {
- createWindow();
+ peer_info = display_impl.createPeerInfo(pixel_format);
try {
- context = new Context(peer_info, shared_drawable != null ? shared_drawable.getContext() : null);
+ createWindow();
try {
- makeCurrent();
- initContext();
+ context = new Context(peer_info, shared_drawable != null ? shared_drawable.getContext() : null);
+ try {
+ makeCurrent();
+ initContext();
+ } catch (LWJGLException e) {
+ destroyContext();
+ throw e;
+ }
} catch (LWJGLException e) {
- destroyContext();
+ destroyWindow();
throw e;
}
} catch (LWJGLException e) {
- destroyWindow();
+ destroyPeerInfo();
throw e;
}
} catch (LWJGLException e) {
- destroyPeerInfo();
+ display_impl.resetDisplayMode();
throw e;
}
- } catch (LWJGLException e) {
- display_impl.resetDisplayMode();
- throw e;
}
}
@@ -779,17 +829,19 @@
* regardless of whether the Display was the current rendering context.
*/
public static void destroy() {
- if (!isCreated()) {
- return;
+ synchronized (GlobalLock.lock) {
+ if (!isCreated()) {
+ return;
+ }
+
+ destroyWindow();
+ destroyContext();
+ destroyPeerInfo();
+ x = y = -1;
+ cached_icons = null;
+ reset();
+ removeShutdownHook();
}
-
- destroyWindow();
- destroyContext();
- destroyPeerInfo();
- x = y = -1;
- cached_icons = null;
- reset();
- removeShutdownHook();
}
private static void destroyPeerInfo() {
@@ -819,7 +871,7 @@
/**
* @return the unique Display context (or null, if the Display has not been created)
*/
- public static Context getContext() {
+ private static Context getContext() {
return context;
}
@@ -827,7 +879,9 @@
* @return true if the window's native peer has been created
*/
public static boolean isCreated() {
- return window_created;
+ synchronized (GlobalLock.lock) {
+ return window_created;
+ }
}
/**
@@ -840,9 +894,11 @@
* @param sync true to synchronize; false to ignore synchronization
*/
public static void setSwapInterval(int value) {
- swap_interval = value;
- if (isCreated())
- Context.setSwapInterval(swap_interval);
+ synchronized (GlobalLock.lock) {
+ swap_interval = value;
+ if (isCreated())
+ Context.setSwapInterval(swap_interval);
+ }
}
@@ -852,7 +908,9 @@
* @param sync true to synchronize; false to ignore synchronization
*/
public static void setVSyncEnabled(boolean sync) {
- setSwapInterval(sync ? 1 : 0);
+ synchronized (GlobalLock.lock) {
+ setSwapInterval(sync ? 1 : 0);
+ }
}
/**
@@ -864,19 +922,21 @@
* @param x The new window location on the x axis
* @param y The new window location on the y axis
*/
- public static void setLocation(int x, int y) {
- if (fullscreen) {
- return;
- }
+ public static void setLocation(int new_x, int new_y) {
+ synchronized (GlobalLock.lock) {
+ if (fullscreen) {
+ return;
+ }
- // offset if already created
- if(isCreated()) {
- display_impl.reshape(x, y, current_mode.getWidth(), current_mode.getHeight());
+ // cache position
+ x = new_x;
+ y = new_y;
+
+ // offset if already created
+ if(isCreated()) {
+ display_impl.reshape(x, y, current_mode.getWidth(), current_mode.getHeight());
+ }
}
-
- // cache position
- Display.x = x;
- Display.y = y;
}
/**
@@ -885,7 +945,9 @@
* @return a String
*/
public static String getAdapter() {
- return display_impl.getAdapter();
+ synchronized (GlobalLock.lock) {
+ return display_impl.getAdapter();
+ }
}
/**
@@ -894,7 +956,9 @@
* @return a String
*/
public static String getVersion() {
- return display_impl.getVersion();
+ synchronized (GlobalLock.lock) {
+ return display_impl.getVersion();
+ }
}
@@ -915,22 +979,23 @@
* @return number of icons used, or 0 if display hasn't been created
*/
public static int setIcon(ByteBuffer[] icons) {
-
- // make deep copy so we dont rely on the supplied buffers later on
- // don't recache!
- if(cached_icons != icons) {
- cached_icons = new ByteBuffer[icons.length];
- for(int i=0;i<icons.length; i++) {
- cached_icons[i] = BufferUtils.createByteBuffer(icons[i].capacity());
- cached_icons[i].put(icons[i]);
- cached_icons[i].flip();
+ synchronized (GlobalLock.lock) {
+ // make deep copy so we dont rely on the supplied buffers later on
+ // don't recache!
+ if(cached_icons != icons) {
+ cached_icons = new ByteBuffer[icons.length];
+ for(int i=0;i<icons.length; i++) {
+ cached_icons[i] = BufferUtils.createByteBuffer(icons[i].capacity());
+ cached_icons[i].put(icons[i]);
+ cached_icons[i].flip();
+ }
}
+
+ if(Display.isCreated()) {
+ return display_impl.setIcon(cached_icons);
+ } else {
+ return 0;
+ }
}
-
- if(Display.isCreated()) {
- return display_impl.setIcon(cached_icons);
- } else {
- return 0;
- }
}
}
Added: trunk/LWJGL/src/java/org/lwjgl/opengl/GlobalLock.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/GlobalLock.java (rev 0)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/GlobalLock.java 2007-02-12 12:18:26 UTC (rev 2739)
@@ -0,0 +1,9 @@
+package org.lwjgl.opengl;
+
+/**
+ * This class contains the global lock that LWJGL will use to
+ * synchronize access to Display.
+ */
+final class GlobalLock {
+ final static Object lock = new Object();
+}
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java 2007-02-08 22:00:51 UTC (rev 2738)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java 2007-02-12 12:18:26 UTC (rev 2739)
@@ -247,13 +247,13 @@
*/
if (Display.isFullscreen() && (frame.getCanvas().syncCanvasPainted() || should_update)) {
try {
- MacOSXContextImplementation.resetView(Display.getContext().getPeerInfo(), Display.getContext());
+ MacOSXContextImplementation.resetView(Display.getDrawable().getContext().getPeerInfo(), Display.getDrawable().getContext());
} catch (LWJGLException e) {
LWJGLUtil.log("Failed to reset context: " + e);
}
}
if (should_update) {
- Display.getContext().update();
+ Display.getDrawable().getContext().update();
/* This is necessary to make sure the context won't "forget" about the view size */
GL11.glGetInteger(GL11.GL_VIEWPORT, current_viewport);
GL11.glViewport(current_viewport.get(0), current_viewport.get(1), current_viewport.get(2), current_viewport.get(3));
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2007-02-08 22:00:51 UTC (rev 2738)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2007-02-12 12:18:26 UTC (rev 2739)
@@ -304,8 +304,8 @@
* is maximized helps some gfx recover from fullscreen
*/
try {
- if (Display.getContext() != null && Display.getContext().isCurrent())
- Display.getContext().makeCurrent();
+ if (Display.getDrawable().getContext() != null && Display.getDrawable().getContext().isCurrent())
+ Display.getDrawable().getContext().makeCurrent();
} catch (LWJGLException e) {
LWJGLUtil.log("Exception occurred while trying to make context current: " + e);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-02-08 22:02:50
|
Revision: 2738
http://svn.sourceforge.net/java-game-lib/?rev=2738&view=rev
Author: matzon
Date: 2007-02-08 14:00:51 -0800 (Thu, 08 Feb 2007)
Log Message:
-----------
tagging 1.0
Added Paths:
-----------
tags/lwjgl1.0/
Copied: tags/lwjgl1.0 (from rev 2737, trunk)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-02-04 21:47:02
|
Revision: 2737
http://svn.sourceforge.net/java-game-lib/?rev=2737&view=rev
Author: matzon
Date: 2007-02-04 13:46:29 -0800 (Sun, 04 Feb 2007)
Log Message:
-----------
fixed test to use -1 in freq
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java
Modified: trunk/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java 2007-02-03 12:22:25 UTC (rev 2736)
+++ trunk/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java 2007-02-04 21:46:29 UTC (rev 2737)
@@ -100,19 +100,19 @@
/** Locate fixed modes */
private void findFixedModes() {
// get 640*480 modes
- fixed_modes[0] = getDisplayMode(640, 480, 16, 60);
- fixed_modes[1] = getDisplayMode(640, 480, 24, 75);
- fixed_modes[2] = getDisplayMode(640, 480, 32, 75);
+ fixed_modes[0] = getDisplayMode(640, 480, 16, -1);
+ fixed_modes[1] = getDisplayMode(640, 480, 24, -1);
+ fixed_modes[2] = getDisplayMode(640, 480, 32, -1);
// get 800*600*16*60
- fixed_modes[3] = getDisplayMode(800, 600, 16, 60);
- fixed_modes[4] = getDisplayMode(800, 600, 24, 75);
- fixed_modes[5] = getDisplayMode(800, 600, 32, 75);
+ fixed_modes[3] = getDisplayMode(800, 600, 16, -1);
+ fixed_modes[4] = getDisplayMode(800, 600, 24, -1);
+ fixed_modes[5] = getDisplayMode(800, 600, 32, -1);
// get 1024*768*16*60
- fixed_modes[6] = getDisplayMode(1024, 768, 16, 60);
- fixed_modes[7] = getDisplayMode(1024, 768, 24, 75);
- fixed_modes[8] = getDisplayMode(1024, 768, 32, 75);
+ fixed_modes[6] = getDisplayMode(1024, 768, 16, -1);
+ fixed_modes[7] = getDisplayMode(1024, 768, 24, -1);
+ fixed_modes[8] = getDisplayMode(1024, 768, 32, -1);
}
/**
@@ -294,7 +294,7 @@
protected boolean setDefaultDisplayMode() {
try {
// get modes
- DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, 60, 60);
+ DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, -1, -1);
org.lwjgl.util.Display.setDisplayMode(dm, new String[] { "width=" + 640, "height=" + 480, "freq=" + 60,
"bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel()});
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2007-02-03 12:22:58
|
Revision: 2736
http://svn.sourceforge.net/java-game-lib/?rev=2736&view=rev
Author: matzon
Date: 2007-02-03 04:22:25 -0800 (Sat, 03 Feb 2007)
Log Message:
-----------
1.0 version string
Modified Paths:
--------------
trunk/LWJGL/build.xml
trunk/LWJGL/src/java/org/lwjgl/Sys.java
trunk/LWJGL/src/java/org/lwjgl/devil/ILNative.java
trunk/LWJGL/src/java/org/lwjgl/fmod3/FMOD.java
Modified: trunk/LWJGL/build.xml
===================================================================
--- trunk/LWJGL/build.xml 2007-01-31 14:07:20 UTC (rev 2735)
+++ trunk/LWJGL/build.xml 2007-02-03 12:22:25 UTC (rev 2736)
@@ -13,7 +13,7 @@
<property name="lwjgl.docs" location="doc" />
<property name="lwjgl.temp" location="temp" />
<property name="lwjgl.res" location="res" />
- <property name="lwjgl.version" value="1.0-rc1" />
+ <property name="lwjgl.version" value="1.0" />
<property name="opengl-template-pattern" value="org/lwjgl/opengl/GL*.java,org/lwjgl/opengl/ARB*.java,org/lwjgl/opengl/ATI*.java,org/lwjgl/opengl/EXT*.java,org/lwjgl/opengl/NV*.java,org/lwjgl/opengl/HP*.java,org/lwjgl/opengl/IBM*.java,org/lwjgl/opengl/SUN*.java,org/lwjgl/opengl/SGIS*.java"/>
<!-- ================================================================== -->
Modified: trunk/LWJGL/src/java/org/lwjgl/Sys.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/Sys.java 2007-01-31 14:07:20 UTC (rev 2735)
+++ trunk/LWJGL/src/java/org/lwjgl/Sys.java 2007-02-03 12:22:25 UTC (rev 2736)
@@ -54,7 +54,7 @@
private static final String JNI_LIBRARY_NAME = "lwjgl";
/** Current version of library */
- private static final String VERSION = "1.0-rc2";
+ private static final String VERSION = "1.0";
/** Current version of the JNI library */
static final int JNI_VERSION = 8;
Modified: trunk/LWJGL/src/java/org/lwjgl/devil/ILNative.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/devil/ILNative.java 2007-01-31 14:07:20 UTC (rev 2735)
+++ trunk/LWJGL/src/java/org/lwjgl/devil/ILNative.java 2007-02-03 12:22:25 UTC (rev 2736)
@@ -53,7 +53,7 @@
private static String JNI_LIBRARY_NAME = "lwjgl-devil";
/** Version of IL */
- static final String VERSION = "1.0-rc2";
+ static final String VERSION = "1.0";
/** Current version of the JNI library */
static final int JNI_VERSION = 2;
Modified: trunk/LWJGL/src/java/org/lwjgl/fmod3/FMOD.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/fmod3/FMOD.java 2007-01-31 14:07:20 UTC (rev 2735)
+++ trunk/LWJGL/src/java/org/lwjgl/fmod3/FMOD.java 2007-02-03 12:22:25 UTC (rev 2736)
@@ -193,7 +193,7 @@
private static String JNI_LIBRARY_NAME = "lwjgl-fmod3";
/** Version of FMOD */
- private static final String VERSION = "1.0-rc2";
+ private static final String VERSION = "1.0";
/** Current version of the JNI library */
static final int JNI_VERSION = 1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Heifer <knf...@t-...> - 2007-02-01 19:31:00
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2900.2912" name=3D"GENERATOR"> </HEAD> <BODY> <DIV align=3Dleft><FONT face=3DArial size=3D2><B>HOT ALERT - THIS ONE IS STILL CLIMBING CHARTS</B></FONT></DIV><BR> <DIV align=3Dleft><FONT face=3DArial size=3D2><I>WATCH THIS ONE GO HIGHER AND HIGHER!</I></FONT></DIV><BR> <DIV align=3Dleft><FONT face=3DArial size=3D2>Company Name: <B>PetroSun</B> </FONT></DIV> <DIV align=3Dleft><FONT face=3DArial size=3D2>Lookup: <B>PSUD</B> </FONT></DIV> <DIV align=3Dleft><FONT face=3DArial size=3D2>Price Currently: <B>$0.75 (+75% in 4 days!)</B></FONT></DIV> <DIV align=3Dleft><FONT face=3DArial size=3D2>3 Day Target: <B>$2.00</B></FONT></DIV> <DIV align=3Dleft><FONT face=3DArial size=3D2>Expected Target: <B>$1.50</B></FONT></DIV><BR> <DIV align=3Dleft><FONT face=3DArial size=3D2>01/31/07</FONT></DIV> <DIV align=3Dleft><FONT face=3DArial size=3D2>PetroSun, Incorporated (PKSHEETS: PSUD) announced today that the Western Australia Department of Industry and Resources has lodged the registration of the Exploration Permit 417 farm-in agreement executed by New Standard Exploration NL and PetroSun.</FONT></DIV><BR> <DIV align=3Dleft><FONT face=3DArial size=3D2>01/11/07</FONT></DIV> <DIV align=3Dleft><FONT face=3DArial size=3D2>PetroSun, Incorporated (PKSHEETS: PSUD) announced agreements have been carried out with New Standard Exploration NL of West Perth, AU covering Exploration Permit 417 located within Canning Basin of Western AU.</FONT></DIV><BR> <DIV align=3Dleft><FONT face=3DArial size=3D2>01/08/07</FONT></DIV> <DIV align=3Dleft><FONT face=3DArial size=3D2>PetroSun, Incorporated (PKSHEETS: PSUD) announced today that the company has completed the acquisition of all of the member units of 1031 Energy, LLC of Denver, Colorado.</FONT></DIV><BR> <DIV align=3Dleft><FONT face=3DArial size=3D2><I><b>**Go read *all* the News Releases now and keep an eye out daily**</b></I></FONT></DIV><BR> <DIV align=3Dleft><FONT face=3DArial size=3D2><B><U>WATCH IT TOMORROW AT THE OPEN!<U></B></FONT></DIV></BODY></HTML> |