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
|
3
(9) |
|
4
(28) |
5
(1) |
6
(9) |
7
(9) |
8
|
9
(7) |
10
|
|
11
(1) |
12
(18) |
13
(8) |
14
|
15
|
16
(2) |
17
(2) |
|
18
(17) |
19
(5) |
20
(5) |
21
(12) |
22
(1) |
23
|
24
|
|
25
|
26
(1) |
27
|
28
|
29
(3) |
30
(2) |
|
|
From: Brian M. <ma...@us...> - 2004-04-13 20:47:18
|
Update of /cvsroot/java-game-lib/LWJGL/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27248 Modified Files: installation.php Log Message: linux often needs -Djava.library.path Index: installation.php =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/www/installation.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- installation.php 6 Apr 2004 01:32:12 -0000 1.3 +++ installation.php 13 Apr 2004 20:33:16 -0000 1.4 @@ -64,6 +64,10 @@ once navigated, issue the following command: <pre> java -cp lwjgl.jar:lwjgl_test.jar: org.lwjgl.test.WindowCreationTest</pre> + Should library loading fail, try using <code>-Djava.library.path</code> to specify the path.<br> + for example:<br> + <pre> + java -cp lwjgl.jar:lwjgl_test.jar: -Djava.library.path=/home/lwjgluser/lwjgl/ org.lwjgl.test.WindowCreationTest</pre> </p> <p> a window should appear, and you should see the following output: |
|
From: Brian M. <ma...@us...> - 2004-04-13 20:23:15
|
Update of /cvsroot/java-game-lib/LWJGL/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21912 Modified Files: README Log Message: ready for 0.9 Index: README =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/doc/README,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- README 31 Jan 2004 12:57:25 -0000 1.5 +++ README 13 Apr 2004 20:09:12 -0000 1.6 @@ -12,6 +12,10 @@ Extract the media files into lwjgl folder (only needed for openal tests) java -cp .;lwjgl_test.jar;lwjgl.jar; DEMO + or + java -cp .;lwjgl_test.jar;lwjgl.jar; -Djava.library.path=. DEMO + (this specifies that the jvm should locate the lwjgl libs in current + directory) where DEMO is one of the following: @@ -30,7 +34,6 @@ org.lwjgl.test.opengl.Grass (Requires nVidia hardware) org.lwjgl.test.opengl.Game -Please read this thread, for upgrading issues: -http://www.puppygames.net/forums/viewtopic.php?t=204 - -Project Webpage: www.lwjgl.org \ No newline at end of file +Project Webpage: www.lwjgl.org +Project Forum: forum.lwjgl.org +Project CVS: cvs.lwjgl.org \ No newline at end of file |
|
From: Brian M. <ma...@us...> - 2004-04-13 20:22:09
|
Update of /cvsroot/java-game-lib/LWJGL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21664 Modified Files: build.xml Log Message: ready for 0.9 Index: build.xml =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/build.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- build.xml 7 Mar 2004 15:42:13 -0000 1.17 +++ build.xml 13 Apr 2004 20:08:05 -0000 1.18 @@ -12,7 +12,7 @@ <property name="lwjgl.docs" value="./doc"/> <property name="lwjgl.temp" value="./temp"/> <property name="lwjgl.res" value="./res"/> - <property name="lwjgl.version" value="0.8"/> + <property name="lwjgl.version" value="0.9"/> <!-- ================================================================== --> <!-- Filesets used for targets --> |
|
From: Brian M. <ma...@us...> - 2004-04-13 20:21:10
|
Update of /cvsroot/java-game-lib/LWJGL/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21488 Modified Files: download.php Log Message: ready for 0.9 Index: download.php =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/www/download.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- download.php 4 Apr 2004 10:24:15 -0000 1.2 +++ download.php 13 Apr 2004 20:07:06 -0000 1.3 @@ -9,8 +9,8 @@ <div class="paragraph_item"> <h2>Download</h2> <p> - Latest stable release is 0.8. Please download it here:<br> - <a href="http://sourceforge.net/project/showfiles.php?group_id=58488&package_id=54362&release_id=192924" target="_blank">LWJGL 0.8 alpha</a> + Latest stable release is 0.9. Please download it here:<br> + <a href="http://sourceforge.net/project/showfiles.php?group_id=58488&package_id=54362&release_id=230885" target="_blank">LWJGL 0.9 alpha</a> </p> <p> Random Win32 CVS builds are provided here: <i>Please note that these builds may be more buggy than an official release, but will typically contain the newest features.</i><br> |
|
From: Brian M. <ma...@us...> - 2004-04-13 20:21:10
|
Update of /cvsroot/java-game-lib/LWJGL/www/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21488/include Modified Files: news.php Log Message: ready for 0.9 Index: news.php =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/www/include/news.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- news.php 30 Mar 2004 17:18:40 -0000 1.1 +++ news.php 13 Apr 2004 20:07:07 -0000 1.2 @@ -2,6 +2,11 @@ // News // ======================================================= $news[0] = array( + "LWJGL 0.9a released", + "LWJGL 0.9 alpha has been released! Download <a href=\"http://www.lwjgl.org/download.php\">here</a>.<br>consider <a href=\"http://sourceforge.net/donate/index.php?group_id=58488\">donating</a> if you find LWJGL usefull.", + "Tuesday, April 13th, 2004"); + + $news[1] = array( "New site!", "Welcome to the grand opening of our new site! Please browse around. Should you find any errors or have trouble finding exactly what your looking for, please email <a href=\"mailto:in...@lw...\">in...@lw...</a>", "Sunday, March 28th, 2004"); |
|
From: Brian M. <ma...@us...> - 2004-04-13 18:27:30
|
Update of /cvsroot/java-game-lib/LWJGL/www/changelogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27665/changelogs Modified Files: full-changelog.txt Added Files: 0.90-changelog.txt Log Message: 0.9 changelogs --- NEW FILE: 0.90-changelog.txt --- 2004-04-13 14:13 elias_naur * src/native/linux/: Window.h, org_lwjgl_input_Keyboard.cpp, org_lwjgl_input_Mouse.cpp, org_lwjgl_opengl_Window.cpp: LINUX: Improved input handling 2004-04-12 16:46 matzon * src/: java/org/lwjgl/input/Mouse.java, java/org/lwjgl/test/input/HWCursorTest.java, java/org/lwjgl/test/input/MouseTest.java, native/win32/org_lwjgl_input_Mouse.cpp: fixed mouse issues, setGrabbed & native cursor now works (afaik ;)) 2004-04-12 16:37 matzon * src/java/org/lwjgl/input/Cursor.java: removed resetAnimation 2004-04-12 16:29 elias_naur [...1017 lines suppressed...] native/common/nv/org_lwjgl_opengl_NVVertexProgram.h, native/linux/org_lwjgl_opengl_Pbuffer.cpp: Replaced CHECK_EXISTS with one time check at symbol load time 2004-03-05 23:57 elias_naur * src/native/: common/extgl.cpp, macosx/org_lwjgl_opengl_Window.cpp: Fixed up macosx 2004-03-05 23:20 matzon * src/native/: common/extgl.cpp, macosx/org_lwjgl_opengl_Pbuffer.cpp, macosx/org_lwjgl_opengl_Window.cpp: osx fixes - needs verification 2004-03-05 07:23 matzon * src/java/org/lwjgl/input/Mouse.java: doh, clamping to width instead of height Index: full-changelog.txt =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/www/changelogs/full-changelog.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- full-changelog.txt 30 Mar 2004 17:18:38 -0000 1.1 +++ full-changelog.txt 13 Apr 2004 18:13:28 -0000 1.2 @@ -1,3 +1,577 @@ +2004-04-13 14:13 elias_naur + + * src/native/linux/: Window.h, org_lwjgl_input_Keyboard.cpp, + org_lwjgl_input_Mouse.cpp, org_lwjgl_opengl_Window.cpp: LINUX: + Improved input handling + +2004-04-12 16:46 matzon + + * src/: java/org/lwjgl/input/Mouse.java, + java/org/lwjgl/test/input/HWCursorTest.java, + java/org/lwjgl/test/input/MouseTest.java, + native/win32/org_lwjgl_input_Mouse.cpp: fixed mouse issues, + setGrabbed & native cursor now works (afaik ;)) + +2004-04-12 16:37 matzon + + * src/java/org/lwjgl/input/Cursor.java: removed resetAnimation + +2004-04-12 16:29 elias_naur + + * src/native/linux/org_lwjgl_opengl_Window.cpp: LINUX: Turn off + keyboard repeat rate at Window.create too + +2004-04-12 14:20 elias_naur + + * src/native/linux/: Window.h, org_lwjgl_input_Mouse.cpp, + org_lwjgl_opengl_Window.cpp: LINUX: Fixed warp ignores + +2004-04-12 12:37 matzon + + * src/native/win32/org_lwjgl_input_Mouse.cpp: removed restriction + about native cursors, and fixed mouse not showing on + setNativeCursor(null); + +2004-04-12 12:33 elias_naur + + * src/native/linux/: org_lwjgl_input_Mouse.cpp, + org_lwjgl_opengl_Window.cpp: LINUX:Improved warp event ignore + +2004-04-12 12:05 elias_naur + + * src/: java/org/lwjgl/input/Cursor.java, native/linux/Window.h, + native/linux/org_lwjgl_input_Keyboard.cpp, + native/linux/org_lwjgl_input_Mouse.cpp, + native/linux/org_lwjgl_opengl_Window.cpp: LINUX: Implemented + setGrabbed + +2004-04-12 09:20 elias_naur + + * src/java/org/lwjgl/input/Cursor.java: Cursor.java:Fixed case + where delays == null + +2004-04-12 09:13 elias_naur + + * src/java/org/lwjgl/input/Mouse.java: Reverted the relative + coordinate 'bug' - that's the required behaviour when + Window.update is calling Mouse.poll. Consider the case where we + call Window.update twice before checking getD*: with the old + behaviour, only the deltas between the updates are reported, not + those before the first update + +2004-04-12 02:33 matzon + + * src/: java/org/lwjgl/input/Cursor.java, + java/org/lwjgl/input/Mouse.java, + java/org/lwjgl/test/input/HWCursorTest.java, + java/org/lwjgl/test/input/MouseTest.java, + native/common/org_lwjgl_input_Cursor.h, + native/common/org_lwjgl_input_Mouse.h, + native/linux/org_lwjgl_input_Cursor.cpp, + native/linux/org_lwjgl_input_Mouse.cpp, + native/macosx/org_lwjgl_input_Cursor.cpp, + native/macosx/org_lwjgl_input_Mouse.cpp, + native/win32/org_lwjgl_input_Cursor.cpp, + native/win32/org_lwjgl_input_Mouse.cpp: reworked animated native + cursors, to use X animation when required added initial + setGrabbed(boolean) feature - Work in progress both needs + verification on linux + +2004-04-11 18:03 matzon + + * src/java/org/lwjgl/input/Mouse.java: fixed relative coordinate + bug + +2004-04-09 23:52 elias_naur + + * src/native/common/: common_tools.cpp, extal.cpp, + arb/org_lwjgl_opengl_ARBProgram.cpp, + nv/org_lwjgl_opengl_NVProgram.cpp: Various fixes + +2004-04-09 23:38 elias_naur + + * src/java/org/lwjgl/test/openal/: EAXTest.java, + MovingSoundTest.java, OpenALCreationTest.java, + PlayTestMemory.java, StressTest.java: Fix rest of the openal + examples + +2004-04-09 21:26 elias_naur + + * src/native/common/org_lwjgl_openal_AL10.cpp: [no log message] + +2004-04-09 17:22 elias_naur + + * src/java/org/lwjgl/: openal/AL10.java, + test/openal/BasicTest.java, test/openal/PlayTest.java, + test/openal/PositionTest.java: removed size argument from + alBufferData and added additional buffer types + +2004-04-07 09:55 elias_naur + + * src/java/org/lwjgl/: input/Controller.java, input/Keyboard.java, + input/Mouse.java, opengl/Window.java, + test/input/KeyboardTest.java: Folded read into poll to simplify + interface + +2004-04-07 09:48 elias_naur + + * src/: java/org/lwjgl/input/Keyboard.java, + native/common/org_lwjgl_input_Keyboard.h, + native/linux/org_lwjgl_input_Keyboard.cpp, + native/macosx/org_lwjgl_input_Keyboard.cpp, + native/win32/org_lwjgl_input_Keyboard.cpp: Removed + Keyboard.initIDs + +2004-04-07 09:46 elias_naur + + * src/native/linux/: Window.h, org_lwjgl_Display.cpp, + org_lwjgl_input_Cursor.cpp, org_lwjgl_input_Keyboard.cpp, + org_lwjgl_input_Mouse.cpp, org_lwjgl_opengl_Pbuffer.cpp, + org_lwjgl_opengl_Window.cpp: LINUX: Implemented reference counted + display connection to let Cursors be created and destroyed + without a window or a mouse + +2004-04-06 16:46 elias_naur + + * src/native/common/org_lwjgl_input_Mouse.h: Updated Mouse.h + +2004-04-06 16:40 elias_naur + + * src/native/win32/org_lwjgl_input_Mouse.cpp: win32 fixup + +2004-04-06 16:23 elias_naur + + * src/: java/org/lwjgl/input/Mouse.java, + native/common/org_lwjgl_input_Mouse.h, + native/linux/org_lwjgl_input_Mouse.cpp, + native/macosx/org_lwjgl_input_Mouse.cpp, + native/win32/org_lwjgl_input_Mouse.cpp: Make poll deltas + accumulative, and only reset on getD* + +2004-04-06 03:32 matzon + + * www/: installation.php, images/installation/netbeans-1.png, + images/installation/netbeans-2.png, + images/installation/netbeans-3.png: Netbeans installation guide + +2004-04-05 16:19 elias_naur + + * src/native/linux/org_lwjgl_opengl_Window.cpp: [no log message] + +2004-04-04 16:10 elias_naur + + * src/java/org/lwjgl/opengl/Window.java: Updated docs to reflect + the dirty flag change + +2004-04-04 16:09 elias_naur + + * src/native/: linux/org_lwjgl_opengl_Window.cpp, + win32/org_lwjgl_opengl_Window.cpp: Reverted the dirty flag + change, because it might be used as a flag to check if the back + buffer is corrupted when creating textures from the it. You can't + just swap the back buffer in to clear the flag in that case. So + we need the flag to be cleared also when isDirty is called + +2004-04-04 15:43 cix_foo + + * src/native/linux/org_lwjgl_opengl_Window.cpp: Tweaking + +2004-04-04 15:38 cix_foo + + * src/native/win32/org_lwjgl_opengl_Window.cpp: [no log message] + +2004-04-04 15:37 cix_foo + + * src/: java/org/lwjgl/opengl/Window.java, + native/linux/org_lwjgl_opengl_Window.cpp: Tweaking + +2004-04-04 15:24 elias_naur + + * src/native/linux/org_lwjgl_opengl_Window.cpp: Pulled global + isUndecorated into function + +2004-04-04 15:19 cix_foo + + * src/java/org/lwjgl/opengl/Window.java: [no log message] + +2004-04-04 15:18 elias_naur + + * src/java/org/lwjgl/test/opengl/PbufferTest.java: Fixed a small + glitch in the test conversion + +2004-04-04 15:01 cix_foo + + * src/java/org/lwjgl/opengl/Window.java: Rules with mighty fist. + New API killed off before it even sees light of day. Some + refactoring. + +2004-04-04 14:51 cix_foo + + * src/: native/linux/org_lwjgl_opengl_Window.cpp, + java/org/lwjgl/opengl/Window.java: Rules with mighty fist. New + API killed off before it even sees light of day. Some + refactoring. + +2004-04-04 14:48 cix_foo + + * src/: java/org/lwjgl/test/opengl/shaders/ShadersTest.java, + java/org/lwjgl/test/opengl/BouncingWindowTest.java, + java/org/lwjgl/test/opengl/FullScreenWindowedTest.java, + java/org/lwjgl/test/opengl/Game.java, + java/org/lwjgl/test/opengl/Grass.java, + java/org/lwjgl/test/opengl/PbufferTest.java, + java/org/lwjgl/test/opengl/VBOIndexTest.java, + java/org/lwjgl/test/opengl/VBOTest.java, + java/org/lwjgl/test/input/HWCursorTest.java, + native/common/org_lwjgl_opengl_Window.h, + java/org/lwjgl/test/input/ControllerTest.java, + java/org/lwjgl/test/input/KeyboardTest.java, + java/org/lwjgl/test/input/MouseTest.java, + java/org/lwjgl/test/openal/PositionTest.java, + native/win32/org_lwjgl_opengl_Window.cpp: Rules with mighty fist. + New API killed off before it even sees light of day. Some + refactoring. + +2004-04-04 12:24 matzon + + * www/: documentation.php, forum.php, installation.php, + license.php, links.php, about.php, changelog.php, contact.php, + credits.php, demos.php: removed news require + +2004-04-04 12:24 matzon + + * www/download.php: added win32 cvs build + +2004-04-04 12:23 matzon + + * www/images/projects/: vermins_1.jpg, vermins_2.jpg, + vermins_small_1.jpg, vermins_small_2.jpg: Vermin ExTerminator + screenshots added + +2004-04-04 12:22 matzon + + * www/: include/projects.php, projects.php: made projects random + +2004-04-04 11:34 elias_naur + + * src/native/linux/org_lwjgl_opengl_Window.cpp: Implemented the + undecorated flag and reshape on linux + +2004-04-04 10:36 elias_naur + + * src/native/linux/org_lwjgl_opengl_Window.cpp: Fixed compile + problems + +2004-04-04 10:10 elias_naur + + * src/java/org/lwjgl/opengl/Window.java: Fixed typo + +2004-04-04 09:37 elias_naur + + * src/native/win32/org_lwjgl_input_Mouse.cpp: Fixed a possible + buffer overflow bug in Mouse + +2004-04-04 01:14 cix_foo + + * src/java/org/lwjgl/opengl/Window.java: Added clamping to window + bounds + +2004-04-04 01:01 cix_foo + + * src/: java/org/lwjgl/opengl/Window.java, + native/win32/org_lwjgl_opengl_Window.cpp, + java/org/lwjgl/test/opengl/BouncingWindowTest.java, + native/common/org_lwjgl_opengl_Window.h, + native/linux/org_lwjgl_opengl_Window.cpp: New window sizing & + undecorated code + +2004-04-03 23:08 cix_foo + + * src/java/org/lwjgl/opengl/BufferChecks.java: Superfluous import + +2004-04-03 23:05 cix_foo + + * src/java/org/lwjgl/opengl/Window.java: Added four boolean + properties to alter default behaviour in non-standard apps + +2004-04-03 20:18 matzon + + * src/java/org/lwjgl/input/Mouse.java: center mouse as cursor is + +2004-03-31 23:03 spasi + + * src/java/org/lwjgl/test/opengl/shaders/: ShadersTest.java, + shaderFSH.fsh: Bugs fixed + +2004-03-31 19:43 spasi + + * src/java/org/lwjgl/test/opengl/shaders/: ShadersTest.java, + shaderFSH.fsh, shaderFSH.vsh, shaderVSH.vsh: Fixed bugs + +2004-03-31 01:25 spasi + + * src/java/org/lwjgl/test/opengl/shaders/: Shader.java, + ShaderFP.java, ShaderFSH.java, ShaderVP.java, ShaderVSH.java, + ShadersTest.java, shaderFP.fp, shaderFP.vp, shaderFSH.fsh, + shaderFSH.vsh, shaderVP.vp, shaderVSH.vsh: Added shader tests + +2004-03-30 19:18 matzon + + * www/: about.php, changelog.php, contact.php, credits.php, + default.css, demos.php, documentation.php, download.php, faq.php, + forum.php, index.php, installation.php, license.php, links.php, + projects.php, changelogs/0.10-changelog.txt, + changelogs/0.20-changelog.txt, changelogs/0.30-changelog.txt, + changelogs/0.40-changelog.txt, changelogs/0.50-changelog.txt, + changelogs/0.60-changelog.txt, changelogs/0.70-changelog.txt, + changelogs/0.80-changelog.txt, changelogs/0.89-changelog.txt, + changelogs/full-changelog.txt, images/installation/eclipse-1.png, + images/installation/eclipse-2.png, + images/installation/eclipse-3.png, + images/installation/eclipse-4.png, + images/projects/alienflux_1.jpg, images/projects/alienflux_2.jpg, + images/projects/alienflux_3.jpg, + images/projects/alienflux_small_1.jpg, + images/projects/alienflux_small_2.jpg, + images/projects/alienflux_small_3.jpg, + images/projects/extorris_1.jpg, images/projects/extorris_2.jpg, + images/projects/extorris_3.jpg, + images/projects/extorris_small_1.jpg, + images/projects/extorris_small_2.jpg, + images/projects/extorris_small_3.jpg, + images/projects/marathon_1.jpg, images/projects/marathon_2.jpg, + images/projects/marathon_3.jpg, + images/projects/marathon_small_1.jpg, + images/projects/marathon_small_2.jpg, + images/projects/marathon_small_3.jpg, + images/projects/tribaltrouble_1.jpg, + images/projects/tribaltrouble_2.jpg, + images/projects/tribaltrouble_3.jpg, + images/projects/tribaltrouble_small_1.jpg, + images/projects/tribaltrouble_small_2.jpg, + images/projects/tribaltrouble_small_3.jpg, include/default.php, + include/faq.php, include/news.php, jnlp/lwjgl-demo.php, + jnlp/lwjgl-media.jar, jnlp/lwjgl-windows.jar, jnlp/lwjgl.jar, + jnlp/lwjgl_test.jar, jnlp/lwjglaudio-windows.jar, + jnlp/source.php: readded site under www + +2004-03-30 19:13 spasi + + * src/java/org/lwjgl/opengl/: ARBBufferObject.java, + ARBFragmentProgram.java, ARBProgram.java, + ARBVertexBufferObject.java, ARBVertexProgram.java, + EXTPixelBufferObject.java, NVFragmentProgram.java, + NVProgram.java, NVVertexProgram.java: Restored hierarchies and + completed EXT_pixel_buffer_object + +2004-03-30 19:09 matzon + + * .cvsignore: added .project to cvs ignore - keep IDE's out of root + folder + +2004-03-29 21:09 elias_naur + + * src/java/org/lwjgl/opengl/BufferChecks.java: Add error message to + the buffer overflow exception + +2004-03-29 18:55 spasi + + * src/native/common/ext/: Makefile.am, + org_lwjgl_opengl_EXTDepthBoundsTest.cpp: New extensions and + static import modifications + +2004-03-29 18:51 spasi + + * src/native/common/: arb/Makefile.am, + arb/org_lwjgl_opengl_ARBBufferObject.cpp, + arb/org_lwjgl_opengl_ARBVertexBufferObject.cpp, + nv/org_lwjgl_opengl_NVFragmentProgram.cpp: New extensions and + static import modifications + +2004-03-29 18:47 spasi + + * src/native/common/: extgl.cpp, extgl.h: New extensions and static + import modifications + +2004-03-29 18:44 spasi + + * src/java/org/lwjgl/: opengl/ARBBufferObject.java, + opengl/ARBFragmentProgram.java, opengl/ARBProgram.java, + opengl/ARBVertexBufferObject.java, opengl/ARBVertexProgram.java, + opengl/EXTDepthBoundsTest.java, opengl/EXTPixelBufferObject.java, + opengl/GLContext.java, opengl/NVFragmentProgram.java, + opengl/NVProgram.java, opengl/NVVertexProgram.java, + test/opengl/Grass.java, test/opengl/VBOIndexTest.java, + test/opengl/VBOTest.java: New extensions and static import + modifications + +2004-03-29 13:28 elias_naur + + * src/java/org/lwjgl/opengl/VBOTracker.java: The client attrib + stack tracked by VBOTracter is now at least 1 + +2004-03-29 13:26 elias_naur + + * src/native/linux/: org_lwjgl_opengl_Pbuffer.cpp, + org_lwjgl_opengl_Window.cpp: added missing software flag checks + in linux + +2004-03-29 09:53 elias_naur + + * src/java/org/lwjgl/opengl/: ARBFragmentProgram.java, + NVFragmentProgram.java, NVProgram.java: Fixed newlines + +2004-03-29 09:32 elias_naur + + * src/java/org/lwjgl/: opengl/GL11.java, opengl/GL15.java, + opengl/glu/Project.java, test/opengl/Grass.java: Fixed naming + +2004-03-28 22:29 spasi + + * src/java/org/lwjgl/opengl/Window.java: Fixed vsync bug + +2004-03-27 16:05 elias_naur + + * src/: java/org/lwjgl/Display.java, + java/org/lwjgl/LWJGLErrorException.java, + java/org/lwjgl/LWJGLException.java, java/org/lwjgl/Sys.java, + java/org/lwjgl/input/Controller.java, + java/org/lwjgl/input/Cursor.java, + java/org/lwjgl/input/Keyboard.java, + java/org/lwjgl/input/Mouse.java, java/org/lwjgl/openal/AL.java, + java/org/lwjgl/openal/ALC.java, + java/org/lwjgl/openal/eax/EAX.java, + java/org/lwjgl/opengl/Pbuffer.java, + java/org/lwjgl/opengl/Window.java, + native/common/common_tools.cpp: Renamed LWJGLErrorException to + LWJGLException + +2004-03-27 15:42 elias_naur + + * src/: java/org/lwjgl/Display.java, + java/org/lwjgl/LWJGLErrorException.java, + java/org/lwjgl/SwingAdapter.java, + java/org/lwjgl/input/Controller.java, + java/org/lwjgl/input/Cursor.java, + java/org/lwjgl/input/Keyboard.java, + java/org/lwjgl/input/Mouse.java, java/org/lwjgl/openal/AL.java, + java/org/lwjgl/openal/ALC.java, + java/org/lwjgl/openal/eax/EAX.java, + java/org/lwjgl/opengl/Pbuffer.java, + java/org/lwjgl/opengl/Window.java, + native/common/common_tools.cpp, native/common/extal.cpp: Added + LWJGLErrorException to replace the too general Exception + +2004-03-27 15:09 elias_naur + + * src/: java/org/lwjgl/Sys.java, native/common/checkALerror.h, + native/common/common_tools.cpp, native/common/common_tools.h, + native/common/org_lwjgl_Sys.h, native/linux/org_lwjgl_Sys.cpp, + native/linux/org_lwjgl_opengl_Window.cpp, native/macosx/hid.cpp, + native/macosx/org_lwjgl_Sys.cpp, native/win32/org_lwjgl_Sys.cpp: + Implemented version check to check for incompatible native + libraries + +2004-03-27 14:48 elias_naur + + * src/java/org/lwjgl/: Display.java, Sys.java, + input/Controller.java, input/Cursor.java, input/Keyboard.java, + input/Mouse.java, openal/AL.java, openal/ALC.java, + openal/eax/EAX.java, openal/eax/EAXBufferProperties.java, + openal/eax/EAXListenerProperties.java, opengl/GLContext.java, + opengl/Pbuffer.java, opengl/Window.java: All classes use + Sys.initialize now + +2004-03-27 12:55 elias_naur + + * src/java/org/lwjgl/: Display.java, input/Controller.java, + input/Cursor.java, input/Keyboard.java, input/Mouse.java, + openal/AL10.java, opengl/ARBVertexBufferObject.java, + opengl/ARBVertexShader.java, opengl/ATIDrawBuffers.java, + opengl/GL15.java, opengl/Window.java: Replaced asserts with + proper runtime exceptions + +2004-03-26 22:57 matzon + + * src/java/org/lwjgl/: input/Keyboard.java, input/Mouse.java, + test/WindowCreationTest.java, + test/input/ControllerCreationTest.java, + test/input/ControllerTest.java, test/input/HWCursorTest.java, + test/input/MouseCreationTest.java, test/input/MouseTest.java, + test/openal/ALCTest.java, test/openal/PositionTest.java, + test/opengl/FullScreenWindowedTest.java, + test/opengl/VBOIndexTest.java, test/opengl/VBOTest.java: fixed + tests according to new way cleaned up imports + +2004-03-26 22:49 elias_naur + + * src/native/win32/: org_lwjgl_input_Keyboard.cpp, + org_lwjgl_input_Mouse.cpp: Saved input events for win32 + +2004-03-26 22:11 elias_naur + + * src/: java/org/lwjgl/input/Keyboard.java, + java/org/lwjgl/input/Mouse.java, native/common/common_tools.cpp, + native/common/common_tools.h, + native/common/org_lwjgl_input_Keyboard.h, + native/common/org_lwjgl_input_Mouse.h, + native/linux/org_lwjgl_input_Keyboard.cpp, + native/linux/org_lwjgl_input_Mouse.cpp, + native/macosx/org_lwjgl_input_Keyboard.cpp, + native/macosx/org_lwjgl_input_Mouse.cpp: Save unread buffered + input events between read()s + +2004-03-26 17:18 elias_naur + + * src/java/org/lwjgl/input/Mouse.java: set native cursor to null at + Mouse.destroy() + +2004-03-26 16:03 matzon + + * src/java/org/lwjgl/test/: input/ControllerCreationTest.java, + input/ControllerTest.java, input/HWCursorTest.java, + input/KeyboardTest.java, input/MouseCreationTest.java, + input/MouseTest.java, opengl/VBOIndexTest.java, + opengl/VBOTest.java: removed Window.paint() references + +2004-03-26 12:26 cix_foo + + * src/java/org/lwjgl/: BufferUtils.java, opengl/ARBImaging.java, + opengl/Util.java, opengl/VBOTracker.java, + test/openal/PositionTest.java, test/opengl/Game.java, + test/opengl/Grass.java, test/opengl/PbufferTest.java, + input/Keyboard.java: Simplification work + +2004-03-26 12:09 cix_foo + + * src/java/org/lwjgl/opengl/Window.java: Simplification work + +2004-03-26 12:01 cix_foo + + * src/: native/common/org_lwjgl_opengl_Window.h, + native/win32/org_lwjgl_opengl_Window.cpp, + java/org/lwjgl/test/opengl/FullScreenWindowedTest.java, + native/linux/org_lwjgl_opengl_Window.cpp: Simplification work + +2004-03-26 12:01 cix_foo + + * src/java/org/lwjgl/opengl/Window.java: [no log message] + +2004-03-26 11:58 cix_foo + + * src/java/org/lwjgl/input/: Controller.java, Keyboard.java, + Mouse.java: Simplification work + +2004-03-25 23:44 matzon + + * src/java/org/lwjgl/test/openal/: BasicTest.java, + PositionTest.java: cleaned up + +2004-03-25 23:38 matzon + + * src/java/org/lwjgl/test/openal/PositionTest.java: fixed minimized + || !focus bug + 2004-03-23 22:23 matzon * src/native/macosx/org_lwjgl_opengl_Window.cpp: added nMakeCurrent @@ -1308,24 +1882,10 @@ * src/native/common/nv/org_lwjgl_opengl_nv_NVFragmentProgram.h: Fixed compile errors in NVFragmentProgram -2004-01-31 14:01 matzon - - * website/documents/: credits.html, license.html, readme.html: - updated - 2004-01-31 13:57 matzon * doc/: CREDITS, LICENSE, README: updated -2004-01-31 13:50 matzon - - * website/documents/index.html: better wording - -2004-01-31 13:49 matzon - - * website/documents/index.html: new documents page, until new site - is done - 2004-01-31 13:34 matzon * platform_build/win32_vs_net/: lwjgl.sln, lwjgl.suo, lwjgl.vcproj: @@ -1962,10 +2522,6 @@ * src/native/linux/org_lwjgl_Sys.cpp: Newline fix -2003-11-20 23:15 matzon - - * website/index.html: added irc to front page - 2003-11-18 12:10 cix_foo * src/java/org/lwjgl/opengl/: CoreGL11.java, GL.java: Fixed naming @@ -2700,8 +3256,7 @@ 2003-08-24 22:47 matzon - * build.xml, website/documents/tutorials/openal/openal_basics.html: - preparing for 0.7 + * build.xml: preparing for 0.7 2003-08-23 13:34 elias_naur @@ -3559,14 +4114,6 @@ * src/native/linux/org_lwjgl_opengl_BaseGL.cpp: Small error message fix -2003-07-10 16:19 matzon - - * website/index.html: fix: http - -2003-07-10 16:18 matzon - - * website/index.html: small changes for lwjgl.org - 2003-07-07 00:43 elias_naur * src/java/org/lwjgl/opengl/: BaseGL.java, CoreGL.java, GL.java: @@ -3721,14 +4268,6 @@ native/win32/org_lwjgl_input_Keyboard.cpp, native/win32/org_lwjgl_input_Mouse.cpp: Ported OpenGL to Buffers -2003-06-18 01:00 matzon - - * website/documents/links.html: added AF link - -2003-06-18 01:00 matzon - - * website/index.html: now linking to puppygames forum - 2003-06-17 23:23 matzon * src/java/org/lwjgl/test/: openal/WaveData.java, @@ -4182,13 +4721,11 @@ * doc/tutorial/openal_basics.html: updated to reflect version in website folder -2003-04-27 23:25 matzon +2003-04-27 23:26 matzon - * website/documents/tutorials/openal/openal_basics.html, - src/java/org/lwjgl/openal/AL.java, - src/java/org/lwjgl/test/openal/BasicTest.java, - src/java/org/lwjgl/test/openal/OpenALCreationTest.java: add: - default constructor for OpenAL + * src/java/org/lwjgl/: openal/AL.java, test/openal/BasicTest.java, + test/openal/OpenALCreationTest.java: add: default constructor for + OpenAL 2003-04-27 20:39 matzon @@ -4197,30 +4734,28 @@ 2003-04-27 20:37 matzon - * src/java/org/lwjgl/openal/AL.java, - src/java/org/lwjgl/openal/ALC.java, - src/java/org/lwjgl/openal/ALCcontext.java, - src/java/org/lwjgl/openal/ALCdevice.java, - src/java/org/lwjgl/openal/BaseAL.java, - src/java/org/lwjgl/openal/BaseALConstants.java, - src/java/org/lwjgl/openal/CoreAL.java, - src/java/org/lwjgl/test/openal/ALCTest.java, - src/java/org/lwjgl/test/openal/ALTest.java, - src/java/org/lwjgl/test/openal/BasicTest.java, - src/java/org/lwjgl/test/openal/EAXTest.java, - src/java/org/lwjgl/test/openal/MovingSoundTest.java, - src/java/org/lwjgl/test/openal/OpenALCreationTest.java, - src/java/org/lwjgl/test/openal/PlayTest.java, - src/java/org/lwjgl/test/openal/PlayTestMemory.java, - src/java/org/lwjgl/test/openal/SourceLimitTest.java, - src/java/org/lwjgl/test/openal/StressTest.java, - src/native/common/org_lwjgl_openal_ALC.cpp, - src/native/common/org_lwjgl_openal_ALC.h, - src/native/common/org_lwjgl_openal_BaseAL.h, - src/native/common/org_lwjgl_openal_CoreAL.h, - website/documents/tutorials/openal/openal_basics.html: New OpenAL - programming model: no context/device fiddling easier - initialization + * src/: java/org/lwjgl/openal/AL.java, + java/org/lwjgl/openal/ALC.java, + java/org/lwjgl/openal/ALCcontext.java, + java/org/lwjgl/openal/ALCdevice.java, + java/org/lwjgl/openal/BaseAL.java, + java/org/lwjgl/openal/BaseALConstants.java, + java/org/lwjgl/openal/CoreAL.java, + java/org/lwjgl/test/openal/ALCTest.java, + java/org/lwjgl/test/openal/ALTest.java, + java/org/lwjgl/test/openal/BasicTest.java, + java/org/lwjgl/test/openal/EAXTest.java, + java/org/lwjgl/test/openal/MovingSoundTest.java, + java/org/lwjgl/test/openal/OpenALCreationTest.java, + java/org/lwjgl/test/openal/PlayTest.java, + java/org/lwjgl/test/openal/PlayTestMemory.java, + java/org/lwjgl/test/openal/SourceLimitTest.java, + java/org/lwjgl/test/openal/StressTest.java, + native/common/org_lwjgl_openal_ALC.cpp, + native/common/org_lwjgl_openal_ALC.h, + native/common/org_lwjgl_openal_BaseAL.h, + native/common/org_lwjgl_openal_CoreAL.h: New OpenAL programming + model: no context/device fiddling easier initialization 2003-04-26 08:54 elias_naur @@ -4328,8 +4863,7 @@ 2003-03-30 15:30 matzon - * doc/tutorial/intro.html, website/documents/tutorials/intro.html: - fix: remove platform specific wording + * doc/tutorial/intro.html: fix: remove platform specific wording 2003-03-29 22:51 cix_foo @@ -4780,10 +5314,6 @@ native/win32/org_lwjgl_Display.cpp, java/org/lwjgl/Display.java: fix: now enumerates multiple displaydevices, if available -2003-03-02 23:59 matzon - - * website/documents/readme.html: update to reflect newest readme - 2003-03-02 23:09 matzon * doc/README: added mo content @@ -5098,11 +5628,6 @@ 2003-01-29 22:34 matzon - * website/documents/tutorials/opengl/skeleton_code.html: made - compatible with 0.4 - -2003-01-29 22:34 matzon - * src/java/org/lwjgl/test/opengl/Game.java: cleaned up removed some stuff (specifically buffered mouse mode) @@ -5146,11 +5671,6 @@ org_lwjgl_input_GamePad.cpp, org_lwjgl_input_Joystick.cpp, org_lwjgl_input_Keyboard.cpp: Fixed linux compile -2003-01-11 14:56 matzon - - * website/documents/links.html: add: link to chman's nehe ports - added - 2003-01-03 19:47 matzon * src/: java/org/lwjgl/input/Controller.java, @@ -5407,14 +5927,11 @@ 2002-12-21 13:10 matzon - * doc/tutorial/openal_basics.html, - website/documents/tutorials/openal/openal_basics.html: up to date - version + * doc/tutorial/openal_basics.html: up to date version 2002-12-21 13:09 matzon - * doc/CREDITS, website/documents/credits.html: credit due, where - credit is due + * doc/CREDITS: credit due, where credit is due 2002-12-21 13:08 matzon @@ -5437,42 +5954,6 @@ native/macosx/org_lwjgl_Display.cpp, native/macosx/org_lwjgl_input_GamePad.cpp: no message -2002-12-20 22:20 matzon - - * content/bullet.psd, content/linkbar.psd, content/logo.psd, - content/miscellaneous.psd, content/tutorialsbar.psd, - website/index.html, website/documents/credits.html, - website/documents/index.html, website/documents/license.html, - website/documents/links.html, - website/documents/openal_c-to-java.html, - website/documents/readme.html, - website/documents/tutorials/intro.html, - website/documents/tutorials/openal/openal_basics.html, - website/documents/tutorials/opengl/skeleton_code.html, - website/images/bullet.png, website/images/cvs.png, - website/images/cvs_selected.png, website/images/discussion.png, - website/images/discussion_selected.png, - website/images/documents.png, - website/images/documents_selected.png, - website/images/download.png, - website/images/download_selected.png, website/images/input.png, - website/images/links.png, website/images/links_selected.png, - website/images/logo.png, website/images/lwjgl.png, - website/images/miscellaneous.png, website/images/openal.png, - website/images/opengl.png, website/images/sourceforge.png, - website/images/sourceforge_selected.png, - website/images/vector.png: website files - -2002-12-20 22:19 matzon - - * content/about.xml, content/contact.xml, content/credits.xml, - content/download.xml, content/license.xml, content/navbar.xml, - content/simple.xsl, content/source.xml, website/about.html, - website/contact.html, website/credits.html, - website/download.html, website/license.html, website/navbar.html, - website/simple.css, website/source.html, website/title.png: - removing not used files - 2002-12-20 21:47 matzon * src/java/org/lwjgl/test/opengl/Grass.java: fix: package statment @@ -6170,14 +6651,6 @@ * src/native/linux/Makefile: make g++ compile with -O3 -2002-11-22 00:05 matzon - - * .project: *** keyword substitution change *** - -2002-11-21 23:46 matzon - - * .project: fix: made .project file into java project - 2002-11-21 23:38 matzon * src/java/org/lwjgl/test/openal/ALTest.java: fix: removed unneeded @@ -7322,13 +7795,8 @@ 2002-08-12 01:38 mpcooke3 - * .project, build.xml, content/about.xml, content/contact.xml, - content/credits.xml, content/download.xml, content/license.xml, - content/navbar.xml, content/simple.xsl, content/source.xml, - website/about.html, website/contact.html, website/credits.html, - website/download.html, website/license.html, website/navbar.html, - website/simple.css, website/source.html, website/title.png: Some - initial stuff for the website. Not ready to go live yet - Matt + * build.xml: Some initial stuff for the website. Not ready to go + live yet - Matt 2002-08-11 18:27 matzon |
|
From: Brian M. <ma...@us...> - 2004-04-13 18:27:29
|
Update of /cvsroot/java-game-lib/LWJGL/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27665 Modified Files: changelog.php Log Message: 0.9 changelogs Index: changelog.php =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/www/changelog.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- changelog.php 4 Apr 2004 10:24:40 -0000 1.2 +++ changelog.php 13 Apr 2004 18:13:27 -0000 1.3 @@ -22,6 +22,7 @@ <p> <ul> <li><a href="changelogs/full-changelog.txt">Full changelog</a></li> + <li><a href="#0.90">LWJGL 0.90</a></li> <li><a href="#0.89">LWJGL 0.89</a></li> <li><a href="#0.80">LWJGL 0.80</a></li> <li><a href="#0.70">LWJGL 0.70</a></li> @@ -34,6 +35,7 @@ </ul> </p> + <?php printChangelog("0.90"); ?> <?php printChangelog("0.89"); ?> <?php printChangelog("0.80"); ?> <?php printChangelog("0.70"); ?> |
|
From: Elias N. <eli...@us...> - 2004-04-13 12:27:38
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12740/linux Modified Files: Window.h org_lwjgl_input_Keyboard.cpp org_lwjgl_input_Mouse.cpp org_lwjgl_opengl_Window.cpp Log Message: LINUX: Improved input handling Index: org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- org_lwjgl_input_Mouse.cpp 12 Apr 2004 12:20:59 -0000 1.51 +++ org_lwjgl_input_Mouse.cpp 13 Apr 2004 12:13:32 -0000 1.52 @@ -119,7 +119,7 @@ static void updateCursor(void) { Cursor cursor; - if (isGrabbed()) + if (shouldGrab()) cursor = blank_cursor; else cursor = current_cursor; @@ -152,7 +152,7 @@ void updatePointerGrab(void) { if (!created) return; - if (shouldGrab()) { + if (isFullscreen() || shouldGrab()) { grabPointer(); } else { ungrabPointer(); @@ -162,13 +162,15 @@ static void doWarpPointer(void ) { XEvent ignore_warp_guard; - ignore_warp_guard.type = MotionNotify; + ignore_warp_guard.type = ClientMessage; + ignore_warp_guard.xclient.message_type = getWarpAtom(); + ignore_warp_guard.xclient.format = 8; // Tell event loop to start ignoring motion events - ignore_warp_guard.xmotion.state = 1; + ignore_warp_guard.xclient.data.b[0] = 1; XSendEvent(getDisplay(), getCurrentWindow(), False, 0, &ignore_warp_guard); XWarpPointer(getDisplay(), None, getCurrentWindow(), 0, 0, 0, 0, getWindowWidth()/2, getWindowHeight()/2); // Tell event loop to stop ignoring motion events - ignore_warp_guard.xmotion.state = 0; + ignore_warp_guard.xclient.data.b[0] = 0; XSendEvent(getDisplay(), getCurrentWindow(), False, 0, &ignore_warp_guard); /* centerCursor(); @@ -189,7 +191,7 @@ } static void warpPointer(void) { - if (!pointer_grabbed || !isGrabbed()) + if (!pointer_grabbed || !shouldGrab()) return; // Reset pointer to middle of screen if outside a certain inner border if (current_x < POINTER_WARP_BORDER || current_y < POINTER_WARP_BORDER || Index: org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- org_lwjgl_opengl_Window.cpp 12 Apr 2004 14:29:55 -0000 1.40 +++ org_lwjgl_opengl_Window.cpp 13 Apr 2004 12:13:32 -0000 1.41 @@ -76,6 +76,7 @@ static bool ignore_motion_events; static Display *display_connection = NULL; +static Atom warp_atom; static int display_connection_usage = 0; Display *getDisplay(void) { @@ -89,11 +90,16 @@ throwException(env, "Could not open X display"); return NULL; } + warp_atom = XInternAtom(getDisplay(), "ignore_warp_atom", False); } display_connection_usage++; return display_connection; } +Atom getWarpAtom(void) { + return warp_atom; +} + void decDisplay(void) { display_connection_usage--; if (display_connection_usage == 0) @@ -140,12 +146,8 @@ return current_fullscreen; } -bool isGrabbed(void) { - return grab; -} - bool shouldGrab(void) { - return current_fullscreen || (!input_released && grab); + return !input_released && grab; } void setGrab(bool new_grab) { @@ -154,16 +156,22 @@ } static void handleMotion(XMotionEvent *event) { - if (event->send_event == True) { - // We got a warp ignore message - ignore_motion_events = event->state == 1 ? true : false; - } else if (ignore_motion_events) { + if (ignore_motion_events) { resetCursor(event->x, event->y); } else { handlePointerMotion(event); } } +static void checkInput(void) { + Window win; + int revert_mode; + XGetInputFocus(getDisplay(), &win, &revert_mode); + if (win == current_win) { + acquireInput(); + focused = true; + } +} static void handleMessages() { XEvent event; Window win; @@ -172,7 +180,9 @@ XNextEvent(getDisplay(), &event); switch (event.type) { case ClientMessage: - if ((event.xclient.format == 32) && ((Atom)event.xclient.data.l[0] == delete_atom)) + if (event.xclient.message_type == warp_atom) { + ignore_motion_events = event.xclient.data.b[0] == 1 ? true : false; + } else if ((event.xclient.format == 32) && ((Atom)event.xclient.data.l[0] == delete_atom)) closerequested = true; break; case FocusOut: @@ -183,11 +193,7 @@ } break; case FocusIn: - XGetInputFocus(getDisplay(), &win, &revert_mode); - if (win == current_win) { - acquireInput(); - focused = true; - } + checkInput(); break; case MapNotify: dirty = true; @@ -200,6 +206,7 @@ dirty = true; break; case ButtonPress: + checkInput(); handleButtonPress(&(event.xbutton)); break; case ButtonRelease: Index: Window.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Window.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Window.h 12 Apr 2004 12:20:59 -0000 1.10 +++ Window.h 13 Apr 2004 12:13:32 -0000 1.11 @@ -56,6 +56,8 @@ extern void resetCursor(int x, int y); + extern Atom getWarpAtom(void); + /* * Various functions to release/acquire keyboard and mouse */ @@ -67,7 +69,6 @@ extern void updateKeyboardGrab(void); extern void setGrab(bool); extern bool shouldGrab(void); - extern bool isGrabbed(void); /* * get the current window width Index: org_lwjgl_input_Keyboard.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- org_lwjgl_input_Keyboard.cpp 12 Apr 2004 10:05:13 -0000 1.33 +++ org_lwjgl_input_Keyboard.cpp 13 Apr 2004 12:13:32 -0000 1.34 @@ -80,7 +80,7 @@ void updateKeyboardGrab(void) { if (!created) return; - if (shouldGrab()) { + if (isFullscreen() || shouldGrab()) { grabKeyboard(); } else { ungrabKeyboard(); |
|
From: Brian M. <ma...@us...> - 2004-04-12 15:00:08
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4113/java/org/lwjgl/test/input Modified Files: HWCursorTest.java MouseTest.java Log Message: fixed mouse issues, setGrabbed & native cursor now works (afaik ;)) Index: HWCursorTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/HWCursorTest.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- HWCursorTest.java 12 Apr 2004 00:33:00 -0000 1.31 +++ HWCursorTest.java 12 Apr 2004 14:46:18 -0000 1.32 @@ -89,8 +89,6 @@ glInit(); - Keyboard.create(); - Mouse.create(); initNativeCursors(); } catch (Exception e) { @@ -106,10 +104,6 @@ cursor = new Cursor[3]; - // center - mouse_x = 400; - mouse_y = 300; - int cursorImageCount = 1; int cursorWidth = Mouse.getMaxCursorSize(); int cursorHeight = cursorWidth; @@ -214,6 +208,7 @@ if (Window.isVisible()) { // check keyboard input processKeyboard(); + processMouse(); render(); } else { @@ -255,29 +250,33 @@ } GL11.glPopMatrix(); } + + private void processMouse() { + int dx = Mouse.getDX(); + int dy = Mouse.getDY(); + + if (dx != 0 || dy != 0) { + //mouse_x += dx; + //mouse_y += dy; + } + mouse_x = Mouse.getX(); + mouse_y = Mouse.getY(); + + while(Mouse.next()) { + if(Mouse.getEventButtonState() && Mouse.getEventButton() < 3) { + mouse_btn = Mouse.getEventButton(); + } + } + } /** * Processes keyboard input */ private void processKeyboard() { - if (Mouse.getDX() != 0 || Mouse.getDY() != 0) { - mouse_x += Mouse.getDX() / 2; - mouse_y += Mouse.getDY() / 2; - } - - if(Mouse.isButtonDown(0)) { - mouse_btn = 0; - } else if(Mouse.isButtonDown(1)) { - mouse_btn = 1; - } else if(Mouse.isButtonDown(2)) { - mouse_btn = 2; - } - //check for fullscreen key if (Keyboard.isKeyDown(Keyboard.KEY_F)) { try { - Keyboard.destroy(); try { Mouse.setNativeCursor(null); } catch (Exception e) { @@ -287,7 +286,6 @@ for(int i=0; i<cursor.length; i++) { cursor[i].destroy(); } - Mouse.destroy(); Window.destroy(); Display.setDisplayMode(mode); @@ -295,7 +293,6 @@ glInit(); - Keyboard.create(); initNativeCursors(); } catch (Exception e) { e.printStackTrace(); @@ -305,7 +302,6 @@ //check for window key if (Keyboard.isKeyDown(Keyboard.KEY_W)) { try { - Keyboard.destroy(); try { Mouse.setNativeCursor(null); } catch (Exception e) { @@ -315,7 +311,6 @@ for(int i=0; i<cursor.length; i++) { cursor[i].destroy(); } - Mouse.destroy(); Window.destroy(); Display.resetDisplayMode(); @@ -323,7 +318,6 @@ glInit(); - Keyboard.create(); initNativeCursors(); } catch (Exception e) { e.printStackTrace(); @@ -340,24 +334,25 @@ if (Keyboard.isKeyDown(Keyboard.KEY_N)) { try { - cursor[mouse_btn].resetAnimation(); Mouse.setNativeCursor(cursor[mouse_btn]); } catch (Exception e) { e.printStackTrace(); } } - if(Keyboard.isKeyDown(Keyboard.KEY_SPACE)) { - Mouse.setGrabbed(!Mouse.isGrabbed()); - System.out.println("Grabbed: " + Mouse.isGrabbed()); - } + while(Keyboard.next()) { + if(Keyboard.getEventKey() == Keyboard.KEY_SPACE && Keyboard.getEventKeyState()) { + Mouse.setGrabbed(!Mouse.isGrabbed()); + //mouse_x = Mouse.getX(); + //mouse_y = Mouse.getY(); + } + } } /** * Cleans up the test */ private void cleanup() { - Keyboard.destroy(); try { Mouse.setNativeCursor(null); } catch (Exception e) { @@ -367,7 +362,6 @@ for(int i=0; i<cursor.length; i++) { cursor[i].destroy(); } - Mouse.destroy(); Display.resetDisplayMode(); Window.destroy(); } Index: MouseTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- MouseTest.java 12 Apr 2004 00:33:00 -0000 1.32 +++ MouseTest.java 12 Apr 2004 14:46:18 -0000 1.33 @@ -238,26 +238,31 @@ private void updateState() { direction = -1; + int dx = Mouse.getDX(); + int dy = Mouse.getDY(); + int dw = Mouse.getDWheel(); + + // get out if no movement - if (Mouse.getDX() == Mouse.getDY() && Mouse.getDX() == 0 && Mouse.getDWheel() == 0) { + if (dx == dy && dx == 0 && dw == 0) { return; } // determine direction moved // ============================ - if(Mouse.getDX() > 0) { + if(dx > 0) { direction = 3; } - if(Mouse.getDX() < 0) { + if(dx < 0) { direction = 1; } - if(Mouse.getDY() > 0) { + if(dy > 0) { direction = 0; } - if(Mouse.getDY() < 0) { + if(dy < 0) { direction = 2; } @@ -287,11 +292,11 @@ } // get direction to update in - if (Mouse.getDWheel() > 0) { + if (dw > 0) { lastScrollDirection++; - } else if (Mouse.getDWheel() < 0) { + } else if (dw < 0) { lastScrollDirection--; - } else if (Mouse.getDWheel() == 0) { + } else if (dw == 0) { return; } @@ -313,13 +318,16 @@ * Handles the keyboard */ private void handleKeyboard() { - // closing on ESCAPE - if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) { - closing = true; - } - if(Keyboard.isKeyDown(Keyboard.KEY_SPACE)) { - Mouse.setGrabbed(!Mouse.isGrabbed()); + while(Keyboard.next()) { + // closing on ESCAPE + if(Keyboard.getEventKey() == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState()) { + closing = true; + } + + if(Keyboard.getEventKey() == Keyboard.KEY_SPACE && Keyboard.getEventKeyState()) { + Mouse.setGrabbed(!Mouse.isGrabbed()); + } } } |
|
From: Brian M. <ma...@us...> - 2004-04-12 15:00:08
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4113/native/win32 Modified Files: org_lwjgl_input_Mouse.cpp Log Message: fixed mouse issues, setGrabbed & native cursor now works (afaik ;)) Index: org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- org_lwjgl_input_Mouse.cpp 12 Apr 2004 10:37:50 -0000 1.50 +++ org_lwjgl_input_Mouse.cpp 12 Apr 2004 14:46:18 -0000 1.51 @@ -227,32 +227,13 @@ SetClassLong(hwnd, GCL_HCURSOR, (LONG)cursor); SetCursor(cursor); if (!usingNativeCursor) { - mDIDevice->Unacquire(); - if(mDIDevice->SetCooperativeLevel(hwnd, DISCL_NONEXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { - throwException(env, "Could not set the CooperativeLevel."); - return; - } - /* Reset cursor position to middle of the window */ - RECT clientRect; - GetWindowRect(hwnd, &windowRect); - getScreenClientRect(&clientRect, &windowRect); - cursorPos.x = (clientRect.left + clientRect.right)/2; - cursorPos.y = clientRect.bottom - 1 - (clientRect.bottom - clientRect.top)/2; - SetCursorPos(cursorPos.x, cursorPos.y); usingNativeCursor = true; } } else { if (usingNativeCursor) { SetClassLong(hwnd, GCL_HCURSOR, (LONG)NULL); SetCursor(LoadCursor(NULL, IDC_ARROW)); - mDIDevice->Unacquire(); - if(mDIDevice->SetCooperativeLevel(hwnd, mouseMask) != DI_OK) { - throwException(env, "Could not set the CooperativeLevel."); - return; - } usingNativeCursor = false; - mDIDevice->Acquire(); - ShowCursor(TRUE); } } } @@ -308,8 +289,18 @@ if(grab) { mouseMask = DISCL_EXCLUSIVE | DISCL_FOREGROUND; + ShowCursor(false); } else { mouseMask = DISCL_NONEXCLUSIVE | DISCL_FOREGROUND; + ShowCursor(true); + + /* Reset cursor position to middle of the window */ + RECT clientRect; + GetWindowRect(hwnd, &windowRect); + getScreenClientRect(&clientRect, &windowRect); + cursorPos.x = (clientRect.left + clientRect.right)/2; + cursorPos.y = clientRect.bottom - 1 - (clientRect.bottom - clientRect.top)/2; + SetCursorPos(cursorPos.x, cursorPos.y); } mDIDevice->Unacquire(); if(mDIDevice->SetCooperativeLevel(hwnd, mouseMask) != DI_OK) { @@ -408,6 +399,14 @@ return; } mCreate_success = true; + + /* Reset cursor position to middle of the window */ + RECT clientRect; + GetWindowRect(hwnd, &windowRect); + getScreenClientRect(&clientRect, &windowRect); + cursorPos.x = (clientRect.left + clientRect.right)/2; + cursorPos.y = clientRect.bottom - 1 - (clientRect.bottom - clientRect.top)/2; + SetCursorPos(cursorPos.x, cursorPos.y); } static int cap(int val, int min, int max) { @@ -487,6 +486,7 @@ coords[0] = dx; coords[1] = dy; coords[2] = diMouseState.lZ; + for (int i = 0; i < mButtoncount; i++) { if (diMouseState.rgbButtons[i] != 0) { diMouseState.rgbButtons[i] = JNI_TRUE; |
|
From: Brian M. <ma...@us...> - 2004-04-12 15:00:08
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4113/java/org/lwjgl/input Modified Files: Mouse.java Log Message: fixed mouse issues, setGrabbed & native cursor now works (afaik ;)) Index: Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- Mouse.java 12 Apr 2004 07:13:36 -0000 1.52 +++ Mouse.java 12 Apr 2004 14:46:17 -0000 1.53 @@ -181,11 +181,10 @@ Cursor oldCursor = currentCursor; currentCursor = cursor; if (currentCursor != null) { - nSetNativeCursor(currentCursor.getHandle()); - currentCursor.setTimeout(); - x = Window.getWidth() / 2; - y = Window.getHeight() / 2; - isGrabbed = false; + if(currentCursor != oldCursor) { + nSetNativeCursor(currentCursor.getHandle()); + currentCursor.setTimeout(); + } } else { nSetNativeCursor(0); } @@ -255,7 +254,9 @@ created = true; currentCursor = null; dx = dy = dwheel = 0; - + x = Window.getWidth() / 2; + y = Window.getHeight() / 2; + // set mouse buttons buttonCount = nGetButtonCount(); buttons = BufferUtils.createByteBuffer(buttonCount); @@ -351,7 +352,7 @@ dx += poll_dx; dy += poll_dy; dwheel += poll_dwheel; - + // if window has been created, clamp to edges if (Window.isCreated()) { // clamp x, y @@ -551,14 +552,20 @@ * (and thus hidden). */ public static void setGrabbed(boolean grab) { - isGrabbed = grab; + isGrabbed = grab; nGrabMouse(isGrabbed); + + if(!grab) { + x = Window.getWidth() / 2; + y = Window.getHeight() / 2; + } } private static native void nGrabMouse(boolean grab); /** * Updates the cursor, so that animation can be changed if needed. - * This method is called automatically by the window on its update. + * This method is called automatically by the window on its update, and + * shouldn't be called otherwise */ public static void updateCursor() { if (Display.getPlatform() == Display.PLATFORM_WGL && currentCursor != null && currentCursor.hasTimedOut()) { |
|
From: Brian M. <ma...@us...> - 2004-04-12 14:51:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2279 Modified Files: Cursor.java Log Message: removed resetAnimation Index: Cursor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- Cursor.java 12 Apr 2004 10:05:13 -0000 1.23 +++ Cursor.java 12 Apr 2004 14:37:20 -0000 1.24 @@ -207,13 +207,6 @@ protected void nextCursor() { index = ++index % cursors.length; } - - /** - * Resets the index of the cursor animation to the first in the list. - */ - public void resetAnimation() { - index = 0; - } /** * Native method to create a native cursor |
|
From: Elias N. <eli...@us...> - 2004-04-12 14:43:45
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv833/linux Modified Files: org_lwjgl_opengl_Window.cpp Log Message: LINUX: Turn off keyboard repeat rate at Window.create too Index: org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- org_lwjgl_opengl_Window.cpp 12 Apr 2004 12:20:59 -0000 1.39 +++ org_lwjgl_opengl_Window.cpp 12 Apr 2004 14:29:55 -0000 1.40 @@ -276,6 +276,7 @@ XMapRaised(getDisplay(), win); waitMapped(win); XClearWindow(getDisplay(), win); + setRepeatMode(AutoRepeatModeOff); XSync(getDisplay(), True); } |
|
From: Elias N. <eli...@us...> - 2004-04-12 12:34:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8883/linux Modified Files: Window.h org_lwjgl_input_Mouse.cpp org_lwjgl_opengl_Window.cpp Log Message: LINUX: Fixed warp ignores Index: org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- org_lwjgl_input_Mouse.cpp 12 Apr 2004 10:33:39 -0000 1.50 +++ org_lwjgl_input_Mouse.cpp 12 Apr 2004 12:20:59 -0000 1.51 @@ -93,8 +93,8 @@ setCursorPos(x, y); } -static void centerCursor() { - transformCursorPos(getWindowWidth()/2, getWindowHeight()/2); +void resetCursor(int x, int y) { + transformCursorPos(x, y); last_x = current_x; last_y = current_y; } @@ -161,18 +161,18 @@ } static void doWarpPointer(void ) { -// int i; XEvent ignore_warp_guard; ignore_warp_guard.type = MotionNotify; - ignore_warp_guard.xmotion.state = 1; // Tell event loop to start ignoring motion events - centerCursor(); + // Tell event loop to start ignoring motion events + ignore_warp_guard.xmotion.state = 1; XSendEvent(getDisplay(), getCurrentWindow(), False, 0, &ignore_warp_guard); - XWarpPointer(getDisplay(), None, getCurrentWindow(), 0, 0, 0, 0, current_x, current_y); - ignore_warp_guard.xmotion.state = 0; // Tell event loop to stop ignoring motion events + XWarpPointer(getDisplay(), None, getCurrentWindow(), 0, 0, 0, 0, getWindowWidth()/2, getWindowHeight()/2); + // Tell event loop to stop ignoring motion events + ignore_warp_guard.xmotion.state = 0; XSendEvent(getDisplay(), getCurrentWindow(), False, 0, &ignore_warp_guard); - centerCursor(); -/* XWarpPointer(getDisplay(), None, getCurrentWindow(), 0, 0, 0, 0, current_x, current_y); +/* centerCursor(); + XWarpPointer(getDisplay(), None, getCurrentWindow(), 0, 0, 0, 0, current_x, current_y); XEvent event; // Try to catch the warp pointer event for (i = 0; i < WARP_RETRY; i++) { Index: org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- org_lwjgl_opengl_Window.cpp 12 Apr 2004 10:33:39 -0000 1.38 +++ org_lwjgl_opengl_Window.cpp 12 Apr 2004 12:20:59 -0000 1.39 @@ -157,8 +157,11 @@ if (event->send_event == True) { // We got a warp ignore message ignore_motion_events = event->state == 1 ? true : false; - } else if (!ignore_motion_events) + } else if (ignore_motion_events) { + resetCursor(event->x, event->y); + } else { handlePointerMotion(event); + } } static void handleMessages() { @@ -418,7 +421,7 @@ glXGetConfig(getDisplay(), vis_info, GLX_SAMPLE_BUFFERS_ARB, &sample_buffers); glXGetConfig(getDisplay(), vis_info, GLX_SAMPLES_ARB, &samples); } - printf("Pixel format info: r = %d, g = %d, b = %d, a = %d, depth = %d, stencil = %d, sample buffers = %d, samples = %d\n", r, g, b, alpha, depth, stencil, sample_buffers, samples); + printfDebug("Pixel format info: r = %d, g = %d, b = %d, a = %d, depth = %d, stencil = %d, sample buffers = %d, samples = %d\n", r, g, b, alpha, depth, stencil, sample_buffers, samples); } static void destroy(void) { Index: Window.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Window.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Window.h 12 Apr 2004 10:05:13 -0000 1.9 +++ Window.h 12 Apr 2004 12:20:59 -0000 1.10 @@ -54,6 +54,8 @@ */ extern bool releaseInput(void); + extern void resetCursor(int x, int y); + /* * Various functions to release/acquire keyboard and mouse */ |
|
From: Brian M. <ma...@us...> - 2004-04-12 10:51:38
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23752 Modified Files: org_lwjgl_input_Mouse.cpp Log Message: removed restriction about native cursors, and fixed mouse not showing on setNativeCursor(null); Index: org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- org_lwjgl_input_Mouse.cpp 12 Apr 2004 00:33:01 -0000 1.49 +++ org_lwjgl_input_Mouse.cpp 12 Apr 2004 10:37:50 -0000 1.50 @@ -244,8 +244,7 @@ } else { if (usingNativeCursor) { SetClassLong(hwnd, GCL_HCURSOR, (LONG)NULL); - SetCursor(NULL); - ShowCursor(TRUE); + SetCursor(LoadCursor(NULL, IDC_ARROW)); mDIDevice->Unacquire(); if(mDIDevice->SetCooperativeLevel(hwnd, mouseMask) != DI_OK) { throwException(env, "Could not set the CooperativeLevel."); @@ -253,6 +252,7 @@ } usingNativeCursor = false; mDIDevice->Acquire(); + ShowCursor(TRUE); } } } @@ -305,9 +305,6 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nGrabMouse (JNIEnv * env, jclass clazz, jboolean grab) { - if(usingNativeCursor) { - return; - } if(grab) { mouseMask = DISCL_EXCLUSIVE | DISCL_FOREGROUND; |
|
From: Elias N. <eli...@us...> - 2004-04-12 10:47:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23132/linux Modified Files: org_lwjgl_input_Mouse.cpp org_lwjgl_opengl_Window.cpp Log Message: LINUX:Improved warp event ignore Index: org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- org_lwjgl_input_Mouse.cpp 12 Apr 2004 10:05:13 -0000 1.49 +++ org_lwjgl_input_Mouse.cpp 12 Apr 2004 10:33:39 -0000 1.50 @@ -161,9 +161,18 @@ } static void doWarpPointer(void ) { - int i; +// int i; + XEvent ignore_warp_guard; + ignore_warp_guard.type = MotionNotify; + ignore_warp_guard.xmotion.state = 1; // Tell event loop to start ignoring motion events centerCursor(); + XSendEvent(getDisplay(), getCurrentWindow(), False, 0, &ignore_warp_guard); XWarpPointer(getDisplay(), None, getCurrentWindow(), 0, 0, 0, 0, current_x, current_y); + ignore_warp_guard.xmotion.state = 0; // Tell event loop to stop ignoring motion events + XSendEvent(getDisplay(), getCurrentWindow(), False, 0, &ignore_warp_guard); + + centerCursor(); +/* XWarpPointer(getDisplay(), None, getCurrentWindow(), 0, 0, 0, 0, current_x, current_y); XEvent event; // Try to catch the warp pointer event for (i = 0; i < WARP_RETRY; i++) { @@ -176,7 +185,7 @@ printfDebug("Skipped event searching for warp event %d, %d\n", event.xmotion.x, event.xmotion.y); } if (i == WARP_RETRY) - printfDebug("Never got warp event\n"); + printfDebug("Never got warp event\n");*/ } static void warpPointer(void) { Index: org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- org_lwjgl_opengl_Window.cpp 12 Apr 2004 10:05:13 -0000 1.37 +++ org_lwjgl_opengl_Window.cpp 12 Apr 2004 10:33:39 -0000 1.38 @@ -73,6 +73,7 @@ static bool focused; static bool closerequested; static bool grab; +static bool ignore_motion_events; static Display *display_connection = NULL; static int display_connection_usage = 0; @@ -152,6 +153,14 @@ updateInputGrab(); } +static void handleMotion(XMotionEvent *event) { + if (event->send_event == True) { + // We got a warp ignore message + ignore_motion_events = event->state == 1 ? true : false; + } else if (!ignore_motion_events) + handlePointerMotion(event); +} + static void handleMessages() { XEvent event; Window win; @@ -194,7 +203,7 @@ handleButtonRelease(&(event.xbutton)); break; case MotionNotify: - handlePointerMotion(&(event.xmotion)); + handleMotion(&(event.xmotion)); break; case KeyPress: case KeyRelease: @@ -223,6 +232,7 @@ closerequested = false; vsync_enabled = false; grab = false; + ignore_motion_events = false; Window root_win; Window win; XSetWindowAttributes attribs; |
|
From: Elias N. <eli...@us...> - 2004-04-12 10:19:02
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18655/native/linux Modified Files: Window.h org_lwjgl_input_Keyboard.cpp org_lwjgl_input_Mouse.cpp org_lwjgl_opengl_Window.cpp Log Message: LINUX: Implemented setGrabbed Index: org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- org_lwjgl_input_Mouse.cpp 12 Apr 2004 00:33:01 -0000 1.48 +++ org_lwjgl_input_Mouse.cpp 12 Apr 2004 10:05:13 -0000 1.49 @@ -57,10 +57,8 @@ // scale the mouse wheel according to win32 #define WHEEL_SCALE 120 -static bool pointer_grabbed = false; -static bool created = false; -static bool should_grab = false; -static bool native_cursor = false; +static bool pointer_grabbed; +static bool created; static int last_x; static int last_y; @@ -119,23 +117,26 @@ return true; } -bool isNativeCursor(void) { - return native_cursor; +static void updateCursor(void) { + Cursor cursor; + if (isGrabbed()) + cursor = blank_cursor; + else + cursor = current_cursor; + XDefineCursor(getDisplay(), getCurrentWindow(), cursor); } static void grabPointer(void) { - if (isFullscreen() || !native_cursor) { - if (!pointer_grabbed) { - int result; - int grab_mask = PointerMotionMask | ButtonPressMask | ButtonReleaseMask; - result = XGrabPointer(getDisplay(), getCurrentWindow(), False, grab_mask, GrabModeAsync, - GrabModeAsync, getCurrentWindow(), current_cursor, CurrentTime); - if (result == GrabSuccess) { - pointer_grabbed = true; - // make sure we have a centered window - XF86VidModeSetViewPort(getDisplay(), getCurrentScreen(), 0, 0); - XFlush(getDisplay()); - } + if (!pointer_grabbed) { + int result; + int grab_mask = PointerMotionMask | ButtonPressMask | ButtonReleaseMask; + result = XGrabPointer(getDisplay(), getCurrentWindow(), False, grab_mask, GrabModeAsync, + GrabModeAsync, getCurrentWindow(), None, CurrentTime); + if (result == GrabSuccess) { + pointer_grabbed = true; + // make sure we have a centered window + XF86VidModeSetViewPort(getDisplay(), getCurrentScreen(), 0, 0); + XFlush(getDisplay()); } } } @@ -148,24 +149,15 @@ } } -static void updateGrab(void) { +void updatePointerGrab(void) { if (!created) return; - if (should_grab) { + if (shouldGrab()) { grabPointer(); } else { ungrabPointer(); } -} - -void acquirePointer(void) { - should_grab = true; - updateGrab(); -} - -void releasePointer(void) { - should_grab = false; - updateGrab(); + updateCursor(); } static void doWarpPointer(void ) { @@ -188,7 +180,7 @@ } static void warpPointer(void) { - if (!pointer_grabbed || native_cursor) + if (!pointer_grabbed || !isGrabbed()) return; // Reset pointer to middle of screen if outside a certain inner border if (current_x < POINTER_WARP_BORDER || current_y < POINTER_WARP_BORDER || @@ -196,11 +188,6 @@ doWarpPointer(); } -/* - * Class: org_lwjgl_input_Mouse - * Method: nIsNativeCursorSupported - * Signature: ()Z - */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetNativeCursorCaps (JNIEnv *env, jclass clazz) { int caps = 0; @@ -215,38 +202,15 @@ return caps; } -/* - * Class: org_lwjgl_input_Mouse - * Method: nSetNativeCursor - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nSetNativeCursor - (JNIEnv *env, jclass clazz, jlong cursor_handle) -{ +JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nSetNativeCursor (JNIEnv *env, jclass clazz, jlong cursor_handle) { if (cursor_handle != 0) { Cursor cursor = (Cursor)cursor_handle; - if (!native_cursor) { - doWarpPointer(); - native_cursor = true; - } - XDefineCursor(getDisplay(), getCurrentWindow(), cursor); current_cursor = cursor; - updateInput(); - } else { - if (native_cursor) { - current_cursor = blank_cursor; - XUndefineCursor(getDisplay(), getCurrentWindow()); - native_cursor = false; - updateInput(); - } - } + } else + current_cursor = None; + updateCursor(); } -/* - * Class: org_lwjgl_input_Mouse - * Method: nGetMaxCursorSize - * Signature: ()I - */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetMinCursorSize (JNIEnv *env, jclass clazz) { @@ -256,11 +220,6 @@ return width_return > height_return ? width_return : height_return; } -/* - * Class: org_lwjgl_input_Mouse - * Method: nGetMaxCursorSize - * Signature: ()I - */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetMaxCursorSize (JNIEnv *env, jclass clazz) { @@ -292,13 +251,11 @@ throwException(env, "Could not create blank cursor"); return; } - current_cursor = blank_cursor; - native_cursor = false; + current_cursor = None; created = true; - should_grab = true; pointer_grabbed = false; buffer_enabled = false; - updateGrab(); + updatePointerGrab(); initEventQueue(&event_queue); loadXcursor(); doWarpPointer(); @@ -311,7 +268,6 @@ ungrabPointer(); XFreeCursor(getDisplay(), blank_cursor); created = false; - should_grab = false; decDisplay(); } @@ -339,29 +295,24 @@ } void handleButtonPress(XButtonEvent *event) { - if (pointer_grabbed || native_cursor) { - switch (event->button) { - case Button4: - current_z += WHEEL_SCALE; - break; - case Button5: - current_z -= WHEEL_SCALE; - break; - default: break; - } - handleButton(event, 1); + switch (event->button) { + case Button4: + current_z += WHEEL_SCALE; + break; + case Button5: + current_z -= WHEEL_SCALE; + break; + default: break; } + handleButton(event, 1); } void handleButtonRelease(XButtonEvent *event) { - if (pointer_grabbed || native_cursor) { - handleButton(event, 0); - } + handleButton(event, 0); } void handlePointerMotion(XMotionEvent *event) { - if (pointer_grabbed || native_cursor) - setCursorPos(event->x, event->y); + setCursorPos(event->x, event->y); } JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nPoll(JNIEnv * env, jclass clazz, jobject coord_buffer_obj, jobject button_buffer_obj) { @@ -400,16 +351,8 @@ return copyEvents(&event_queue, buffer_ptr + buffer_position, buffer_size, 2); } -/* - * Class: org_lwjgl_input_Mouse - * Method: nGrabMouse - * Signature: (Z)Z - */ -JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nGrabMouse - (JNIEnv * env, jclass clazz, jboolean grab) { - if(native_cursor) { - return; - } - - // do it? -} \ No newline at end of file +JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nGrabMouse(JNIEnv * env, jclass clazz, jboolean new_grab) { + setGrab(new_grab == JNI_TRUE ? true : false); + if (created) + doWarpPointer(); +} Index: org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- org_lwjgl_opengl_Window.cpp 7 Apr 2004 07:46:03 -0000 1.36 +++ org_lwjgl_opengl_Window.cpp 12 Apr 2004 10:05:13 -0000 1.37 @@ -72,6 +72,7 @@ static bool minimized; static bool focused; static bool closerequested; +static bool grab; static Display *display_connection = NULL; static int display_connection_usage = 0; @@ -106,38 +107,51 @@ } while ((event.type != MapNotify) || (event.xmap.event != win)); } -static void acquireInput(void) { - if (input_released) { - acquireKeyboard(); - acquirePointer(); - input_released = false; - } -} - -static void doReleaseInput(void) { - releaseKeyboard(); - releasePointer(); - input_released = true; +static void updateInputGrab(void) { + updatePointerGrab(); + updateKeyboardGrab(); } -void updateInput(void) { - if (!input_released) { - doReleaseInput(); - acquireInput(); - } +static void setRepeatMode(int mode) { + XKeyboardControl repeat_mode; + repeat_mode.auto_repeat_mode = mode; + XChangeKeyboardControl(getDisplay(), KBAutoRepeatMode, &repeat_mode); } bool releaseInput(void) { if (current_fullscreen || input_released) return false; - doReleaseInput(); + input_released = true; + setRepeatMode(AutoRepeatModeDefault); + updateInputGrab(); return true; } +static void acquireInput(void) { + if (current_fullscreen || !input_released) + return; + input_released = false; + setRepeatMode(AutoRepeatModeOff); + updateInputGrab(); +} + bool isFullscreen(void) { return current_fullscreen; } +bool isGrabbed(void) { + return grab; +} + +bool shouldGrab(void) { + return current_fullscreen || (!input_released && grab); +} + +void setGrab(bool new_grab) { + grab = new_grab; + updateInputGrab(); +} + static void handleMessages() { XEvent event; Window win; @@ -208,6 +222,7 @@ minimized = false; closerequested = false; vsync_enabled = false; + grab = false; Window root_win; Window win; XSetWindowAttributes attribs; @@ -403,6 +418,7 @@ glXDestroyContext(getDisplay(), context); context = NULL; destroyWindow(); + setRepeatMode(AutoRepeatModeDefault); decDisplay(); extgl_Close(); } Index: org_lwjgl_input_Keyboard.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- org_lwjgl_input_Keyboard.cpp 7 Apr 2004 07:48:36 -0000 1.32 +++ org_lwjgl_input_Keyboard.cpp 12 Apr 2004 10:05:13 -0000 1.33 @@ -61,57 +61,32 @@ static bool buffer_enabled; static bool translation_enabled; static bool created = false; -static bool should_grab = false; - -static void setRepeatMode(int mode) { - XKeyboardControl repeat_mode; - repeat_mode.auto_repeat_mode = mode; - XChangeKeyboardControl(getDisplay(), KBAutoRepeatMode, &repeat_mode); -} static void grabKeyboard(void) { - if (isFullscreen() || !isNativeCursor()) { - if (!keyboard_grabbed) { - int result = XGrabKeyboard(getDisplay(), getCurrentWindow(), False, GrabModeAsync, GrabModeAsync, CurrentTime); - if (result == GrabSuccess) { - keyboard_grabbed = true; - setRepeatMode(AutoRepeatModeOff); - XFlush(getDisplay()); - } - } - } else - setRepeatMode(AutoRepeatModeOff); + if (!keyboard_grabbed) { + int result = XGrabKeyboard(getDisplay(), getCurrentWindow(), False, GrabModeAsync, GrabModeAsync, CurrentTime); + if (result == GrabSuccess) + keyboard_grabbed = true; + } } static void ungrabKeyboard(void) { if (keyboard_grabbed) { keyboard_grabbed = false; XUngrabKeyboard(getDisplay(), CurrentTime); - XFlush(getDisplay()); } - setRepeatMode(AutoRepeatModeDefault); } -static void updateGrab(void) { +void updateKeyboardGrab(void) { if (!created) return; - if (should_grab) { + if (shouldGrab()) { grabKeyboard(); } else { ungrabKeyboard(); } } -void acquireKeyboard(void) { - should_grab = true; - updateGrab(); -} - -void releaseKeyboard(void) { - should_grab = false; - updateGrab(); -} - /* * Class: org_lwjgl_input_Keyboard * Method: nCreate @@ -149,9 +124,8 @@ keyboard_grabbed = false; translation_enabled = false; buffer_enabled = false; - should_grab = true; initEventQueue(&event_queue); - updateGrab(); + updateKeyboardGrab(); } /* Index: Window.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Window.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Window.h 7 Apr 2004 07:46:03 -0000 1.8 +++ Window.h 12 Apr 2004 10:05:13 -0000 1.9 @@ -50,11 +50,6 @@ #include "extgl_glx.h" /* - * update input grabbing(keyboard, mouse) - */ - extern void updateInput(void); - - /* * release input (keyboard, mouse) */ extern bool releaseInput(void); @@ -66,10 +61,11 @@ extern void handleButtonPress(XButtonEvent *); extern void handleButtonRelease(XButtonEvent *); extern void handleKeyEvent(XKeyEvent *); - extern void releaseKeyboard(void); - extern void releasePointer(void); - extern void acquireKeyboard(void); - extern void acquirePointer(void); + extern void updatePointerGrab(void); + extern void updateKeyboardGrab(void); + extern void setGrab(bool); + extern bool shouldGrab(void); + extern bool isGrabbed(void); /* * get the current window width @@ -110,11 +106,6 @@ extern Window getCurrentWindow(void); /* - * Return true if a native cursor is active - */ - extern bool isNativeCursor(void); - - /* * Return true if we are in fullscreen mode */ extern bool isFullscreen(void); |
|
From: Elias N. <eli...@us...> - 2004-04-12 10:19:01
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18655/java/org/lwjgl/input Modified Files: Cursor.java Log Message: LINUX: Implemented setGrabbed Index: Cursor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Cursor.java 12 Apr 2004 07:20:01 -0000 1.22 +++ Cursor.java 12 Apr 2004 10:05:13 -0000 1.23 @@ -55,7 +55,7 @@ private CursorElement[] cursors = null; /** Index into list of cursors */ - private int index = -1; + private int index = 0; /** * Constructs a new Cursor, with the given parameters. Mouse must have been created before you can create @@ -127,8 +127,6 @@ // offset to next image images_copy.position(width*height*(i+1)); } - // set index - index = 0; break; case Display.PLATFORM_AGL: break; |
|
From: Elias N. <eli...@us...> - 2004-04-12 07:33:47
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24740 Modified Files: Cursor.java Log Message: Cursor.java:Fixed case where delays == null Index: Cursor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Cursor.java 12 Apr 2004 00:33:00 -0000 1.21 +++ Cursor.java 12 Apr 2004 07:20:01 -0000 1.22 @@ -101,38 +101,38 @@ IntBuffer images_copy = ByteBuffer.allocateDirect(images.remaining()*4).order(ByteOrder.nativeOrder()).asIntBuffer(); flipImages(width, height, numImages, images, images_copy); - // Win32 doesn't (afaik) allow for animation based cursors, except when they're - // in the .ani format, which we don't support. - // The cursor animation was therefor developed using java side time tracking. - // unfortunately X flickers when changing cursor. We therefor check for either - // Win32 or X and do accordingly. This hasn't been implemented on Mac, but we - // might want to split it into a X/Win/Mac cursor if it gets too cluttered - - switch(Display.getPlatform()) { - case Display.PLATFORM_GLX: - // create our cursor elements - cursors = new CursorElement[1]; - cursors[0] = new CursorElement(); - cursors[0].cursorHandle = nCreateCursor(width, height, xHotspot, yHotspot, numImages, images_copy, images_copy.position(), delays, delays.position()); - break; - case Display.PLATFORM_WGL: - // create our cursor elements - cursors = new CursorElement[numImages]; - for(int i=0; i<numImages; i++) { - cursors[i] = new CursorElement(); - cursors[i].cursorHandle = nCreateCursor(width, height, xHotspot, yHotspot, 1, images_copy, images_copy.position(), null, 0); - cursors[i].delay = (delays != null) ? delays.get(i) : 0; - cursors[i].timeout = System.currentTimeMillis(); - - // offset to next image - images_copy.position(width*height*(i+1)); - } - // set index - index = 0; - break; - case Display.PLATFORM_AGL: - break; - } + // Win32 doesn't (afaik) allow for animation based cursors, except when they're + // in the .ani format, which we don't support. + // The cursor animation was therefor developed using java side time tracking. + // unfortunately X flickers when changing cursor. We therefore check for either + // Win32 or X and do accordingly. This hasn't been implemented on Mac, but we + // might want to split it into a X/Win/Mac cursor if it gets too cluttered + + switch(Display.getPlatform()) { + case Display.PLATFORM_GLX: + // create our cursor elements + cursors = new CursorElement[1]; + cursors[0] = new CursorElement(); + cursors[0].cursorHandle = nCreateCursor(width, height, xHotspot, yHotspot, numImages, images_copy, images_copy.position(), delays, delays != null ? delays.position() : -1); + break; + case Display.PLATFORM_WGL: + // create our cursor elements + cursors = new CursorElement[numImages]; + for(int i=0; i<numImages; i++) { + cursors[i] = new CursorElement(); + cursors[i].cursorHandle = nCreateCursor(width, height, xHotspot, yHotspot, 1, images_copy, images_copy.position(), null, 0); + cursors[i].delay = (delays != null) ? delays.get(i) : 0; + cursors[i].timeout = System.currentTimeMillis(); + + // offset to next image + images_copy.position(width*height*(i+1)); + } + // set index + index = 0; + break; + case Display.PLATFORM_AGL: + break; + } } /** |
|
From: Elias N. <eli...@us...> - 2004-04-12 07:27:25
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23564/src/java/org/lwjgl/input Modified Files: Mouse.java Log Message: Reverted the relative coordinate 'bug' - that's the required behaviour when Window.update is calling Mouse.poll. Consider the case where we call Window.update twice before checking getD*: with the old behaviour, only the deltas between the updates are reported, not those before the first update Index: Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- Mouse.java 12 Apr 2004 00:33:00 -0000 1.51 +++ Mouse.java 12 Apr 2004 07:13:36 -0000 1.52 @@ -348,9 +348,9 @@ // set absolute position x += poll_dx; y += poll_dy; - dx = poll_dx; - dy = poll_dy; - dwheel = poll_dwheel; + dx += poll_dx; + dy += poll_dy; + dwheel += poll_dwheel; // if window has been created, clamp to edges if (Window.isCreated()) { @@ -502,21 +502,27 @@ * @return Movement on the x axis since last time getDX() was called */ public static int getDX() { - return dx; + int result = dx; + dx = 0; + return result; } /** * @return Movement on the y axis since last time getDY() was called */ public static int getDY() { - return dy; + int result = dy; + dy = 0; + return result; } /** * @return Movement of the wheel since last time getDWheel() was called */ public static int getDWheel() { - return dwheel; + int result = dwheel; + dwheel = 0; + return result; } /** @@ -564,4 +570,4 @@ } } } -} \ No newline at end of file +} |
|
From: Brian M. <ma...@us...> - 2004-04-12 00:46:45
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32083/native/win32 Modified Files: org_lwjgl_input_Cursor.cpp org_lwjgl_input_Mouse.cpp Log Message: reworked animated native cursors, to use X animation when required added initial setGrabbed(boolean) feature - Work in progress both needs verification on linux Index: org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- org_lwjgl_input_Mouse.cpp 6 Apr 2004 14:40:36 -0000 1.48 +++ org_lwjgl_input_Mouse.cpp 12 Apr 2004 00:33:01 -0000 1.49 @@ -57,6 +57,7 @@ static POINT cursorPos; static RECT windowRect; static bool usingNativeCursor; +static int mouseMask = DISCL_NONEXCLUSIVE | DISCL_FOREGROUND; // Function prototypes (defined in the cpp file, since header file is generic across platforms void EnumerateMouseCapabilities(); @@ -97,8 +98,6 @@ return; } - ShowCursor(FALSE); - /* skip enumeration, since we only want system mouse */ CreateMouse(); @@ -240,19 +239,18 @@ cursorPos.x = (clientRect.left + clientRect.right)/2; cursorPos.y = clientRect.bottom - 1 - (clientRect.bottom - clientRect.top)/2; SetCursorPos(cursorPos.x, cursorPos.y); - ShowCursor(TRUE); usingNativeCursor = true; } } else { if (usingNativeCursor) { SetClassLong(hwnd, GCL_HCURSOR, (LONG)NULL); SetCursor(NULL); + ShowCursor(TRUE); mDIDevice->Unacquire(); - if(mDIDevice->SetCooperativeLevel(hwnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { + if(mDIDevice->SetCooperativeLevel(hwnd, mouseMask) != DI_OK) { throwException(env, "Could not set the CooperativeLevel."); return; } - ShowCursor(FALSE); usingNativeCursor = false; mDIDevice->Acquire(); } @@ -287,12 +285,11 @@ * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nDestroy(JNIEnv *env, jclass clazz) { - ShowCursor(TRUE); ShutdownMouse(); } /* - * Class: org_lwjgl_input_Controller + * Class: org_lwjgl_input_Mouse * Method: nPoll * Signature: ()V */ @@ -301,6 +298,30 @@ UpdateMouseFields(env, clazz, coord_buffer_obj, button_buffer_obj); } +/* + * Class: org_lwjgl_input_Mouse + * Method: nGrabMouse + * Signature: (Z)Z + */ +JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nGrabMouse + (JNIEnv * env, jclass clazz, jboolean grab) { + if(usingNativeCursor) { + return; + } + + if(grab) { + mouseMask = DISCL_EXCLUSIVE | DISCL_FOREGROUND; + } else { + mouseMask = DISCL_NONEXCLUSIVE | DISCL_FOREGROUND; + } + mDIDevice->Unacquire(); + if(mDIDevice->SetCooperativeLevel(hwnd, mouseMask) != DI_OK) { + throwException(env, "Could not set the CooperativeLevel."); + return; + } + mDIDevice->Acquire(); +} + /** * Shutdown DI */ @@ -384,7 +405,7 @@ mDIDevice->SetProperty(DIPROP_BUFFERSIZE, &dipropdw.diph); // set the cooperative level - if(mDIDevice->SetCooperativeLevel(hwnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { + if(mDIDevice->SetCooperativeLevel(hwnd, mouseMask) != DI_OK) { printfDebug("SetCooperativeLevel failed\n"); mCreate_success = false; return; Index: org_lwjgl_input_Cursor.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Cursor.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- org_lwjgl_input_Cursor.cpp 21 Mar 2004 21:54:57 -0000 1.9 +++ org_lwjgl_input_Cursor.cpp 12 Apr 2004 00:33:01 -0000 1.10 @@ -50,7 +50,7 @@ * Signature: (IIIIIIIII)I */ JNIEXPORT jlong JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor - (JNIEnv *env, jclass clazz, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset) + (JNIEnv *env, jclass clazz, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) { int *pixels = (int *)env->GetDirectBufferAddress(image_buffer) + images_offset; |
|
From: Brian M. <ma...@us...> - 2004-04-12 00:46:45
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32083/native/macosx Modified Files: org_lwjgl_input_Cursor.cpp org_lwjgl_input_Mouse.cpp Log Message: reworked animated native cursors, to use X animation when required added initial setGrabbed(boolean) feature - Work in progress both needs verification on linux Index: org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- org_lwjgl_input_Mouse.cpp 6 Apr 2004 14:23:18 -0000 1.26 +++ org_lwjgl_input_Mouse.cpp 12 Apr 2004 00:33:01 -0000 1.27 @@ -257,3 +257,13 @@ int buffer_size = env->GetDirectBufferCapacity(buffer) - buffer_position; return copyEvents(&event_queue, buffer_ptr + buffer_position, buffer_size, 2); } + +/* + * Class: org_lwjgl_input_Mouse + * Method: nGrabMouse + * Signature: (Z)Z + */ +JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nGrabMouse + (JNIEnv * env, jclass clazz, jboolean grab) { + // do it? +} \ No newline at end of file Index: org_lwjgl_input_Cursor.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Cursor.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_input_Cursor.cpp 21 Mar 2004 21:54:56 -0000 1.2 +++ org_lwjgl_input_Cursor.cpp 12 Apr 2004 00:33:01 -0000 1.3 @@ -41,7 +41,7 @@ #include "org_lwjgl_input_Cursor.h" -JNIEXPORT jlong JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor(JNIEnv *env, jclass clazz, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset) { +JNIEXPORT jlong JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor(JNIEnv *env, jclass clazz, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) { } JNIEXPORT void JNICALL Java_org_lwjgl_input_Cursor_nDestroyCursor(JNIEnv *env, jclass clazz, jlong cursor_handle) { |
|
From: Brian M. <ma...@us...> - 2004-04-12 00:46:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32083/java/org/lwjgl/test/input Modified Files: HWCursorTest.java MouseTest.java Log Message: reworked animated native cursors, to use X animation when required added initial setGrabbed(boolean) feature - Work in progress both needs verification on linux Index: HWCursorTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/HWCursorTest.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- HWCursorTest.java 4 Apr 2004 12:48:52 -0000 1.30 +++ HWCursorTest.java 12 Apr 2004 00:33:00 -0000 1.31 @@ -346,6 +346,11 @@ e.printStackTrace(); } } + + if(Keyboard.isKeyDown(Keyboard.KEY_SPACE)) { + Mouse.setGrabbed(!Mouse.isGrabbed()); + System.out.println("Grabbed: " + Mouse.isGrabbed()); + } } /** Index: MouseTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- MouseTest.java 4 Apr 2004 12:49:09 -0000 1.31 +++ MouseTest.java 12 Apr 2004 00:33:00 -0000 1.32 @@ -242,6 +242,7 @@ if (Mouse.getDX() == Mouse.getDY() && Mouse.getDX() == 0 && Mouse.getDWheel() == 0) { return; } + // determine direction moved // ============================ if(Mouse.getDX() > 0) { @@ -259,8 +260,8 @@ if(Mouse.getDY() < 0) { direction = 2; } - // ---------------------------- + // ---------------------------- if(direction > -1) { // based on which button was last pushed, update model @@ -316,6 +317,10 @@ if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) { closing = true; } + + if(Keyboard.isKeyDown(Keyboard.KEY_SPACE)) { + Mouse.setGrabbed(!Mouse.isGrabbed()); + } } /** |
|
From: Brian M. <ma...@us...> - 2004-04-12 00:46:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32083/native/linux Modified Files: org_lwjgl_input_Cursor.cpp org_lwjgl_input_Mouse.cpp Log Message: reworked animated native cursors, to use X animation when required added initial setGrabbed(boolean) feature - Work in progress both needs verification on linux Index: org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- org_lwjgl_input_Mouse.cpp 7 Apr 2004 07:46:03 -0000 1.47 +++ org_lwjgl_input_Mouse.cpp 12 Apr 2004 00:33:01 -0000 1.48 @@ -399,3 +399,17 @@ int buffer_size = env->GetDirectBufferCapacity(buffer) - buffer_position; return copyEvents(&event_queue, buffer_ptr + buffer_position, buffer_size, 2); } + +/* + * Class: org_lwjgl_input_Mouse + * Method: nGrabMouse + * Signature: (Z)Z + */ +JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nGrabMouse + (JNIEnv * env, jclass clazz, jboolean grab) { + if(native_cursor) { + return; + } + + // do it? +} \ No newline at end of file Index: org_lwjgl_input_Cursor.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Cursor.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- org_lwjgl_input_Cursor.cpp 7 Apr 2004 07:46:03 -0000 1.9 +++ org_lwjgl_input_Cursor.cpp 12 Apr 2004 00:33:00 -0000 1.10 @@ -50,11 +50,14 @@ * Signature: (IIIIIII)I */ JNIEXPORT jlong JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor - (JNIEnv *env, jclass clazz, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset) + (JNIEnv *env, jclass clazz, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) { Display *disp = incDisplay(env); if (disp == NULL) return 0; + const int *delays = NULL; + if (delay_buffer != NULL) + delays = (const int *)env->GetDirectBufferAddress(delay_buffer) + delays_offset; XcursorPixel *pixels = (XcursorPixel *)env->GetDirectBufferAddress(image_buffer) + images_offset; int stride = width*height; XcursorImages *cursor_images = XcursorImagesCreate(num_images); @@ -66,6 +69,8 @@ cursor_image->xhot = x_hotspot; cursor_image->yhot = y_hotspot; cursor_image->pixels = &(pixels[stride*i]); + if (num_images > 1) + cursor_image->delay = delays[i]; cursor_images->images[i] = cursor_image; } Cursor cursor = XcursorImagesLoadCursor(disp, cursor_images); |
|
From: Brian M. <ma...@us...> - 2004-04-12 00:46:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32083/java/org/lwjgl/input Modified Files: Cursor.java Mouse.java Log Message: reworked animated native cursors, to use X animation when required added initial setGrabbed(boolean) feature - Work in progress both needs verification on linux Index: Cursor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- Cursor.java 27 Mar 2004 15:05:22 -0000 1.20 +++ Cursor.java 12 Apr 2004 00:33:00 -0000 1.21 @@ -36,6 +36,7 @@ import java.nio.ByteOrder; import java.nio.IntBuffer; +import org.lwjgl.Display; import org.lwjgl.Sys; import org.lwjgl.LWJGLException; @@ -100,22 +101,39 @@ IntBuffer images_copy = ByteBuffer.allocateDirect(images.remaining()*4).order(ByteOrder.nativeOrder()).asIntBuffer(); flipImages(width, height, numImages, images, images_copy); - // create our cursor elements - cursors = new CursorElement[numImages]; - for(int i=0; i<numImages; i++) { - cursors[i] = new CursorElement(); - cursors[i].cursorHandle = nCreateCursor(width, height, xHotspot, yHotspot, 1, images_copy, images_copy.position()); - cursors[i].delay = (delays != null) ? delays.get(i) : 0; - cursors[i].timeout = System.currentTimeMillis(); - - // offset to next image - images_copy.position(width*height*(i+1)); - } - - // set index - index = 0; - } - + // Win32 doesn't (afaik) allow for animation based cursors, except when they're + // in the .ani format, which we don't support. + // The cursor animation was therefor developed using java side time tracking. + // unfortunately X flickers when changing cursor. We therefor check for either + // Win32 or X and do accordingly. This hasn't been implemented on Mac, but we + // might want to split it into a X/Win/Mac cursor if it gets too cluttered + + switch(Display.getPlatform()) { + case Display.PLATFORM_GLX: + // create our cursor elements + cursors = new CursorElement[1]; + cursors[0] = new CursorElement(); + cursors[0].cursorHandle = nCreateCursor(width, height, xHotspot, yHotspot, numImages, images_copy, images_copy.position(), delays, delays.position()); + break; + case Display.PLATFORM_WGL: + // create our cursor elements + cursors = new CursorElement[numImages]; + for(int i=0; i<numImages; i++) { + cursors[i] = new CursorElement(); + cursors[i].cursorHandle = nCreateCursor(width, height, xHotspot, yHotspot, 1, images_copy, images_copy.position(), null, 0); + cursors[i].delay = (delays != null) ? delays.get(i) : 0; + cursors[i].timeout = System.currentTimeMillis(); + + // offset to next image + images_copy.position(width*height*(i+1)); + } + // set index + index = 0; + break; + case Display.PLATFORM_AGL: + break; + } + } /** * Flips the images so they're oriented according to opengl @@ -202,7 +220,7 @@ /** * Native method to create a native cursor */ - private static native long nCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset); + private static native long nCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset); /** * Native method to destroy a native cursor Index: Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- Mouse.java 11 Apr 2004 16:03:40 -0000 1.50 +++ Mouse.java 12 Apr 2004 00:33:00 -0000 1.51 @@ -38,6 +38,7 @@ import java.util.Map; import org.lwjgl.BufferUtils; +import org.lwjgl.Display; import org.lwjgl.Sys; import org.lwjgl.opengl.Window; import org.lwjgl.LWJGLException; @@ -59,69 +60,71 @@ * @version $Revision$ */ public class Mouse { - + /** 1 bit transparency for native cursor */ - public final static int CURSOR_ONE_BIT_TRANSPARENCY = 1; - + public final static int CURSOR_ONE_BIT_TRANSPARENCY = 1; + /** 8 bit alhpa native cursor */ - public final static int CURSOR_8_BIT_ALPHA = 2; - + public final static int CURSOR_8_BIT_ALPHA = 2; + /** animation native cursor */ - public final static int CURSOR_ANIMATION = 4; + public final static int CURSOR_ANIMATION = 4; /** Has the mouse been created? */ - private static boolean created; + private static boolean created; /** The mouse buttons status from the last poll */ - private static ByteBuffer buttons; + private static ByteBuffer buttons; /** X */ - private static int x; + private static int x; /** Y */ - private static int y; - + private static int y; + /** Buffer to hold the deltas dx, dy and dwheel */ - private static IntBuffer coord_buffer; + private static IntBuffer coord_buffer; /** Delta X */ - private static int dx; + private static int dx; /** Delta Y */ - private static int dy; + private static int dy; /** Delta Z */ - private static int dwheel; + private static int dwheel; /** Number of buttons supported by the mouse */ - private static int buttonCount = -1; + private static int buttonCount = -1; /** Does this mouse support a scroll wheel */ - private static boolean hasWheel = false; + private static boolean hasWheel = false; /** The current native cursor, if any */ - private static Cursor currentCursor; + private static Cursor currentCursor; /** Button names. These are set upon create(), to names like BUTTON0, BUTTON1, etc. */ - private static String[] buttonName; + private static String[] buttonName; /** hashmap of button names, for fast lookup */ - private static final Map buttonMap = new HashMap(16); + private static final Map buttonMap = new HashMap(16); /** Lazy initialization */ - private static boolean initialized; + private static boolean initialized; /** The mouse button events from the last read */ - private static ByteBuffer readBuffer = null; + private static ByteBuffer readBuffer = null; /** The current mouse event button being examined */ - private static int eventButton; + private static int eventButton; /** The current state of the button being examined in the event queue */ - private static boolean eventState; + private static boolean eventState; /** Buffer size in events */ - private final static int BUFFER_SIZE = 50; + private final static int BUFFER_SIZE = 50; + + private static boolean isGrabbed; /** * Mouse cannot be constructed. @@ -172,17 +175,17 @@ * @throws LWJGLException if the cursor could not be set for any reason */ public static Cursor setNativeCursor(Cursor cursor) throws LWJGLException { - if (!created) - throw new IllegalStateException("Create the Mouse before setting the native cursor"); + if (!created) throw new IllegalStateException("Create the Mouse before setting the native cursor"); if ((getNativeCursorCaps() & CURSOR_ONE_BIT_TRANSPARENCY) == 0) - throw new IllegalStateException("Mouse doesn't support native cursors"); + throw new IllegalStateException("Mouse doesn't support native cursors"); Cursor oldCursor = currentCursor; currentCursor = cursor; if (currentCursor != null) { nSetNativeCursor(currentCursor.getHandle()); - currentCursor.setTimeout(); - x = Window.getWidth() / 2; - y = Window.getHeight() / 2; + currentCursor.setTimeout(); + x = Window.getWidth() / 2; + y = Window.getHeight() / 2; + isGrabbed = false; } else { nSetNativeCursor(0); } @@ -225,14 +228,14 @@ */ private static void initialize() { Sys.initialize(); - + // Assign names to all the buttons buttonName = new String[16]; - for (int i = 0; i < 16; i ++) { + for (int i = 0; i < 16; i++) { buttonName[i] = "BUTTON" + i; buttonMap.put(buttonName[i], new Integer(i)); } - + initialized = true; } @@ -242,14 +245,11 @@ * @throws LWJGLException if the mouse could not be created for any reason */ public static void create() throws LWJGLException { - - if (!Window.isCreated()) - throw new IllegalStateException("Window must be created prior to creating mouse"); - + + if (!Window.isCreated()) throw new IllegalStateException("Window must be created prior to creating mouse"); + initialize(); - if (created) { - return; - } + if (created) { return; } nCreate(); hasWheel = nHasWheel(); created = true; @@ -281,7 +281,7 @@ public static boolean isCreated() { return created; } - + /** * @return true if buffering is enabled */ @@ -297,12 +297,10 @@ try { setNativeCursor(null); } catch (LWJGLException e) { - if (Sys.DEBUG) - e.printStackTrace(); + if (Sys.DEBUG) e.printStackTrace(); } } - if (!created) - return; + if (!created) return; created = false; buttons = null; coord_buffer = null; @@ -341,10 +339,9 @@ * @see org.lwjgl.input.Mouse#enableBuffer() */ public static void poll() { - if (!created) - throw new IllegalStateException("Mouse must be created before you can poll it"); + if (!created) throw new IllegalStateException("Mouse must be created before you can poll it"); nPoll(coord_buffer, buttons); - + int poll_dx = coord_buffer.get(0); int poll_dy = coord_buffer.get(1); int poll_dwheel = coord_buffer.get(2); @@ -356,28 +353,27 @@ dwheel = poll_dwheel; // if window has been created, clamp to edges - if(Window.isCreated()) { + if (Window.isCreated()) { // clamp x, y if (x < 0) { x = 0; } else if (x > Window.getWidth()) { x = Window.getWidth(); } - + if (y < 0) { y = 0; } else if (y > Window.getHeight()) { y = Window.getHeight(); } } - if (readBuffer != null) - read(); + if (readBuffer != null) read(); } private static void read() { readBuffer.compact(); int numEvents = nRead(readBuffer, readBuffer.position()); - readBuffer.position(readBuffer.position() + numEvents*2); + readBuffer.position(readBuffer.position() + numEvents * 2); readBuffer.flip(); } @@ -393,14 +389,13 @@ * @return true if the specified button is down */ public static boolean isButtonDown(int button) { - if (!created) - throw new IllegalStateException("Mouse must be created before you can poll the button state"); + 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; } - + /** * Gets a button's name * @param button The button @@ -412,7 +407,7 @@ else return buttonName[button]; } - + /** * Get's a button's index. If the button is unrecognised then -1 is returned. * @param buttonName The button name @@ -429,9 +424,8 @@ * Enable mouse button buffering. Must be called after the mouse is created. */ public static void enableBuffer() throws LWJGLException { - if (!created) - throw new IllegalStateException("Mouse must be created before you can enable buffering"); - readBuffer = BufferUtils.createByteBuffer(2*BUFFER_SIZE); + if (!created) throw new IllegalStateException("Mouse must be created before you can enable buffering"); + readBuffer = BufferUtils.createByteBuffer(2 * BUFFER_SIZE); readBuffer.limit(0); nEnableBuffer(); } @@ -458,10 +452,9 @@ * @return true if a mouse event was read, false otherwise */ public static boolean next() { - if (!created) - throw new IllegalStateException("Mouse must be created before you can read events"); + if (!created) throw new IllegalStateException("Mouse must be created before you can read events"); if (readBuffer == null) - throw new IllegalStateException("Event buffering must be enabled before you can read events"); + throw new IllegalStateException("Event buffering must be enabled before you can read events"); if (readBuffer.hasRemaining()) { eventButton = readBuffer.get() & 0xFF; @@ -470,14 +463,14 @@ } else return false; } - + /** * @return Current events button */ public static int getEventButton() { return eventButton; } - + /** * @return Current events button state */ @@ -503,8 +496,8 @@ */ public static int getY() { return y; - } - + } + /** * @return Movement on the x axis since last time getDX() was called */ @@ -541,18 +534,34 @@ } /** + * @return whether or not the mouse has grabbed the cursor + */ + public static boolean isGrabbed() { + return isGrabbed; + } + + /** + * Sets whether or not the mouse has grabbed the cursor + * (and thus hidden). + */ + public static void setGrabbed(boolean grab) { + isGrabbed = grab; + nGrabMouse(isGrabbed); + } + private static native void nGrabMouse(boolean grab); + + /** * Updates the cursor, so that animation can be changed if needed. * This method is called automatically by the window on its update. */ public static void updateCursor() { - if(currentCursor != null && currentCursor.hasTimedOut()) { + if (Display.getPlatform() == Display.PLATFORM_WGL && currentCursor != null && currentCursor.hasTimedOut()) { currentCursor.nextCursor(); try { setNativeCursor(currentCursor); } catch (LWJGLException e) { - if (Sys.DEBUG) - e.printStackTrace(); + if (Sys.DEBUG) e.printStackTrace(); } } } -} +} \ No newline at end of file |