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
|
4
|
5
(5) |
6
(1) |
7
|
8
|
9
|
|
10
(2) |
11
(1) |
12
|
13
|
14
|
15
|
16
(7) |
|
17
|
18
|
19
(1) |
20
(1) |
21
(2) |
22
(1) |
23
|
|
24
|
25
|
26
|
27
|
28
|
29
|
30
|
|
31
|
|
|
|
|
|
|
|
From: Brian M. <ma...@us...> - 2005-07-22 15:28:41
|
Update of /cvsroot/java-game-lib/LWJGL/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26430 Modified Files: projects.php Log Message: make elias stop whine Index: projects.php =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/www/projects.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- projects.php 21 Jul 2005 22:17:18 -0000 1.8 +++ projects.php 22 Jul 2005 15:28:24 -0000 1.9 @@ -26,7 +26,7 @@ $projects[] = array('name' => 'StarShip2D', 'url' => 'http://www.drx.dk/starship2d.php', 'type' => 'Free, open source game', - 'desc' => 'StarShip2D is a 2d scroller game, where you shoot incomming enemies with your cannon or powerfull rockets.', + 'desc' => 'StarShip2D is a 2d scroller game, where you shoot incomming enemies with your cannon or powerful rockets.', 'screens' => array(0 => array('small' => 'starship2d_small_1.jpg', 'big' => 'starship2d_1.jpg'), 1 => array('small' => 'starship2d_small_2.jpg', @@ -114,7 +114,7 @@ $projects[] = array('name' => 'Keith Goes Painting ', 'url' => 'http://www.wolfys.co.uk/', 'type' => 'Free game', - 'desc' => 'Keiths\' Boss has left town with intstructions that all the furniture in his house must be painted. It is up to you to guide Keith around the big house and paint the furniture before his Boss comes home and sacks him. The house seems to be infested with giant worms, flappy bat things and other rare baddys. But fear not, for Keith is armed with a paint gun which can be used splat a path through the house. There are many hidden places to explore and secrets to find, good luck!', + 'desc' => 'Keiths\' Boss has left town with intstructions that all the furniture in his house must be painted. It is up to you to guide Keith around the big house and paint the furniture before his Boss comes home and sacks him. The house seems to be infested with giant worms, flappy bat things and other rare baddies. But fear not, for Keith is armed with a paint gun which can be used splat a path through the house. There are many hidden places to explore and secrets to find, good luck!', 'screens' => array(0 => array('small' => 'keith_goes_painting_small_1.jpg', 'big' => 'keith_goes_painting_1.jpg'), 1 => array('small' => 'keith_goes_painting_small_2.jpg', |
|
From: Brian M. <ma...@us...> - 2005-07-21 22:21:01
|
Update of /cvsroot/java-game-lib/LWJGL/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26833 Modified Files: projects.php Log Message: added Cultris added Keith Goes Painting fixed StarShip2D path Index: projects.php =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/www/projects.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- projects.php 14 Feb 2005 17:31:15 -0000 1.7 +++ projects.php 21 Jul 2005 22:17:18 -0000 1.8 @@ -24,7 +24,7 @@ 'big' => 'vermins_2.jpg'))); $projects[] = array('name' => 'StarShip2D', - 'url' => 'http://www.drx.dk/starship2d.html', + 'url' => 'http://www.drx.dk/starship2d.php', 'type' => 'Free, open source game', 'desc' => 'StarShip2D is a 2d scroller game, where you shoot incomming enemies with your cannon or powerfull rockets.', 'screens' => array(0 => array('small' => 'starship2d_small_1.jpg', @@ -98,7 +98,29 @@ 1 => array('small' => 'illuminati_small_2.jpg', 'big' => 'illuminati_2.jpg'), 2 => array('small' => 'illuminati_small_3.jpg', - 'big' => 'illuminati_3.jpg'))); + 'big' => 'illuminati_3.jpg'))); + +$projects[] = array('name' => 'Cultris', + 'url' => 'http://cultris.ath.cx/', + 'type' => 'Free game', + 'desc' => 'Everyone knows Tetris - Cultris is a extremly fast-paced multiplayer version.', + 'screens' => array(0 => array('small' => 'cultris_small_1.jpg', + 'big' => 'cultris_1.jpg'), + 1 => array('small' => 'cultris_small_2.jpg', + 'big' => 'cultris_2.jpg'), + 2 => array('small' => 'cultris_small_3.jpg', + 'big' => 'cultris_3.jpg'))); + +$projects[] = array('name' => 'Keith Goes Painting ', + 'url' => 'http://www.wolfys.co.uk/', + 'type' => 'Free game', + 'desc' => 'Keiths\' Boss has left town with intstructions that all the furniture in his house must be painted. It is up to you to guide Keith around the big house and paint the furniture before his Boss comes home and sacks him. The house seems to be infested with giant worms, flappy bat things and other rare baddys. But fear not, for Keith is armed with a paint gun which can be used splat a path through the house. There are many hidden places to explore and secrets to find, good luck!', + 'screens' => array(0 => array('small' => 'keith_goes_painting_small_1.jpg', + 'big' => 'keith_goes_painting_1.jpg'), + 1 => array('small' => 'keith_goes_painting_small_2.jpg', + 'big' => 'keith_goes_painting_2.jpg'), + 2 => array('small' => 'keith_goes_painting_small_3.jpg', + 'big' => 'keith_goes_painting_3.jpg'))); function displayProjects() { |
|
From: Brian M. <ma...@us...> - 2005-07-21 22:20:56
|
Update of /cvsroot/java-game-lib/LWJGL/www/_gfx/projects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26833/_gfx/projects Added Files: cultris_1.jpg cultris_2.jpg cultris_3.jpg cultris_small_1.jpg cultris_small_2.jpg cultris_small_3.jpg keith_goes_painting_1.jpg keith_goes_painting_2.jpg keith_goes_painting_3.jpg keith_goes_painting_small_1.jpg keith_goes_painting_small_2.jpg keith_goes_painting_small_3.jpg Log Message: added Cultris added Keith Goes Painting fixed StarShip2D path --- NEW FILE: keith_goes_painting_2.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: keith_goes_painting_small_1.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: cultris_small_1.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: keith_goes_painting_small_3.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: cultris_small_3.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: cultris_1.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: cultris_small_2.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: keith_goes_painting_small_2.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: cultris_2.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: cultris_3.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: keith_goes_painting_3.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: keith_goes_painting_1.jpg --- (This appears to be a binary file; contents omitted.) |
|
From: Brian M. <ma...@us...> - 2005-07-20 07:30:35
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14704/src/java/org/lwjgl/opengl Modified Files: Pbuffer.java Log Message: fix for matrox parhelia, they wont accept NULL buffer, despite the specs saying it's legit. Bugfinding: Javazoid Index: Pbuffer.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Pbuffer.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- Pbuffer.java 4 May 2005 20:59:36 -0000 1.41 +++ Pbuffer.java 20 Jul 2005 07:30:26 -0000 1.42 @@ -31,6 +31,9 @@ */ package org.lwjgl.opengl; +import java.nio.IntBuffer; + +import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; import org.lwjgl.Sys; @@ -190,9 +193,13 @@ } private static PeerInfo createPbuffer(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture) throws LWJGLException { - if ( renderTexture == null ) - return Display.getImplementation().createPbuffer(width, height, pixel_format, null, null); - else + if ( renderTexture == null ) { + // Though null is a perfectly valid argument, Matrox Parhelia drivers expect + // a 0 terminated list, or else they crash. Supplying NULL or 0, should + // cause the drivers to use default settings + IntBuffer defaultAttribs = BufferUtils.createIntBuffer(1); + return Display.getImplementation().createPbuffer(width, height, pixel_format, null, defaultAttribs); + } else return Display.getImplementation().createPbuffer(width, height, pixel_format, renderTexture.pixelFormatCaps, renderTexture.pBufferAttribs); |
|
From: Brian M. <ma...@us...> - 2005-07-19 19:32:36
|
Update of /cvsroot/java-game-lib/LWJGL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26167 Modified Files: build.xml Log Message: add jinput to classpath when building org.lwjgl.* instead, since input is dragged into the compile via Sys.java Index: build.xml =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/build.xml,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- build.xml 29 Jun 2005 20:13:10 -0000 1.83 +++ build.xml 19 Jul 2005 19:32:13 -0000 1.84 @@ -318,8 +318,8 @@ <!-- Compiles the Java source code --> <target name="compile" description="Compiles the java source code"> - <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/*.java" source="1.4" target="1.4" taskname="lwjgl" /> - <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/input/**" source="1.4" target="1.4" classpath="${lwjgl.lib}/jinput.jar" taskname="input" /> + <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/*.java" source="1.4" target="1.4" classpath="${lwjgl.lib}/jinput.jar" taskname="lwjgl" /> + <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/input/**" source="1.4" target="1.4" taskname="input" /> <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/openal/**" source="1.4" target="1.4" taskname="openal" /> <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/opengl/**" source="1.4" target="1.4" taskname="opengl" /> <javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/test/**" source="1.4" target="1.4" taskname="test" /> |
|
From: Kevin G. <kev...@us...> - 2005-07-16 11:28:12
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4720/src/native/win32 Modified Files: org_lwjgl_opengl_Display.c Log Message: Fix for alpha based icons under win32. Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- org_lwjgl_opengl_Display.c 16 Jul 2005 10:30:16 -0000 1.27 +++ org_lwjgl_opengl_Display.c 16 Jul 2005 11:27:58 -0000 1.28 @@ -446,9 +446,19 @@ for (y = 0; y < height; y++ ) { dstPtr = ptrCursorImage + wordAlignedWidth*y;; for (x = 0; x < width; x++ ) { - dstPtr[0] = (pixels[y*width+x] >> 0x10) & 0xFF; - dstPtr[1] = (pixels[y*width+x] >> 0x08) & 0xFF; - dstPtr[2] = pixels[y*width+x] & 0xFF; + if ((pixels[y*width+x] & 0xFF000000) != 0) + { + dstPtr[0] = (pixels[y*width+x] >> 0x10) & 0xFF; + dstPtr[1] = (pixels[y*width+x] >> 0x08) & 0xFF; + dstPtr[2] = pixels[y*width+x] & 0xFF; + } + else + { + dstPtr[0] = 0; + dstPtr[1] = 0; + dstPtr[2] = 0; + } + dstPtr += 3; } } @@ -482,7 +492,7 @@ mask = 0; maskPixelsOff = scanlineWidth*y; for (x = 0; x < width; x++) { - col = (((pixels[width*y+x] & 0xFF000000) != 0) ? 1 : 0) << leftShift; + col = (((pixels[(width*y)+x] & 0xFF000000) != 0) ? 1 : 0) << leftShift; mask = mask | col; leftShift--; if (leftShift == -1) { |
|
From: Brian M. <ma...@us...> - 2005-07-16 11:15:46
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2921/src/java/org/lwjgl/opengl Modified Files: Display.java Log Message: caching of window icon Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Display.java,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- Display.java 5 Jul 2005 21:54:12 -0000 1.54 +++ Display.java 16 Jul 2005 11:15:37 -0000 1.55 @@ -75,6 +75,9 @@ /** X coordinate of the window */ private static int x = -1; + + /** Cached window icons, for when Display is recreated */ + private static ByteBuffer[] cached_icons; /** * Y coordinate of the window. Y in window coordinates is from the top of the display down, @@ -266,6 +269,11 @@ initControls(); setVSyncEnabled(vsync); window_created = true; + + // set cached window icon if exists + if(cached_icons != null) { + setIcon(cached_icons); + } } private static void destroyWindow() { @@ -725,6 +733,7 @@ destroyWindow(); destroyContext(); x = y = -1; + cached_icons = null; reset(); } @@ -824,11 +833,28 @@ * <li>Mac OS X should be supplied one 128x128 icon</li> * </ul> * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions nescesarry for the specific platform. + * <p> + * <b>NOTE:</b> The display will make a deep copy of the supplied byte buffer array, for the purpose + * of recreating the icons when you go back and forth fullscreen mode. You therefore only need to + * set the icon once per instance. * * @param icons Array of icons in RGBA mode - * @return number of icons used. + * @return number of icons used, or 0 if display hasn't been created */ public static int setIcon(ByteBuffer[] icons) { - return display_impl.setIcon(icons); + + // make deep copy so we dont rely on the supplied buffers later on + cached_icons = new ByteBuffer[icons.length]; + for(int i=0;i<icons.length; i++) { + cached_icons[i] = BufferUtils.createByteBuffer(icons[i].capacity()); + cached_icons[i].put(icons[i]); + cached_icons[i].flip(); + } + + if(Display.isCreated()) { + return display_impl.setIcon(cached_icons); + } else { + return 0; + } } } |
|
From: Kevin G. <kev...@us...> - 2005-07-16 10:37:12
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29907/src/java/org/lwjgl/test Modified Files: WindowCreationTest.java Log Message: LWJGL icon used as window icon in test. Index: WindowCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- WindowCreationTest.java 11 Jul 2005 17:05:11 -0000 1.34 +++ WindowCreationTest.java 16 Jul 2005 10:37:00 -0000 1.35 @@ -31,7 +31,9 @@ */ package org.lwjgl.test; +import java.io.File; import java.nio.ByteBuffer; +import java.io.IOException; import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; @@ -39,6 +41,7 @@ import org.lwjgl.opengl.Display; import org.lwjgl.opengl.DisplayMode; import org.lwjgl.opengl.GL11; +import org.lwjgl.util.XPMFile; /** * Small class for testing that the Window is creatable @@ -94,28 +97,41 @@ window_x = window_y = 100; Display.setLocation(window_x, window_y); - // Icon test + File file = new File(new File("res"), "lwjgl_16x16.xpm"); ByteBuffer size16 = BufferUtils.createByteBuffer(16 * 16 * 4); - for(int i=0; i<16; i++) { - for(int j=0; j<16; j++) { - size16.putInt(0xffffffff); - } - } + XPMFile xpm = XPMFile.load(file.getAbsolutePath()); + size16.put(xpm.getBytes()); size16.flip(); + // Icon test +// for(int i=0; i<16; i++) { +// for(int j=0; j<16; j++) { +// size16.putInt(0xffffffff); +// } +// } +// size16.flip(); + + file = new File(new File("res"), "lwjgl_32x32.xpm"); ByteBuffer size32 = BufferUtils.createByteBuffer(32 * 32 * 4); - for(int i=0; i<32; i++) { - for(int j=0; j<32; j++) { - size32.putInt(0xff0000ff); - } - } + xpm = XPMFile.load(file.getAbsolutePath()); + size32.put(xpm.getBytes()); size32.flip(); +// ByteBuffer size32 = BufferUtils.createByteBuffer(32 * 32 * 4); +// for(int i=0; i<32; i++) { +// for(int j=0; j<32; j++) { +// size32.putInt(0xff0000ff); +// } +// } +// size32.flip(); + Display.create(); Display.setIcon(new ByteBuffer[] { size16, size32 }); return true; } catch (LWJGLException le) { le.printStackTrace(); + } catch (IOException ioe) { + ioe.printStackTrace(); } return false; } |
|
From: Kevin G. <kev...@us...> - 2005-07-16 10:36:31
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29800/src/java/org/lwjgl/util Modified Files: XPMFile.java Log Message: Fix for compilation on 1.4, remove autoboxing Index: XPMFile.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/XPMFile.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- XPMFile.java 16 Jul 2005 09:11:26 -0000 1.1 +++ XPMFile.java 16 Jul 2005 10:36:13 -0000 1.2 @@ -144,7 +144,7 @@ String color = line.substring(6); // we always assume type is color, and supplied as #<r><g><b> - return new Object[] { key, Integer.parseInt(color, 16)}; + return new Object[] { key, new Integer(Integer.parseInt(color, 16))}; } /** |
|
From: Kevin G. <kev...@us...> - 2005-07-16 10:30:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28886/src/native/win32 Modified Files: org_lwjgl_opengl_Display.c Log Message: Fix win32 icon alpha mask Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- org_lwjgl_opengl_Display.c 10 Jul 2005 20:16:53 -0000 1.26 +++ org_lwjgl_opengl_Display.c 16 Jul 2005 10:30:16 -0000 1.27 @@ -476,12 +476,13 @@ imageSize = scanlineWidth*height; maskPixels = (unsigned char*)malloc(sizeof(unsigned char)*imageSize); memset(maskPixels, 0, imageSize); + for (y = 0; y < height; y++) { leftShift = 7; mask = 0; maskPixelsOff = scanlineWidth*y; for (x = 0; x < width; x++) { - col = (pixels[width*y+x] & 0x00000001) << leftShift; + col = (((pixels[width*y+x] & 0xFF000000) != 0) ? 1 : 0) << leftShift; mask = mask | col; leftShift--; if (leftShift == -1) { @@ -490,12 +491,12 @@ mask = 0; } } - // write what is left over if (leftShift != 7) { maskPixels[maskPixelsOff++] = ~mask; } } + cursorMask = CreateBitmap(width, height, 1, 1, maskPixels); memset(&iconInfo, 0, sizeof(ICONINFO)); |
|
From: Brian M. <ma...@us...> - 2005-07-16 09:13:37
|
Update of /cvsroot/java-game-lib/LWJGL/res In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17567/res Added Files: lwjgl_16x16.xpm lwjgl_32x32.xpm Log Message: temp XPM logo files --- NEW FILE: lwjgl_32x32.xpm --- /* XPM */ static char * lwjgl_32x32_xpm[] = { "32 32 240 2", " c #FFFFFF", ". c #FAFCFD", "+ c #CBDDEC", "@ c #93B7D6", "# c #6FA0C9", "$ c #5C93C2", "% c #6096C3", "& c #7AA7CD", "* c #ACC8E0", "= c #EDF3F8", "- c #FCFDFE", "; c #B5CEE3", "> c #5A92C1", ", c #3A7DB5", "' c #4585B9", ") c #A1C1DC", "! c #FCFCFC", "~ c #E2EAF1", "{ c #B8CFE3", "] c #AEC9E0", "^ c #A3C2DC", "/ c #98BAD8", "( c #8CB3D3", "_ c #81ACCF", ": c #6E9FC8", "< c #3D7FB6", "[ c #72A2CA", "} c #F5F8FB", "| c #D8D8D8", "1 c #313131", "2 c #242424", "3 c #404040", "4 c #525252", "5 c #656565", "6 c #747474", "7 c #8F8F8F", "8 c #F7F8F8", "9 c #ACC8DF", "0 c #3B7DB5", "a c #79A7CD", "b c #FEFEFE", "c c #686868", "d c #000000", "e c #B6B6B6", "f c #86AED1", "g c #AECAE1", "h c #D3E2EE", "i c #E1EAF2", "j c #282828", "k c #020202", "l c #DEDEDE", "m c #5B92C1", "n c #4886BA", "o c #F4F8FB", "p c #ECF3F8", "q c #6499C5", "r c #D7D9DB", "s c #050505", "t c #C0D5E7", "u c #397CB5", "v c #ABC8E0", "w c #FEFFFF", "x c #78A6CC", "y c #7BA7CD", "z c #9E9E9E", "A c #E2ECF4", "B c #377BB4", "C c #669AC5", "D c #C3D7E8", "E c #397DB5", "F c #B2CCE1", "G c #585858", "H c #A9A9A9", "I c #BCD2E5", "J c #4081B7", "K c #EEF4F9", "L c #DDE5ED", "M c #1C1C1C", "N c #070707", "O c #E7E7E7", "P c #85AED1", "Q c #CCDEEC", "R c #BAD2E5", "S c #5790BF", "T c #D0D1D1", "U c #030303", "V c #333333", "W c #FDFDFD", "X c #FBFCFD", "Y c #508BBD", "Z c #B1CCE2", "` c #CACACA", " . c #373737", ".. c #616161", "+. c #A2A2A2", "@. c #DDDDDD", "#. c #E4ECF3", "$. c #B1CBE1", "%. c #B4CDE2", "&. c #E6E6E6", "*. c #232323", "=. c #727272", "-. c #D8E5F0", ";. c #A0C0DB", ">. c #666666", ",. c #060606", "'. c #272727", "). c #D4D4D4", "!. c #F6F6F6", "~. c #D0D0D0", "{. c #979797", "]. c #5E5E5E", "^. c #040404", "/. c #C0C0C0", "(. c #A2C1DB", "_. c #9EBFDA", ":. c #FBFBFB", "<. c #252525", "[. c #5C5C5C", "}. c #EAEAEA", "|. c #B5B5B5", "1. c #E9E9E9", "2. c #B2B2B2", "3. c #BDBDBD", "4. c #6B9DC7", "5. c #DBDBDB", "6. c #838383", "7. c #5F5F5F", "8. c #0B0B0B", "9. c #767676", "0. c #B7B7B7", "a. c #F0F0F0", "b. c #F0F5F9", "c. c #4B88BB", "d. c #B2CCE2", "e. c #9A9A9A", "f. c #C5C5C5", "g. c #F7F7F7", "h. c #1D1D1D", "i. c #3C3C3C", "j. c #DFDFDF", "k. c #F3F7FA", "l. c #CCDDEB", "m. c #9EBEDA", "n. c #72A1C9", "o. c #4C89BB", "p. c #C9DCEB", "q. c #565656", "r. c #0F0F0F", "s. c #F9F9F9", "t. c #D1D1D1", "u. c #8E8E8E", "v. c #848484", "w. c #707070", "x. c #B0B0B0", "y. c #F9FBFC", "z. c #DCE8F2", "A. c #F6F9FC", "B. c #151515", "C. c #4E4E4E", "D. c #919191", "E. c #BBBBBB", "F. c #2F2F2F", "G. c #393939", "H. c #909090", "I. c #4D4D4D", "J. c #101010", "K. c #5A5A5A", "L. c #090909", "M. c #323232", "N. c #B1B1B1", "O. c #A1A1A1", "P. c #353535", "Q. c #F5F5F5", "R. c #131313", "S. c #454545", "T. c #F8F8F8", "U. c #2B2B2B", "V. c #BEBEBE", "W. c #505050", "X. c #C2C2C2", "Y. c #868686", "Z. c #D2D2D2", "`. c #010101", " + c #434343", ".+ c #DCDCDC", "++ c #E0E0E0", "@+ c #959595", "#+ c #C8C8C8", "$+ c #888888", "%+ c #292929", "&+ c #181818", "*+ c #4A4A4A", "=+ c #CFCFCF", "-+ c #F1F6FA", ";+ c #4B4B4B", ">+ c #86AFD1", ",+ c #90B5D5", "'+ c #EAF1F7", ")+ c #787878", "!+ c #1B1B1B", "~+ c #969696", "{+ c #C6C6C6", "]+ c #C3D8E9", "^+ c #4383B8", "/+ c #94B8D6", "(+ c #F4F4F4", "_+ c #A7A7A7", ":+ c #858585", "<+ c #9D9D9D", "[+ c #FAFBFD", "}+ c #5D94C2", "|+ c #4685B9", "1+ c #98BBD8", "2+ c #EFF4F9", "3+ c #9B9B9B", "4+ c #C5D9E9", "5+ c #3B7EB6", "6+ c #F2F6FA", "7+ c #2C2C2C", "8+ c #8FB5D5", "9+ c #4A87BB", "0+ c #FAFAFA", "a+ c #6E6E6E", "b+ c #85AFD1", "c+ c #4D89BC", "d+ c #A8C5DE", "e+ c #0E0E0E", "f+ c #B8B8B8", "g+ c #FEFEFF", "h+ c #B1CBE2", "i+ c #4C89BC", "j+ c #BFD4E7", "k+ c #ECECEC", "l+ c #939393", "m+ c #81ACD0", "n+ c #6599C5", "o+ c #6197C4", "p+ c #6C9EC8", "q+ c #F7FAFC", " . + @ # $ % & * = ", " - ; > , , , , , , , ' ) - ", " ! ~ { ] ^ / ( _ : < , , , [ } ", " | 1 2 1 3 4 5 6 7 8 9 0 , , , a - ", " b c d d d d d d d d e b f , , , , g ", " h i j d d d d d d d k l } m , , , n o ", " p q r s d d d d d d d 2 b t u , , , v ", " w x y z d d d d d d d d 5 A B , , , C ", " D E F G d d d d d d d d H I , , , , J K ", " . > < L M d d d d d d d N O P , , , , E Q ", " b R , S T U d d d d d d d V W X Y , , , , E Z ", " ` ...+.@.#.$.%.&.*.d d d d d d d =. -., , , , , , ;. ", " >.d d d ,.'.>.). !.~.{.].'.^.d U /. (., , , , , , _. ", ":.<.d d d d d d [. }.7 |.1.W O 2.3.b 4., , , , , , ) ", "5.U d d d d d d 6. 7.d d 8. .9.0.a. b.c.< u , , , , d. ", "e.d d d d d d d f.g.h.d d d d d d N i.j. X - k.l.m.n.o., p. ", "q.d d d d d d r.s.t.U d d d d d d d d u. s.v.w.x.}. y.z.A. ", "B.d d d d d d C. D.d d d d d d d d d E. z d d d ^.F.w.x.&.b ", "G.d d d d d d H. I.d d d d d d d d J.a. K.d d d d d d d L.M.N.", "!.O.P.k d d k t.Q.R.d d d d d d d d S.b T.h.d d d d d d d d d U.", " ! V.W.s <.s.X.d d d d d d d d d Y. Z.`.d d d d d d d d d +", " b .+++ @+d d d d d d d d `.#+ u.d d d d d d d d d d $+", " j.%+d d d d d d d &+Q. *+d d d d d d d d d d =+", " -+ s.|.;+,.d d d d 4 T.J.d d d d d d d d d M T.", " >+,+'+ 5.)+!+d d ~+ {+d d d d d d d d d d K. ", " ]+, ^+/+= (+_+:+(+ Y.d d d d d d d d d d <+ ", " [+}+, , |+1+2+ 3+d d d d d d d d d s @. ", " 4+5+, , , n m.6+ :.u.<.`.d d d d d d 7+! ", " 8+, , , , , 9+^ k. 0+x.S.^.d d d d a+ ", " - b+, , , , , , c+d+A. b Z.c e+d `.f+ ", " g+h+i+E , , , , , c+j+ k+l+3+W ", " k.; m+n+o+p+8+4+q+ "}; --- NEW FILE: lwjgl_16x16.xpm --- /* XPM */ static char * lwjgl_logo_2a_xpm[] = { "16 16 122 2", " c #000000", ". c #010101", "+ c #020202", "@ c #030303", "# c #0A0A0A", "$ c #0C0C0C", "% c #0E0E0E", "& c #171717", "* c #1B1B1B", "= c #1D1D1D", "- c #1F1F1F", "; c #222222", "> c #232323", ", c #2B2B2B", "' c #2D2D2D", ") c #333333", "! c #3D3D3D", "~ c #404040", "{ c #434343", "] c #4A4A4A", "^ c #4F4F4F", "/ c #525252", "( c #565656", "_ c #585858", ": c #595959", "< c #5C5C5C", "[ c #5E5E5E", "} c #5F5F5F", "| c #666666", "1 c #686868", "2 c #6C6C6C", "3 c #6D6D6D", "4 c #397CB5", "5 c #3A7DB5", "6 c #3D7FB6", "7 c #3E80B6", "8 c #747474", "9 c #787878", "0 c #4886BA", "a c #4C89BC", "b c #4D89BC", "c c #508BBD", "d c #508CBD", "e c #76828D", "f c #548EBF", "g c #5690C0", "h c #848484", "i c #5B92C1", "j c #7D8D9B", "k c #6096C3", "l c #8C8C8C", "m c #8D8F91", "n c #669AC5", "o c #919191", "p c #6D9EC8", "q c #8499AA", "r c #959595", "s c #71A1CA", "t c #74A4CB", "u c #9B9B9B", "v c #77A5CC", "w c #9C9EA0", "x c #7CA8CE", "y c #7EA9CE", "z c #A1A1A1", "A c #81ABCE", "B c #82ACD0", "C c #84ADD0", "D c #A5A5A5", "E c #A6A6A7", "F c #86AFD2", "G c #87B0D2", "H c #A8A8A8", "I c #8CB3D4", "J c #8DB4D4", "K c #91B6D5", "L c #94B7D5", "M c #97BAD8", "N c #9EBFDA", "O c #A2C1DC", "P c #BCBCBC", "Q c #BDBDBD", "R c #BFBFBF", "S c #C0C0C0", "T c #B0C5D6", "U c #C6C6C6", "V c #CCCCCC", "W c #CFCFCF", "X c #D0D0D0", "Y c #C2D7E8", "Z c #D3D3D3", "` c #C4D8E9", " . c #D4D4D4", ".. c #C6D9E9", "+. c #D6D6D6", "@. c #D0E0ED", "#. c #DADEE1", "$. c #D2E1EE", "%. c #DFDFDF", "&. c #E4E4E4", "*. c #DAE7F1", "=. c #E5E5E5", "-. c #E6E6E6", ";. c #E0EAF3", ">. c #E2ECF4", ",. c #E4EDF5", "'. c #E7EFF6", "). c #EEEEEE", "!. c #E8F0F6", "~. c #EFEFEF", "{. c #EBF2F8", "]. c #EDF3F8", "^. c #F2F2F2", "/. c #F5F5F5", "(. c #F6F6F6", "_. c #F4F8FB", ":. c #FBFBFB", "<. c #FAFCFD", "[. c #FCFDFE", "}. c #FEFEFE", "|. c #FEFFFF", "1. c #FFFFFF", "1.1.1.1.1.1.|.Y t c f F '.1.1.1.", "1.1.1.1.1./.m e j q L 5 0 *.1.1.", "1.1.1.1._.w &.C 5 i [.1.", "1.1.1.1.K } ; 1.!.4 5 ` 1.", "1.1.1...A = | 1.@.5 5 J 1.", "^.D %.O T # H 1.M 5 5 s 1.", "z . > V X D h < ~.1.k 5 5 p 1.", "[ W - @ , 2 U <.N v a x 1.", "* & +.. / =.! 1 E #.1.", "8 % : r o u + { ", "1.).l R ( Z _ ) ", "1.1.[.1.S ~ + * :.& 9 ", "1.1.$.y ;.1. .3 h Z Q ", "1.1.}.n 6 B ,.1.1.=.' $ (.", "1.1.1.>.b 5 7 G '.1.}.P ^ @ ] 1.", "1.1.1.1.{.I g d v ].1.1.1.%.-.1."}; |
|
From: Brian M. <ma...@us...> - 2005-07-16 09:11:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17296/src/java/org/lwjgl/util Added Files: XPMFile.java Log Message: XPM File reader --- NEW FILE: XPMFile.java --- package org.lwjgl.util; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.StringTokenizer; /** * $Id$ * <p> * NOTE: This simple XPM reader does not support extensions nor hotspots * </p> * @author Brian Matzon <br...@ma...> * @version $Revision$ */ public class XPMFile { /** Array of bytes (RGBA) */ private byte bytes[] = null; /** Height of image */ private int height = 0; /** Width of image */ private int width = 0; /* * Private constructor, use load(String filename) */ private XPMFile() { } /** * Loads the XPM file * * @param file path to file * @return XPMFile loaded, or exception * @throws FileNotFoundException If file isn't found * @throws IOException If any IO exceptions occurs while reading file */ public static XPMFile load(String file) throws FileNotFoundException, IOException { XPMFile xFile = new XPMFile(); xFile.readImage(file); return xFile; } /** * @return the height of the image. */ public int getHeight() { return height; } /** * @return the width of the image. */ public int getWidth() { return width; } /** * @return The data of the image. */ public byte[] getBytes() { return bytes; } /** * Read the image from the specified file. * * @throws FileNotFoundException If file isn't found * @throws IOException If any IO exceptions occurs while reading file */ private void readImage(String filename) throws FileNotFoundException, IOException { try { BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(filename)))); HashMap colors = new HashMap(); String comment = br.readLine(); String typedef = br.readLine(); int[] format = parseFormat(br.readLine()); // setup color mapping for (int i = 0; i < format[2]; i++) { Object[] colorDefinition = parseColor(br.readLine()); colors.put(colorDefinition[0], colorDefinition[1]); } // read actual image (convert to RGBA) bytes = new byte[format[0] * format[1] * 4]; for (int i = 0; i < format[1]; i++) { parseImageLine(br.readLine(), format, colors, i); } } catch (Exception e) { throw new IllegalArgumentException("Unable to parse XPM File"); } } /** * Parses the format of the xpm file given a format string * * @param format String to parse * @return Array specifying width, height, colors, characters per pixel */ private int[] parseFormat(String format) { // format should look like this: // "16 16 122 2", // nuke first and last " and last , format = format.substring(1, format.length() - 2); // tokenize it StringTokenizer st = new StringTokenizer(format); return new int[] { Integer.parseInt(st.nextToken()), /* width */ Integer.parseInt(st.nextToken()), /* height */ Integer.parseInt(st.nextToken()), /* colors */ Integer.parseInt(st.nextToken()) /* chars per pixel */ }; } /** * Given a line defining a color/pixel, parses this into an array containing * a key and a color * @param line Line to parse * @return Array containing a key (String) and a color (Integer) */ private Object[] parseColor(String line) { // line should look like this // "# c #0A0A0A", // nuke first and last " line = line.substring(1, line.length() - 2); String key = line.substring(0, 2); String type = line.substring(3, 4); String color = line.substring(6); // we always assume type is color, and supplied as #<r><g><b> return new Object[] { key, Integer.parseInt(color, 16)}; } /** * Parses an Image line into its byte values * @param line Line of chars to parse * @param format Format to expext it in * @param colors Colors to lookup * @param index current index into lines, we've reached */ private void parseImageLine(String line, int[] format, HashMap colors, int index) { // offset for next line int offset = index * 4 * format[0]; // nuke first " line = line.substring(1, line.length()); // read format[3] characters format[0] times, each iteration is one color for (int i = 0; i < format[0]; i++) { String key = line.substring(i * 2, (i * 2 + 2)); Integer color = (Integer) colors.get(key); bytes[offset + (i * 4) ] = (byte) ((color.intValue() & 0x00ff0000) >> 16); bytes[offset + ((i * 4) + 1)] = (byte) ((color.intValue() & 0x0000ff00) >> 8); bytes[offset + ((i * 4) + 2)] = (byte) ((color.intValue() & 0x000000ff) >> 0); // looks better :) bytes[offset + ((i * 4) + 3)] = (byte) 0xff; // always 0xff alpha } } /** * @param args */ public static void main(String[] args) { if (args.length != 1) { System.out.println("usage:\nXPMFile <file>"); } try { String out = args[0].substring(0, args[0].indexOf(".")) + ".raw"; XPMFile file = XPMFile.load(args[0]); BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(new File(out))); bos.write(file.getBytes()); bos.close(); //showResult(file.getBytes()); } catch (Exception e) { e.printStackTrace(); } } /* private static void showResult(byte[] bytes) { final BufferedImage i = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB); int c = 0; for (int y = 0; y < 16; y++) { for (int x = 0; x < 16; x++) { i.setRGB(x, y, (bytes[c] << 16) + (bytes[c + 1] << 8) + (bytes[c + 2] << 0) + (bytes[c + 3] << 24));//+(128<<24));// c += 4; } } final Frame frame = new Frame("XPM Result"); frame.add(new Canvas() { public void paint(Graphics g) { g.drawImage(i, 0, 0, frame); } }); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { frame.dispose(); } }); frame.setSize(100, 100); frame.setVisible(true); }*/ } |
|
From: Brian M. <ma...@us...> - 2005-07-11 17:05:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26787/src/java/org/lwjgl/test Modified Files: WindowCreationTest.java Log Message: way simple icon test Index: WindowCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- WindowCreationTest.java 22 May 2005 12:12:02 -0000 1.33 +++ WindowCreationTest.java 11 Jul 2005 17:05:11 -0000 1.34 @@ -31,6 +31,9 @@ */ package org.lwjgl.test; +import java.nio.ByteBuffer; + +import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.Display; @@ -91,7 +94,25 @@ window_x = window_y = 100; Display.setLocation(window_x, window_y); + // Icon test + ByteBuffer size16 = BufferUtils.createByteBuffer(16 * 16 * 4); + for(int i=0; i<16; i++) { + for(int j=0; j<16; j++) { + size16.putInt(0xffffffff); + } + } + size16.flip(); + + ByteBuffer size32 = BufferUtils.createByteBuffer(32 * 32 * 4); + for(int i=0; i<32; i++) { + for(int j=0; j<32; j++) { + size32.putInt(0xff0000ff); + } + } + size32.flip(); + Display.create(); + Display.setIcon(new ByteBuffer[] { size16, size32 }); return true; } catch (LWJGLException le) { le.printStackTrace(); |
|
From: Kevin G. <kev...@us...> - 2005-07-10 20:17:03
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30019/src/native/win32 Modified Files: org_lwjgl_opengl_Display.c Log Message: Fix native code to work with RGBA rather than RBGR. Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- org_lwjgl_opengl_Display.c 5 Jul 2005 22:08:55 -0000 1.25 +++ org_lwjgl_opengl_Display.c 10 Jul 2005 20:16:53 -0000 1.26 @@ -446,9 +446,9 @@ for (y = 0; y < height; y++ ) { dstPtr = ptrCursorImage + wordAlignedWidth*y;; for (x = 0; x < width; x++ ) { - dstPtr[2] = (pixels[y*width+x] >> 0x10) & 0xFF; + dstPtr[0] = (pixels[y*width+x] >> 0x10) & 0xFF; dstPtr[1] = (pixels[y*width+x] >> 0x08) & 0xFF; - dstPtr[0] = pixels[y*width+x] & 0xFF; + dstPtr[2] = pixels[y*width+x] & 0xFF; dstPtr += 3; } } @@ -477,22 +477,22 @@ maskPixels = (unsigned char*)malloc(sizeof(unsigned char)*imageSize); memset(maskPixels, 0, imageSize); for (y = 0; y < height; y++) { - leftShift = 17; + leftShift = 7; mask = 0; maskPixelsOff = scanlineWidth*y; for (x = 0; x < width; x++) { - col = (pixels[width*y+x] & 0x01000000) >> leftShift; + col = (pixels[width*y+x] & 0x00000001) << leftShift; mask = mask | col; - leftShift++; - if (leftShift == 25) { + leftShift--; + if (leftShift == -1) { maskPixels[maskPixelsOff++] = ~mask; - leftShift = 17; + leftShift = 7; mask = 0; } } // write what is left over - if (leftShift != 17) { + if (leftShift != 7) { maskPixels[maskPixelsOff++] = ~mask; } } |
|
From: Kevin G. <kev...@us...> - 2005-07-10 20:16:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29439/src/java/org/lwjgl/opengl Modified Files: LinuxDisplay.java Win32Display.java Log Message: Fix size check bug in icon setting. Divide by four to get the size of the buffer in pixels. Index: Win32Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Win32Display.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- Win32Display.java 5 Jul 2005 22:09:44 -0000 1.20 +++ Win32Display.java 10 Jul 2005 20:15:55 -0000 1.21 @@ -176,7 +176,7 @@ int used = 0; for (int i=0;i<icons.length;i++) { - int size = icons[i].limit(); + int size = icons[i].limit() / 4; if ((((int) Math.sqrt(size)) == 16) && (!done16)) { nSetWindowIcon16(icons[i].asIntBuffer()); Index: LinuxDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- LinuxDisplay.java 5 Jul 2005 21:54:12 -0000 1.27 +++ LinuxDisplay.java 10 Jul 2005 20:15:55 -0000 1.28 @@ -452,7 +452,7 @@ */ public int setIcon(ByteBuffer[] icons) { for (int i=0;i<icons.length;i++) { - int size = icons[i].limit(); + int size = icons[i].limit() / 4; if (((int) Math.sqrt(size)) == 32) { nSetWindowIcon(icons[i]); |
|
From: Kevin G. <kev...@us...> - 2005-07-06 19:46:47
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv585/src/native/linux Modified Files: org_lwjgl_opengl_Display.c Log Message: Added Linux native code for window icon setting. Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- org_lwjgl_opengl_Display.c 5 Jul 2005 21:46:27 -0000 1.30 +++ org_lwjgl_opengl_Display.c 6 Jul 2005 19:46:35 -0000 1.31 @@ -78,6 +78,9 @@ static window_mode current_window_mode; static int current_height; static int current_width; +static int current_depth; + +static Visual *current_visual; static bool input_released; @@ -404,6 +407,10 @@ attribs.override_redirect = True; } win = XCreateWindow(getDisplay(), root_win, x, y, width, height, 0, vis_info->depth, InputOutput, vis_info->visual, attribmask, &attribs); + + current_depth = vis_info->depth; + current_visual = vis_info->visual; + XFree(vis_info); if (!checkXError(env, getDisplay())) { XFreeColormap(getDisplay(), cmap); @@ -569,10 +576,61 @@ jawt.Unlock(env); } +int setIcon(char *data,int width,int height) { + XWMHints* win_hints; + int x = 0; + int y = 5; + char r,g,b,a; + + int depth = 4; + + for (y=0;y<height;y++) { + for (x=0;x<width;x++) { + r = data[(x*4)+(y*width*4)]; + g = data[(x*4)+(y*width*4)+1]; + b = data[(x*4)+(y*width*4)+2]; + a = data[(x*4)+(y*width*4)+3]; + + data[(x*depth)+(y*width*depth)] = b; // blue + data[(x*depth)+(y*width*depth)+1] = g; // green + data[(x*depth)+(y*width*depth)+2] = r; + data[(x*depth)+(y*width*depth)+3] = a; + } + } + + Pixmap icon_pixmap = XCreatePixmap(getDisplay(), getCurrentWindow(), width, height, current_depth); + + XImage *image = XCreateImage(getDisplay(), current_visual, current_depth, ZPixmap, 0, data, width, height, 32, 0); + + GC gc = XCreateGC(getDisplay(), icon_pixmap, 0, NULL); + + XPutImage(getDisplay(), icon_pixmap, gc, image, 0, 0, 0, 0, width, height); + + win_hints = XAllocWMHints(); + if (!win_hints) { + return -1; + } + + win_hints->flags = IconPixmapHint; + win_hints->icon_pixmap = icon_pixmap; + + XSetWMHints(getDisplay(), getCurrentWindow(), win_hints); + XFree(win_hints); + XFlush(getDisplay()); + + return 0; +} + JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetWindowIcon (JNIEnv *env, jclass clazz, jobject iconBuffer) { + char *imgData = (char *)(*env)->GetDirectBufferAddress(env, iconBuffer); + if (setIcon(imgData,32,32) == 0) + { + return 1; + } + return 0; } |
|
From: Kevin G. <kev...@us...> - 2005-07-05 22:09:52
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29189/src/java/org/lwjgl/opengl Modified Files: Win32Display.java Log Message: Updated Win32 native interface to use IntBuffers rather than ByteBuffers Index: Win32Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Win32Display.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Win32Display.java 5 Jul 2005 21:54:12 -0000 1.19 +++ Win32Display.java 5 Jul 2005 22:09:44 -0000 1.20 @@ -179,12 +179,12 @@ int size = icons[i].limit(); if ((((int) Math.sqrt(size)) == 16) && (!done16)) { - nSetWindowIcon16(icons[i]); + nSetWindowIcon16(icons[i].asIntBuffer()); used++; done16 = true; } if ((((int) Math.sqrt(size)) == 32) && (!done32)) { - nSetWindowIcon32(icons[i]); + nSetWindowIcon32(icons[i].asIntBuffer()); used++; done32 = true; } @@ -193,7 +193,7 @@ return used; } - private static native int nSetWindowIcon16(ByteBuffer icon); + private static native int nSetWindowIcon16(IntBuffer icon); - private static native int nSetWindowIcon32(ByteBuffer icon); + private static native int nSetWindowIcon32(IntBuffer icon); } |
|
From: Kevin G. <kev...@us...> - 2005-07-05 22:09:04
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28787/src/native/win32 Modified Files: org_lwjgl_opengl_Display.c Log Message: Updated to actually convert the passed int buffer Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- org_lwjgl_opengl_Display.c 5 Jul 2005 21:45:02 -0000 1.24 +++ org_lwjgl_opengl_Display.c 5 Jul 2005 22:08:55 -0000 1.25 @@ -515,7 +515,7 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_nSetWindowIcon16 (JNIEnv *env, jclass clazz, jobject iconBuffer) { - int *imgData = NULL; + int *imgData = (int *)(*env)->GetDirectBufferAddress(env, iconBuffer); HICON newIcon = createWindowIcon(env, imgData, 16, 16); if (newIcon != NULL) { @@ -532,7 +532,7 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_nSetWindowIcon32 (JNIEnv *env, jclass clazz, jobject iconBuffer) { - int *imgData = NULL; + int *imgData = (int *)(*env)->GetDirectBufferAddress(env, iconBuffer); HICON newIcon = createWindowIcon(env, imgData, 32, 32); if (newIcon != NULL) { |
|
From: Kevin G. <kev...@us...> - 2005-07-05 21:54:21
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20948/src/java/org/lwjgl/opengl Modified Files: MacOSXDisplay.java LinuxDisplay.java DisplayImplementation.java Display.java Win32Display.java Log Message: Added methods to set the window icon. MacOS implementation added using AWT images. Index: Win32Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Win32Display.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- Win32Display.java 4 May 2005 20:59:36 -0000 1.18 +++ Win32Display.java 5 Jul 2005 21:54:12 -0000 1.19 @@ -156,4 +156,44 @@ public void releaseTexImageFromPbuffer(PeerInfo handle, int buffer) { ((Win32PbufferPeerInfo)handle).releaseTexImageFromPbuffer(buffer); } + + + /** + * Sets one or more icons for the Display. + * <ul> + * <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li> + * <li>Linux (and similar platforms) expect one 32x32 icon.</li> + * <li>Mac OS X should be supplied one 128x128 icon</li> + * </ul> + * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions nescesarry for the specific platform. + * + * @param icons Array of icons in RGBA mode + * @return number of icons used. + */ + public int setIcon(ByteBuffer[] icons) { + boolean done16 = false; + boolean done32 = false; + int used = 0; + + for (int i=0;i<icons.length;i++) { + int size = icons[i].limit(); + + if ((((int) Math.sqrt(size)) == 16) && (!done16)) { + nSetWindowIcon16(icons[i]); + used++; + done16 = true; + } + if ((((int) Math.sqrt(size)) == 32) && (!done32)) { + nSetWindowIcon32(icons[i]); + used++; + done32 = true; + } + } + + return used; + } + + private static native int nSetWindowIcon16(ByteBuffer icon); + + private static native int nSetWindowIcon32(ByteBuffer icon); } Index: DisplayImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/DisplayImplementation.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- DisplayImplementation.java 4 May 2005 20:59:36 -0000 1.13 +++ DisplayImplementation.java 5 Jul 2005 21:54:12 -0000 1.14 @@ -230,4 +230,18 @@ public void bindTexImageToPbuffer(PeerInfo handle, int buffer); public void releaseTexImageFromPbuffer(PeerInfo handle, int buffer); + + /** + * Sets one or more icons for the Display. + * <ul> + * <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li> + * <li>Linux (and similar platforms) expect one 32x32 icon.</li> + * <li>Mac OS X should be supplied one 128x128 icon</li> + * </ul> + * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions nescesarry for the specific platform. + * + * @param icons Array of icons in RGBA mode + * @return number of icons used. + */ + public int setIcon(ByteBuffer[] icons); } Index: MacOSXDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- MacOSXDisplay.java 1 Jun 2005 07:18:09 -0000 1.33 +++ MacOSXDisplay.java 5 Jul 2005 21:54:12 -0000 1.34 @@ -513,4 +513,44 @@ public void releaseTexImageFromPbuffer(PeerInfo handle, int buffer) { throw new UnsupportedOperationException(); } + + /** + * Sets one or more icons for the Display. + * <ul> + * <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li> + * <li>Linux (and similar platforms) expect one 32x32 icon.</li> + * <li>Mac OS X should be supplied one 128x128 icon</li> + * </ul> + * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions nescesarry for the specific platform. + * + * @param icons Array of icons in RGBA mode + * @return number of icons used. + */ + public int setIcon(ByteBuffer[] icons) { + int size = 0; + int biggest = -1; + + for (int i=0;i<icons.length;i++) { + if (icons[i].limit() > size) { + biggest = i; + size = icons[i].limit(); + } + } + + if (biggest == -1) { + return 0; + } + + int width; + int height; + + width = height = (int) Math.sqrt(size); + int[] imageData = icons[biggest].asIntBuffer().array(); + + BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); + img.setRGB(0, 0, width, height, imageData, 0, width); + frame.setIconImage(img); + + return 1; + } } Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Display.java,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- Display.java 29 Jun 2005 20:48:58 -0000 1.53 +++ Display.java 5 Jul 2005 21:54:12 -0000 1.54 @@ -43,6 +43,7 @@ * @author foo */ +import java.nio.ByteBuffer; import java.nio.FloatBuffer; import java.util.Arrays; import java.util.HashSet; @@ -813,4 +814,21 @@ public static String getVersion() { return display_impl.getVersion(); } + + + /** + * Sets one or more icons for the Display. + * <ul> + * <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li> + * <li>Linux (and similar platforms) expect one 32x32 icon.</li> + * <li>Mac OS X should be supplied one 128x128 icon</li> + * </ul> + * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions nescesarry for the specific platform. + * + * @param icons Array of icons in RGBA mode + * @return number of icons used. + */ + public static int setIcon(ByteBuffer[] icons) { + return display_impl.setIcon(icons); + } } Index: LinuxDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- LinuxDisplay.java 4 May 2005 20:59:36 -0000 1.26 +++ LinuxDisplay.java 5 Jul 2005 21:54:12 -0000 1.27 @@ -436,4 +436,32 @@ public void releaseTexImageFromPbuffer(PeerInfo handle, int buffer) { throw new UnsupportedOperationException(); } + + + /** + * Sets one or more icons for the Display. + * <ul> + * <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li> + * <li>Linux (and similar platforms) expect one 32x32 icon.</li> + * <li>Mac OS X should be supplied one 128x128 icon</li> + * </ul> + * The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions nescesarry for the specific platform. + * + * @param icons Array of icons in RGBA mode + * @return number of icons used. + */ + public int setIcon(ByteBuffer[] icons) { + for (int i=0;i<icons.length;i++) { + int size = icons[i].limit(); + + if (((int) Math.sqrt(size)) == 32) { + nSetWindowIcon(icons[i]); + return 1; + } + } + + return 0; + } + + private static native int nSetWindowIcon(ByteBuffer icon); } |
|
From: Kevin G. <kev...@us...> - 2005-07-05 21:46:40
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16662/src/native/linux Modified Files: org_lwjgl_opengl_Display.c Log Message: Added empty implementation of the window icon setting code in preperation for adding the Linux version. Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- org_lwjgl_opengl_Display.c 28 Jun 2005 15:19:32 -0000 1.29 +++ org_lwjgl_opengl_Display.c 5 Jul 2005 21:46:27 -0000 1.30 @@ -568,3 +568,11 @@ } jawt.Unlock(env); } + +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetWindowIcon + (JNIEnv *env, jclass clazz, jobject iconBuffer) +{ + + return 0; +} + |
|
From: Kevin G. <kev...@us...> - 2005-07-05 21:45:12
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15796/src/native/win32 Modified Files: org_lwjgl_opengl_Display.c Log Message: Added function to set the window icon on win32 Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- org_lwjgl_opengl_Display.c 29 Apr 2005 15:20:19 -0000 1.23 +++ org_lwjgl_opengl_Display.c 5 Jul 2005 21:45:02 -0000 1.24 @@ -400,3 +400,148 @@ SetWindowPos(display_hwnd, HWND_TOP, x, y, clientSize.right - clientSize.left, clientSize.bottom - clientSize.top, SWP_NOZORDER); } + +static HICON createWindowIcon(JNIEnv *env, jint *pixels, jint width, jint height) { + unsigned char col; + unsigned char mask; + BITMAPINFO bitmapInfo; + HBITMAP cursorMask; + HBITMAP colorBitmap; + ICONINFO iconInfo; + HICON icon; + char *ptrCursorImage; + int x, y; + char *dstPtr; + int pixelCount; + int scanlinePad; + int wordAlignedWidth; + int imageSize; + unsigned char *maskPixels; + int widthInBytes; + int leftShift; + int maskPixelsOff; + int scanlineWidth; + HBITMAP colorDIB; + + jsize pixelsLen = width * height; + + memset(&bitmapInfo, 0, sizeof(BITMAPINFO)); + bitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bitmapInfo.bmiHeader.biWidth = width; + bitmapInfo.bmiHeader.biHeight = -height; + bitmapInfo.bmiHeader.biPlanes = 1; + bitmapInfo.bmiHeader.biBitCount = 24; + bitmapInfo.bmiHeader.biCompression = BI_RGB; + + colorDIB = CreateDIBSection(GetDC(NULL), (BITMAPINFO*)&(bitmapInfo), + DIB_RGB_COLORS, (void**)&(ptrCursorImage), NULL, 0); + if (!ptrCursorImage) { + throwException(env, "Could not allocate DIB section."); + } + + wordAlignedWidth = width * 3; + if (wordAlignedWidth % sizeof(long) != 0) { + wordAlignedWidth = (wordAlignedWidth / sizeof(long)) * sizeof(long) + sizeof(long); + } + for (y = 0; y < height; y++ ) { + dstPtr = ptrCursorImage + wordAlignedWidth*y;; + for (x = 0; x < width; x++ ) { + dstPtr[2] = (pixels[y*width+x] >> 0x10) & 0xFF; + dstPtr[1] = (pixels[y*width+x] >> 0x08) & 0xFF; + dstPtr[0] = pixels[y*width+x] & 0xFF; + dstPtr += 3; + } + } + + + colorBitmap = CreateDIBitmap(GetDC(NULL), + (BITMAPINFOHEADER*)&bitmapInfo.bmiHeader, + CBM_INIT, + (void *)ptrCursorImage, + (BITMAPINFO*)&bitmapInfo, + DIB_RGB_COLORS); + + DeleteObject(colorDIB); + + // Convert alpha map to pixel packed mask + + // number of bytes it takes to fit a bit packed scan line. + widthInBytes = (width & 0x7) != 0 ? (width >> 3) + 1 : (width >> 3); + + // number of bytes it takes to fit WORD padded scan line. + scanlineWidth = widthInBytes; + if (scanlineWidth % sizeof(WORD) != 0) { + scanlineWidth = (scanlineWidth / sizeof(WORD)) * sizeof(WORD) + sizeof(WORD); + } + imageSize = scanlineWidth*height; + maskPixels = (unsigned char*)malloc(sizeof(unsigned char)*imageSize); + memset(maskPixels, 0, imageSize); + for (y = 0; y < height; y++) { + leftShift = 17; + mask = 0; + maskPixelsOff = scanlineWidth*y; + for (x = 0; x < width; x++) { + col = (pixels[width*y+x] & 0x01000000) >> leftShift; + mask = mask | col; + leftShift++; + if (leftShift == 25) { + maskPixels[maskPixelsOff++] = ~mask; + leftShift = 17; + mask = 0; + } + } + + // write what is left over + if (leftShift != 17) { + maskPixels[maskPixelsOff++] = ~mask; + } + } + cursorMask = CreateBitmap(width, height, 1, 1, maskPixels); + + memset(&iconInfo, 0, sizeof(ICONINFO)); + iconInfo.hbmMask = cursorMask; + iconInfo.hbmColor = colorBitmap; + iconInfo.fIcon = TRUE; + iconInfo.xHotspot = 0; + iconInfo.yHotspot = 0; + icon = CreateIconIndirect(&iconInfo); + DeleteObject(colorBitmap); + DeleteObject(cursorMask); + free(maskPixels); + + return icon; +} + +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_nSetWindowIcon16 + (JNIEnv *env, jclass clazz, jobject iconBuffer) +{ + int *imgData = NULL; + + HICON newIcon = createWindowIcon(env, imgData, 16, 16); + if (newIcon != NULL) { + if (display_hwnd != NULL) { + SendMessage(display_hwnd, WM_SETICON, ICON_SMALL, (LPARAM) (newIcon)); + + return 0; + } + } + + return -1; +} + +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_nSetWindowIcon32 + (JNIEnv *env, jclass clazz, jobject iconBuffer) +{ + int *imgData = NULL; + + HICON newIcon = createWindowIcon(env, imgData, 32, 32); + if (newIcon != NULL) { + if (display_hwnd != NULL) { + SendMessage(display_hwnd, WM_SETICON, ICON_BIG, (LPARAM) (newIcon)); + + return 0; + } + } + + return -1; +} \ No newline at end of file |