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
(10) |
3
(47) |
|
4
(12) |
5
(15) |
6
(14) |
7
(5) |
8
|
9
(1) |
10
|
|
11
(6) |
12
|
13
|
14
|
15
(3) |
16
(3) |
17
(5) |
|
18
|
19
(2) |
20
|
21
(11) |
22
(12) |
23
(5) |
24
(12) |
|
25
(6) |
26
(13) |
27
(2) |
28
(2) |
29
(9) |
30
(4) |
31
(2) |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-07-06 17:55:23
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26723/src/java/org/lwjgl/opengl Modified Files: GLContext.java Log Message: Removed debugging Index: GLContext.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLContext.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- GLContext.java 6 Jul 2004 17:22:22 -0000 1.18 +++ GLContext.java 6 Jul 2004 17:55:13 -0000 1.19 @@ -290,7 +290,6 @@ int gl_prefix_index = extension_string.indexOf("GL_"); if (gl_prefix_index == -1) continue; - System.out.println(extension_string); if (extension_string.equals("GL_EXT_texture_compression_s3tc")) { // Special workaround addExtensionClass(exts, exts_names, "EXTTextureCompressionS3TC", "GL_EXT_texture_compression_s3tc"); |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-07-06 17:22:33
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20108/src/java/org/lwjgl/opengl Modified Files: GLContext.java Log Message: Removed debugging Index: GLContext.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLContext.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- GLContext.java 6 Jul 2004 16:57:37 -0000 1.17 +++ GLContext.java 6 Jul 2004 17:22:22 -0000 1.18 @@ -332,7 +332,6 @@ exts.put(extension_class, ext_name); } catch (ClassNotFoundException e) { // ignore - Sys.log("No support for "+ext_class_name+" in LWJGL "+Sys.VERSION+": "+e); } catch (NoSuchMethodException e) { // ignore } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-07-06 16:57:47
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14627/src/java/org/lwjgl/opengl Modified Files: GLContext.java Log Message: Fixed a few special cases with extension names mapping Index: GLContext.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLContext.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- GLContext.java 5 Jul 2004 14:34:46 -0000 1.16 +++ GLContext.java 6 Jul 2004 16:57:37 -0000 1.17 @@ -281,6 +281,7 @@ } } + addExtensionClass(exts, exts_names, "EXTTextureCompressionS3TC", ""); String extensions_string = GL11.glGetString(GL11.GL_EXTENSIONS); StringTokenizer tokenizer = new StringTokenizer(extensions_string); while (tokenizer.hasMoreTokens()) { @@ -289,16 +290,28 @@ int gl_prefix_index = extension_string.indexOf("GL_"); if (gl_prefix_index == -1) continue; - for (int i = gl_prefix_index + 3; i < extension_string.length(); i++) { - char c; - if (extension_string.charAt(i) == '_') { - i++; - c = Character.toUpperCase(extension_string.charAt(i)); - } else - c = extension_string.charAt(i); - converted_name.append(c); + System.out.println(extension_string); + if (extension_string.equals("GL_EXT_texture_compression_s3tc")) { + // Special workaround + addExtensionClass(exts, exts_names, "EXTTextureCompressionS3TC", "GL_EXT_texture_compression_s3tc"); + } else if (extension_string.equals("GL_EXT_texture_lod_bias")) { + // Special workaround + addExtensionClass(exts, exts_names, "EXTTextureLODBias", "GL_EXT_texture_lod_bias"); + } else if (extension_string.equals("GL_NV_texture_compression_vtc")) { + // Special workaround + addExtensionClass(exts, exts_names, "NVTextureCompressionVTC", "GL_NV_texture_compression_vtc"); + } else { + for (int i = gl_prefix_index + 3; i < extension_string.length(); i++) { + char c; + if (extension_string.charAt(i) == '_') { + i++; + c = Character.toUpperCase(extension_string.charAt(i)); + } else + c = extension_string.charAt(i); + converted_name.append(c); + } + addExtensionClass(exts, exts_names, converted_name.toString(), extension_string); } - addExtensionClass(exts, exts_names, converted_name.toString(), extension_string); } addExtensionClass(exts, exts_names, "ARBBufferObject", null); addExtensionClass(exts, exts_names, "ARBProgram", null); @@ -306,14 +319,20 @@ } private static void addExtensionClass(Map exts, Set exts_names, String ext_class_name, String ext_name) { - if (ext_name != null) + if (ext_name != null) { + if (exts_names.contains(ext_name)) { + // Already added; ignore + return; + } exts_names.add(ext_name); + } try { Class extension_class = Class.forName("org.lwjgl.opengl." + ext_class_name); extension_class.getDeclaredMethod("initNativeStubs", null); // check for existance of initNativeStubs method exts.put(extension_class, ext_name); } catch (ClassNotFoundException e) { // ignore + Sys.log("No support for "+ext_class_name+" in LWJGL "+Sys.VERSION+": "+e); } catch (NoSuchMethodException e) { // ignore } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-07-06 16:30:42
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9679/src/java/org/lwjgl/opengl Modified Files: Display.java Log Message: Fixed null title bug Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Display.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Display.java 5 Jul 2004 14:34:46 -0000 1.11 +++ Display.java 6 Jul 2004 16:30:28 -0000 1.12 @@ -62,7 +62,6 @@ static { Sys.initialize(); current_mode = init(); - assert current_mode != null; Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { reset(); @@ -82,8 +81,8 @@ */ // private static int y; - /** Title of the window */ - private static String title; + /** Title of the window (never null) */ + private static String title = "Game"; /** Fullscreen */ private static boolean fullscreen; @@ -171,8 +170,7 @@ */ private static void createWindow() throws LWJGLException { nCreateWindow(current_mode, fullscreen); - if (title != null) - nSetTitle(title); + nSetTitle(title); initControls(); nSetVSyncEnabled(vsync); } @@ -212,6 +210,9 @@ * @param contrast The contrast, larger than 0.0. */ public static void setDisplayConfiguration(float gamma, float brightness, float contrast) throws LWJGLException { + if (!isCreated()) { + throw new LWJGLException("Display not yet created."); + } if (brightness < -1.0f || brightness > 1.0f) throw new IllegalArgumentException("Invalid brightness value"); if (contrast < 0.0f) @@ -268,11 +269,13 @@ public static native String getVersion(); /** - * Synchronize the display to a capped frame rate. + * Synchronize the display to a capped frame rate. Note that we are being "smart" about the + * desired results in our implementation; we automatically subtract 1 from the desired framerate + * to prevent just missing the frame time if vsync is set. * @param fps The desired frame rate, in frames per second */ public static void sync(int fps) { - float frameTime = 1.0f / (float) fps; + float frameTime = 1.0f / (float) (fps > 1 ? fps - 1 : 1); timeNow = Sys.getTime(); while (timeNow > timeThen && (float) (timeNow - timeThen) / (float) Sys.getTimerResolution() < frameTime) { // This is a system-friendly way of allowing other stuff to use CPU if it wants to @@ -310,8 +313,6 @@ * @return the title of the window */ public static String getTitle() { - if (!isCreated()) - throw new IllegalStateException("Cannot get title on uncreated window"); return title; } @@ -363,6 +364,9 @@ * @param newTitle The new window title */ public static void setTitle(String newTitle) { + if (newTitle == null) { + newTitle = ""; + } title = newTitle; if (isCreated()) nSetTitle(title); |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-07-06 16:08:29
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5024/src/java/org/lwjgl/test/input Modified Files: HWCursorTest.java ControllerFieldTest.java KeyboardTest.java MouseCreationTest.java MouseTest.java ControllerCreationTest.java ControllerTest.java Log Message: Organised imports Index: ControllerCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/ControllerCreationTest.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- ControllerCreationTest.java 3 Jul 2004 13:48:49 -0000 1.27 +++ ControllerCreationTest.java 6 Jul 2004 16:08:17 -0000 1.28 @@ -31,12 +31,11 @@ */ package org.lwjgl.test.input; -import org.lwjgl.opengl.Display; -import org.lwjgl.opengl.DisplayMode; import org.lwjgl.Sys; import org.lwjgl.input.Controller; -import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.DisplayMode; +import org.lwjgl.opengl.GL11; import org.lwjgl.util.vector.Vector2f; /** Index: ControllerFieldTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/ControllerFieldTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ControllerFieldTest.java 3 Jul 2004 13:48:49 -0000 1.3 +++ ControllerFieldTest.java 6 Jul 2004 16:08:17 -0000 1.4 @@ -78,7 +78,7 @@ * */ private void run() { - frame.show(); + frame.setVisible(true); String buttons; while(frame.isVisible()) { @@ -143,7 +143,6 @@ frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { - frame.hide(); frame.dispose(); } }); Index: MouseTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- MouseTest.java 3 Jul 2004 13:48:49 -0000 1.36 +++ MouseTest.java 6 Jul 2004 16:08:17 -0000 1.37 @@ -33,8 +33,8 @@ import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; import org.lwjgl.util.vector.Vector2f; import org.lwjgl.util.vector.Vector3f; Index: ControllerTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/ControllerTest.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- ControllerTest.java 3 Jul 2004 13:48:49 -0000 1.25 +++ ControllerTest.java 6 Jul 2004 16:08:17 -0000 1.26 @@ -33,8 +33,8 @@ import org.lwjgl.input.Controller; import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; import org.lwjgl.util.vector.Vector2f; import org.lwjgl.util.vector.Vector3f; Index: MouseCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseCreationTest.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- MouseCreationTest.java 3 Jul 2004 13:48:49 -0000 1.31 +++ MouseCreationTest.java 6 Jul 2004 16:08:17 -0000 1.32 @@ -31,12 +31,11 @@ */ package org.lwjgl.test.input; -import org.lwjgl.opengl.Display; -import org.lwjgl.opengl.DisplayMode; import org.lwjgl.Sys; import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.DisplayMode; +import org.lwjgl.opengl.GL11; import org.lwjgl.util.vector.Vector2f; /** Index: HWCursorTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/HWCursorTest.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- HWCursorTest.java 3 Jul 2004 13:48:49 -0000 1.34 +++ HWCursorTest.java 6 Jul 2004 16:08:17 -0000 1.35 @@ -35,13 +35,12 @@ import java.nio.ByteOrder; import java.nio.IntBuffer; -import org.lwjgl.opengl.Display; -import org.lwjgl.opengl.DisplayMode; import org.lwjgl.input.Cursor; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.DisplayMode; +import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.glu.GLU; /** Index: KeyboardTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- KeyboardTest.java 3 Jul 2004 13:48:49 -0000 1.27 +++ KeyboardTest.java 6 Jul 2004 16:08:17 -0000 1.28 @@ -31,10 +31,10 @@ */ package org.lwjgl.test.input; -import org.lwjgl.opengl.DisplayMode; import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.DisplayMode; +import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.glu.GLU; import org.lwjgl.util.vector.Vector2f; |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-07-06 16:08:29
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5024/src/java/org/lwjgl/test/opengl Modified Files: Game.java VBOTest.java PbufferTest.java Grass.java FullScreenWindowedTest.java VBOIndexTest.java Log Message: Organised imports Index: VBOIndexTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/VBOIndexTest.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- VBOIndexTest.java 3 Jul 2004 13:48:51 -0000 1.21 +++ VBOIndexTest.java 6 Jul 2004 16:08:17 -0000 1.22 @@ -41,19 +41,22 @@ package org.lwjgl.test.opengl; -import org.lwjgl.opengl.Display; -import org.lwjgl.opengl.DisplayMode; -import org.lwjgl.Sys; -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.*; -import org.lwjgl.opengl.glu.GLU; - import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.nio.IntBuffer; +import org.lwjgl.Sys; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.ARBBufferObject; +import org.lwjgl.opengl.ARBVertexBufferObject; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.DisplayMode; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.opengl.glu.GLU; + public final class VBOIndexTest { static { Index: FullScreenWindowedTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/FullScreenWindowedTest.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- FullScreenWindowedTest.java 3 Jul 2004 17:39:25 -0000 1.33 +++ FullScreenWindowedTest.java 6 Jul 2004 16:08:17 -0000 1.34 @@ -31,12 +31,11 @@ */ package org.lwjgl.test.opengl; -import org.lwjgl.opengl.Display; import org.lwjgl.LWJGLException; -import org.lwjgl.opengl.DisplayMode; import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.DisplayMode; +import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.glu.GLU; import org.lwjgl.util.vector.Vector2f; Index: Grass.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/Grass.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- Grass.java 3 Jul 2004 13:48:51 -0000 1.36 +++ Grass.java 6 Jul 2004 16:08:08 -0000 1.37 @@ -50,11 +50,14 @@ import java.util.Random; import org.lwjgl.BufferUtils; -import org.lwjgl.opengl.Display; -import org.lwjgl.opengl.DisplayMode; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.*; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.DisplayMode; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.opengl.NVProgram; +import org.lwjgl.opengl.NVVertexProgram; import org.lwjgl.opengl.glu.GLU; public class Grass { Index: VBOTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/VBOTest.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- VBOTest.java 3 Jul 2004 13:48:51 -0000 1.27 +++ VBOTest.java 6 Jul 2004 16:08:08 -0000 1.28 @@ -41,19 +41,22 @@ package org.lwjgl.test.opengl; -import org.lwjgl.opengl.Display; -import org.lwjgl.opengl.DisplayMode; -import org.lwjgl.Sys; -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.*; -import org.lwjgl.opengl.glu.GLU; - import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.nio.IntBuffer; +import org.lwjgl.Sys; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.ARBBufferObject; +import org.lwjgl.opengl.ARBVertexBufferObject; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.DisplayMode; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.opengl.glu.GLU; + public final class VBOTest { static { Index: PbufferTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/PbufferTest.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- PbufferTest.java 5 Jul 2004 14:34:46 -0000 1.36 +++ PbufferTest.java 6 Jul 2004 16:08:08 -0000 1.37 @@ -36,13 +36,12 @@ import java.nio.IntBuffer; import org.lwjgl.LWJGLException; -import org.lwjgl.opengl.PixelFormat; +import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.DisplayMode; -import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.Pbuffer; -import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.PixelFormat; import org.lwjgl.opengl.glu.GLU; import org.lwjgl.util.vector.Vector2f; Index: Game.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/Game.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- Game.java 3 Jul 2004 13:48:51 -0000 1.35 +++ Game.java 6 Jul 2004 16:08:08 -0000 1.36 @@ -39,15 +39,14 @@ */ package org.lwjgl.test.opengl; -import org.lwjgl.opengl.Display; -import org.lwjgl.opengl.DisplayMode; import org.lwjgl.Sys; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.DisplayMode; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL13; import org.lwjgl.opengl.Util; -import org.lwjgl.opengl.Display; public final class Game { static { |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-07-06 16:08:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5024/src/java/org/lwjgl/test/openal Modified Files: PositionTest.java Log Message: Organised imports Index: PositionTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PositionTest.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- PositionTest.java 3 Jul 2004 13:48:49 -0000 1.21 +++ PositionTest.java 6 Jul 2004 16:08:17 -0000 1.22 @@ -34,14 +34,13 @@ import java.nio.FloatBuffer; import java.nio.IntBuffer; -import org.lwjgl.opengl.Display; import org.lwjgl.Sys; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.openal.AL; import org.lwjgl.openal.AL10; -import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.glu.GLU; /** |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-07-06 16:07:13
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4708/src/java/org/lwjgl Modified Files: Sys.java Log Message: Index: Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- Sys.java 3 Jul 2004 17:39:24 -0000 1.49 +++ Sys.java 6 Jul 2004 16:06:59 -0000 1.50 @@ -33,11 +33,6 @@ import java.io.IOException; -import org.lwjgl.input.Controller; -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.Display; - /** * $Id$ * |
|
From: Elias N. <eli...@us...> - 2004-07-06 09:13:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23865/src/native/win32 Modified Files: org_lwjgl_input_Mouse.cpp Log Message: Win32: Mouse native cursor fixes 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.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- org_lwjgl_input_Mouse.cpp 6 Jul 2004 07:50:32 -0000 1.55 +++ org_lwjgl_input_Mouse.cpp 6 Jul 2004 09:13:35 -0000 1.56 @@ -59,7 +59,7 @@ static POINT cursorPos; static RECT windowRect; -static bool usingNativeCursor; +static bool mouse_grabbed; static int mouseMask = DISCL_NONEXCLUSIVE | DISCL_FOREGROUND; // Function prototypes (defined in the cpp file, since header file is generic across platforms @@ -81,6 +81,17 @@ clientRect->right += clientRect->left; } +static void resetCursorPos(void) { + /* Reset cursor position to middle of the window */ + RECT clientRect; + GetWindowRect(display_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); + GetCursorPos(&cursorPos); +} + JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nHasWheel(JNIEnv *, jclass) { return mHaswheel; } @@ -205,22 +216,12 @@ return 0; } -/* - * Class: org_lwjgl_input_Mouse - * Method: nIsNativeCursorSupported - * Signature: ()I - */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetNativeCursorCaps (JNIEnv *env, jclass clazz) { return org_lwjgl_input_Mouse_CURSOR_ONE_BIT_TRANSPARENCY; } -/* - * 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) { @@ -230,83 +231,52 @@ HCURSOR cursor = (HCURSOR)cursor_handle; SetClassLong(display_hwnd, GCL_HCURSOR, (LONG)cursor); SetCursor(cursor); - if (!usingNativeCursor) { - usingNativeCursor = true; - } } else { - if (usingNativeCursor) { - SetClassLong(display_hwnd, GCL_HCURSOR, (LONG)NULL); - SetCursor(LoadCursor(NULL, IDC_ARROW)); - usingNativeCursor = false; - } + SetClassLong(display_hwnd, GCL_HCURSOR, (LONG)NULL); + SetCursor(LoadCursor(NULL, IDC_ARROW)); } } -/* - * Class: org_lwjgl_input_Mouse - * Method: nGetMaxCursorSize - * Signature: ()I - */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetMaxCursorSize (JNIEnv *env, jclass clazz) { return GetSystemMetrics(SM_CXCURSOR); } -/* - * Class: org_lwjgl_input_Mouse - * Method: nGetMaxCursorSize - * Signature: ()I - */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetMinCursorSize (JNIEnv *env, jclass clazz) { return GetSystemMetrics(SM_CXCURSOR); } -/* - * Class: org_lwjgl_input_Mouse - * Method: nDestroy - * Signature: ()V - */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nDestroy(JNIEnv *env, jclass clazz) { ShutdownMouse(); } -/* - * Class: org_lwjgl_input_Mouse - * Method: nPoll - * Signature: ()V - */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nPoll(JNIEnv * env, jclass clazz, jobject coord_buffer_obj, jobject button_buffer_obj) { mDIDevice->Acquire(); 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(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(display_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(); + mDIDevice->Unacquire(); + if(grab) { + if (!mouse_grabbed) { + mouse_grabbed = true; + ShowCursor(false); + mouseMask = DISCL_EXCLUSIVE | DISCL_FOREGROUND; + } + } else { + if (mouse_grabbed) { + mouse_grabbed = false; + ShowCursor(true); + mouseMask = DISCL_NONEXCLUSIVE | DISCL_FOREGROUND; + } + resetCursorPos(); + } + mDIDevice->Unacquire(); if(mDIDevice->SetCooperativeLevel(display_hwnd, mouseMask) != DI_OK) { throwException(env, "Could not set the CooperativeLevel."); return; @@ -409,14 +379,7 @@ return; } mCreate_success = true; - - /* Reset cursor position to middle of the window */ - RECT clientRect; - GetWindowRect(display_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); + resetCursorPos(); } static int cap(int val, int min, int max) { @@ -488,11 +451,11 @@ } } - if (usingNativeCursor) { - getGDICursorDelta(&dx, &dy); - } else { + if (mouse_grabbed) { dx = diMouseState.lX; dy = diMouseState.lY; + } else { + getGDICursorDelta(&dx, &dy); } dy = -dy; |
|
From: Elias N. <eli...@us...> - 2004-07-06 08:06:25
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12167/src/native/linux Modified Files: Makefile.am org_lwjgl_opengl_Display.cpp org_lwjgl_opengl_Pbuffer.cpp Removed Files: org_lwjgl_opengl_GLContext.cpp Log Message: Undo GLContext.cpp split Index: org_lwjgl_opengl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Display.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_opengl_Display.cpp 5 Jul 2004 14:57:02 -0000 1.6 +++ org_lwjgl_opengl_Display.cpp 6 Jul 2004 08:06:15 -0000 1.7 @@ -55,6 +55,7 @@ #include "org_lwjgl_opengl_Display.h" #define USEGLX13 extgl_Extensions.GLX13 +#define ERR_MSG_SIZE 1024 static GLXContext context = NULL; // OpenGL rendering context static GLXWindow glx_window; @@ -78,6 +79,67 @@ static bool grab; static bool ignore_motion_events; +static int current_screen; +static Display *display_connection = NULL; +static int display_connection_usage = 0; +static bool async_x_error; +static char error_message[ERR_MSG_SIZE]; +static Atom warp_atom; + +Atom getWarpAtom(void) { + return warp_atom; +} + +int getCurrentScreen(void) { + return current_screen; +} + +bool checkXError(JNIEnv *env) { + XSync(getDisplay(), False); + if (async_x_error) { + async_x_error = false; + throwException(env, error_message); + return false; + } else + return true; +} + +static int errorHandler(Display *disp, XErrorEvent *error) { + char err_msg_buffer[ERR_MSG_SIZE]; + XGetErrorText(disp, error->error_code, err_msg_buffer, ERR_MSG_SIZE); + err_msg_buffer[ERR_MSG_SIZE - 1] = '\0'; + snprintf(error_message, ERR_MSG_SIZE, "X Error - serial: %d, error_code: %s, request_code: %d, minor_code: %d", (int)error->serial, err_msg_buffer, (int)error->request_code, (int)error->minor_code); + error_message[ERR_MSG_SIZE - 1] = '\0'; + async_x_error = true; + return 0; +} + + +Display *getDisplay(void) { + return display_connection; +} + +Display *incDisplay(JNIEnv *env) { + if (display_connection_usage == 0) { + async_x_error = false; + XSetErrorHandler(errorHandler); + display_connection = XOpenDisplay(NULL); + if (display_connection == NULL) { + throwException(env, "Could not open X display"); + return NULL; + } + warp_atom = XInternAtom(getDisplay(), "ignore_warp_atom", False); + } + display_connection_usage++; + return display_connection; +} + +void decDisplay(void) { + display_connection_usage--; + if (display_connection_usage == 0) + XCloseDisplay(display_connection); +} + static void waitMapped(Window win) { XEvent event; @@ -555,6 +617,17 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_createContext(JNIEnv *env, jclass clazz, jobject pixel_format) { + Display *disp = incDisplay(env); + if (disp == NULL) { + return; + } + current_screen = XDefaultScreen(disp); + if (!extgl_InitGLX(env, disp, current_screen)) { + decDisplay(); + throwException(env, "Could not init GLX"); + return; + } + if (USEGLX13) { initWindowGLX13(env, pixel_format); } else { @@ -564,6 +637,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_destroyContext(JNIEnv *env, jclass clazz) { destroyContext(); + decDisplay(); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nCreateWindow(JNIEnv *env, jclass clazz, jobject mode, jboolean fullscreen) { --- org_lwjgl_opengl_GLContext.cpp DELETED --- Index: Makefile.am =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Makefile.am,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Makefile.am 5 Jul 2004 14:57:02 -0000 1.15 +++ Makefile.am 6 Jul 2004 08:06:15 -0000 1.16 @@ -11,7 +11,6 @@ org_lwjgl_input_Cursor.cpp \ org_lwjgl_opengl_Display.cpp \ org_lwjgl_opengl_Pbuffer.cpp \ - org_lwjgl_opengl_GLContext.cpp \ display.cpp \ extgl_glx.cpp \ extxcursor.cpp Index: org_lwjgl_opengl_Pbuffer.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- org_lwjgl_opengl_Pbuffer.cpp 5 Jul 2004 14:57:02 -0000 1.19 +++ org_lwjgl_opengl_Pbuffer.cpp 6 Jul 2004 08:06:15 -0000 1.20 @@ -70,12 +70,23 @@ glXDestroyPbuffer(getDisplay(), buffer); glXDestroyContext(getDisplay(), context); free(buffer_info); + decDisplay(); } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Pbuffer_nCreate(JNIEnv *env, jclass clazz, jint width, jint height, jobject pixel_format, jobject pixelFormatCaps, jobject pBufferAttribs) { - Display *disp = getDisplay(); + Display *disp = incDisplay(env); + if (disp == NULL) { + return -1; + } + int current_screen = XDefaultScreen(disp); + if (!extgl_InitGLX(env, disp, current_screen)) { + decDisplay(); + throwException(env, "Could not init GLX"); + return -1; + } + GLXFBConfig *configs = chooseVisualGLX13(env, pixel_format, false, GLX_PBUFFER_BIT, false); if (configs == 0) { XFree(configs); |
|
From: Elias N. <eli...@us...> - 2004-07-06 08:06:24
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12167/src/native/win32 Removed Files: org_lwjgl_opengl_GLContext.cpp Log Message: Undo GLContext.cpp split --- org_lwjgl_opengl_GLContext.cpp DELETED --- |
|
From: Elias N. <eli...@us...> - 2004-07-06 08:06:24
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12167/src/native/macosx Removed Files: org_lwjgl_opengl_GLContext.cpp Log Message: Undo GLContext.cpp split --- org_lwjgl_opengl_GLContext.cpp DELETED --- |
|
From: Elias N. <eli...@us...> - 2004-07-06 08:06:23
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12167/src/native/common Modified Files: Makefile.am Added Files: org_lwjgl_opengl_GLContext.cpp Log Message: Undo GLContext.cpp split Index: Makefile.am =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/Makefile.am,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Makefile.am 5 Jul 2004 14:57:01 -0000 1.22 +++ Makefile.am 6 Jul 2004 08:06:00 -0000 1.23 @@ -37,6 +37,7 @@ org_lwjgl_openal_eax_EAXBufferProperties.h \ org_lwjgl_openal_eax_EAXListenerProperties.cpp \ org_lwjgl_openal_eax_EAXListenerProperties.h \ + org_lwjgl_opengl_GLContext.cpp \ org_lwjgl_opengl_GL11.cpp \ org_lwjgl_opengl_GL11.h \ org_lwjgl_opengl_GL12.cpp \ --- NEW FILE: org_lwjgl_opengl_GLContext.cpp --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "org_lwjgl_opengl_GLContext.h" #include "extgl.h" JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_nLoadOpenGLLibrary(JNIEnv * env, jclass clazz) { if (!extgl_Open()) { throwException(env, "Failed to load OpenGL library"); return; } } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_nUnloadOpenGLLibrary(JNIEnv * env, jclass clazz) { extgl_Close(); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLContext_resetNativeStubs(JNIEnv *env, jclass clazz, jclass gl_class) { env->UnregisterNatives(gl_class); } |
|
From: Elias N. <eli...@us...> - 2004-07-06 07:50:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9339/src/native/win32 Modified Files: Window.h org_lwjgl_Sys.cpp org_lwjgl_input_Controller.cpp org_lwjgl_input_Cursor.cpp org_lwjgl_input_Keyboard.cpp org_lwjgl_input_Mouse.cpp org_lwjgl_opengl_Display.cpp org_lwjgl_opengl_Pbuffer.cpp Log Message: Win32: Make pbuffer creation independent of display context Index: org_lwjgl_opengl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Display.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- org_lwjgl_opengl_Display.cpp 5 Jul 2004 14:34:47 -0000 1.12 +++ org_lwjgl_opengl_Display.cpp 6 Jul 2004 07:50:33 -0000 1.13 @@ -49,9 +49,9 @@ static bool oneShotInitialised = false; // Registers the LWJGL window class -HWND hwnd = NULL; // Handle to the window -HDC hdc = NULL; // Device context -HGLRC hglrc = NULL; // OpenGL context +HWND display_hwnd = NULL; // Handle to the window +HDC display_hdc = NULL; // Device context +HGLRC display_hglrc = NULL; // OpenGL context static bool isFullScreen = false; // Whether we're fullscreen or not static bool isMinimized = false; // Whether we're minimized or not static bool isFocused = false; // whether we're focused or not @@ -65,7 +65,7 @@ #define WINDOWCLASSNAME "LWJGL" -static bool applyPixelFormat(JNIEnv *env, HDC hdc, int iPixelFormat) { +bool applyPixelFormat(JNIEnv *env, HDC hdc, int iPixelFormat) { PIXELFORMATDESCRIPTOR desc; if (DescribePixelFormat(hdc, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &desc) == 0) { throwException(env, "Could not describe pixel format"); @@ -80,7 +80,7 @@ return true; } -static int findPixelFormatARBFromBPP(JNIEnv *env, jobject pixel_format, jobject pixelFormatCaps, int bpp, bool window, bool double_buffer) { +static int findPixelFormatARBFromBPP(JNIEnv *env, HDC hdc, jobject pixel_format, jobject pixelFormatCaps, int bpp, bool window, bool double_buffer) { jclass cls_pixel_format = env->GetObjectClass(pixel_format); int alpha = (int)env->GetIntField(pixel_format, env->GetFieldID(cls_pixel_format, "alpha", "I")); int depth = (int)env->GetIntField(pixel_format, env->GetFieldID(cls_pixel_format, "depth", "I")); @@ -137,25 +137,25 @@ return iPixelFormat; } -int findPixelFormatARB(JNIEnv *env, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool double_buffer) { +int findPixelFormatARB(JNIEnv *env, HDC hdc, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool double_buffer) { int bpp; jclass cls_pixel_format = env->GetObjectClass(pixel_format); if (use_hdc_bpp) { bpp = GetDeviceCaps(hdc, BITSPIXEL); - int iPixelFormat = findPixelFormatARBFromBPP(env, pixel_format, pixelFormatCaps, bpp, window, double_buffer); + int iPixelFormat = findPixelFormatARBFromBPP(env, hdc, pixel_format, pixelFormatCaps, bpp, window, double_buffer); if (iPixelFormat == -1) bpp = 16; else return iPixelFormat; } else bpp = (int)env->GetIntField(pixel_format, env->GetFieldID(cls_pixel_format, "bpp", "I")); - return findPixelFormatARBFromBPP(env, pixel_format, pixelFormatCaps, bpp, window, double_buffer); + return findPixelFormatARBFromBPP(env, hdc, pixel_format, pixelFormatCaps, bpp, window, double_buffer); } /* * Find an appropriate pixel format */ -static int findPixelFormatFromBPP(JNIEnv *env, jobject pixel_format, int bpp) +static int findPixelFormatFromBPP(JNIEnv *env, HDC hdc, jobject pixel_format, int bpp) { jclass cls_pixel_format = env->GetObjectClass(pixel_format); int alpha = (int)env->GetIntField(pixel_format, env->GetFieldID(cls_pixel_format, "alpha", "I")); @@ -240,13 +240,13 @@ return iPixelFormat; } -static int findPixelFormat(JNIEnv *env, jobject pixel_format) { +int findPixelFormat(JNIEnv *env, HDC hdc, jobject pixel_format) { int bpp; jclass cls_pixel_format = env->GetObjectClass(pixel_format); bpp = GetDeviceCaps(hdc, BITSPIXEL); - int iPixelFormat = findPixelFormatFromBPP(env, pixel_format, bpp); + int iPixelFormat = findPixelFormatFromBPP(env, hdc, pixel_format, bpp); if (iPixelFormat == -1) { - return findPixelFormatFromBPP(env, pixel_format, 16); + return findPixelFormatFromBPP(env, hdc, pixel_format, 16); } else return iPixelFormat; } @@ -254,7 +254,7 @@ /* * Close the window */ -static void closeWindow() +void closeWindow(HWND hwnd, HDC hdc) { // Release device context if (hdc != NULL && hwnd != NULL) { @@ -278,10 +278,10 @@ static void appActivate(bool active) { if (active) { - SetForegroundWindow(hwnd); - ShowWindow(hwnd, SW_RESTORE); + SetForegroundWindow(display_hwnd); + ShowWindow(display_hwnd, SW_RESTORE); } else if (isFullScreen) { - ShowWindow(hwnd, SW_MINIMIZE); + ShowWindow(display_hwnd, SW_MINIMIZE); } } @@ -391,7 +391,7 @@ MSG msg; while (PeekMessage( &msg, // message information - hwnd, // handle to window + display_hwnd, // handle to window 0, // first message 0, // last message PM_REMOVE // removal options @@ -409,10 +409,16 @@ * * Returns true for success, or false for failure */ -static bool createWindow(JNIEnv *env, int width, int height, bool fullscreen, bool undecorated) +HWND createWindow(JNIEnv *env, int width, int height, bool fullscreen, bool undecorated) { int exstyle, windowflags; + // 1. Register window class if necessary + if (!registerWindow()) { + throwException(env, "Could not register window class"); + return NULL; + } + if (fullscreen) { exstyle = WS_EX_APPWINDOW | WS_EX_TOPMOST; windowflags = WS_POPUP; @@ -439,7 +445,7 @@ ); // Create the window now, using that class: - hwnd = CreateWindowEx ( + HWND new_hwnd = CreateWindowEx ( exstyle, WINDOWCLASSNAME, "", @@ -450,13 +456,12 @@ dll_handle, NULL); - if (hwnd == NULL) { + if (new_hwnd == NULL) { throwException(env, "Failed to create the window."); - return false; + return NULL; } - hdc = GetDC(hwnd); - return true; + return new_hwnd; } /* @@ -468,7 +473,7 @@ (JNIEnv * env, jclass clazz, jstring title_obj) { const char * title = env->GetStringUTFChars(title_obj, NULL); - SetWindowText(hwnd, title); + SetWindowText(display_hwnd, title); env->ReleaseStringUTFChars(title_obj, title); } @@ -493,8 +498,7 @@ (JNIEnv * env, jclass clazz) { isDirty = false; - SwapBuffers(hdc); -// wglSwapLayerBuffers(hdc, WGL_SWAP_MAIN_PLANE); + SwapBuffers(display_hdc); } /* @@ -561,7 +565,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nMakeCurrent (JNIEnv *env, jclass clazz) { - BOOL result = wglMakeCurrent(hdc, hglrc); + BOOL result = wglMakeCurrent(display_hdc, display_hglrc); if (!result) throwException(env, "Could not make display context current"); } @@ -620,29 +624,31 @@ int width = env->GetIntField(mode, fid_width); int height = env->GetIntField(mode, fid_height); - if (!createWindow(env, width, height, isFullScreen, isUndecorated)) { + display_hwnd = createWindow(env, width, height, isFullScreen, isUndecorated); + if (display_hwnd == NULL) { return; } - if (!applyPixelFormat(env, hdc, pixel_format_index)) { - closeWindow(); + display_hdc = GetDC(display_hwnd); + if (!applyPixelFormat(env, display_hdc, pixel_format_index)) { + closeWindow(display_hwnd, display_hdc); return; } - BOOL result = wglMakeCurrent(hdc, hglrc); + BOOL result = wglMakeCurrent(display_hdc, display_hglrc); if (!result) { throwException(env, "Could not bind context to window"); - closeWindow(); + closeWindow(display_hwnd, display_hdc); return; } extgl_InitWGL(env); - ShowWindow(hwnd, SW_SHOW); - UpdateWindow(hwnd); - SetForegroundWindow(hwnd); - SetFocus(hwnd); + ShowWindow(display_hwnd, SW_SHOW); + UpdateWindow(display_hwnd); + SetForegroundWindow(display_hwnd); + SetFocus(display_hwnd); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nDestroyWindow(JNIEnv *env, jclass clazz) { - closeWindow(); + closeWindow(display_hwnd, display_hdc); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_switchDisplayMode(JNIEnv *env, jclass clazz, jobject mode) { @@ -674,35 +680,31 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_createContext(JNIEnv *env, jclass clazz, jobject pixel_format) { - // 1. Register window class if necessary - if (!registerWindow()) { - throwException(env, "Could not register window class"); - return; - } - - if (!createWindow(env, 1, 1, false, false)) { + HWND dummy_hwnd = createWindow(env, 1, 1, false, false); + if (dummy_hwnd == NULL) { return; } - pixel_format_index = findPixelFormat(env, pixel_format); + HDC dummy_hdc = GetDC(dummy_hwnd); + pixel_format_index = findPixelFormat(env, dummy_hdc, pixel_format); if (pixel_format_index == -1) { return; } - // Special option for allowing software opengl - if (!applyPixelFormat(env, hdc, pixel_format_index)) { - closeWindow(); + if (!applyPixelFormat(env, dummy_hdc, pixel_format_index)) { + closeWindow(dummy_hwnd, dummy_hdc); return; } - hglrc = wglCreateContext(hdc); - if (hglrc == NULL) { + display_hglrc = wglCreateContext(dummy_hdc); + if (display_hglrc == NULL) { + closeWindow(dummy_hwnd, dummy_hdc); throwException(env, "Failed to create OpenGL rendering context"); return; } - BOOL result = wglMakeCurrent(hdc, hglrc); + BOOL result = wglMakeCurrent(dummy_hdc, display_hglrc); if (!result) { - throwException(env, "Could not bid context to dummy window"); - wglDeleteContext(hglrc); - closeWindow(); + throwException(env, "Could not bind context to dummy window"); + wglDeleteContext(display_hglrc); + closeWindow(dummy_hwnd, dummy_hdc); return; } // Some crazy strangeness here so we can use ARB_pixel_format to specify the number @@ -710,37 +712,39 @@ // rendering context and start over, using the ARB extension instead to pick the context. extgl_InitWGL(env); if (extgl_Extensions.WGL_ARB_pixel_format) { - pixel_format_index = findPixelFormatARB(env, pixel_format, NULL, true, true, true); + pixel_format_index = findPixelFormatARB(env, dummy_hdc, pixel_format, NULL, true, true, true); wglMakeCurrent(NULL, NULL); - wglDeleteContext(hglrc); - closeWindow(); + wglDeleteContext(display_hglrc); + closeWindow(dummy_hwnd, dummy_hdc); if (pixel_format_index == -1) { return; } - if (!createWindow(env, 1, 1, false, false)) { + dummy_hwnd = createWindow(env, 1, 1, false, false); + if (dummy_hwnd == NULL) { return; } - if (!applyPixelFormat(env, hdc, pixel_format_index)) { - closeWindow(); + dummy_hdc = GetDC(dummy_hwnd); + if (!applyPixelFormat(env, dummy_hdc, pixel_format_index)) { + closeWindow(dummy_hwnd, dummy_hdc); return; } - hglrc = wglCreateContext(hdc); - closeWindow(); - if (hglrc == NULL) { + display_hglrc = wglCreateContext(dummy_hdc); + closeWindow(dummy_hwnd, dummy_hdc); + if (display_hglrc == NULL) { throwException(env, "Failed to create OpenGL rendering context (ARB)"); return; } } else - closeWindow(); + closeWindow(dummy_hwnd, dummy_hdc); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_destroyContext(JNIEnv *env, jclass clazz) { wglMakeCurrent(NULL, NULL); // Delete the rendering context - if (hglrc != NULL) { + if (display_hglrc != NULL) { printfDebug("Deleting GL context\n"); - wglDeleteContext(hglrc); - hglrc = NULL; + wglDeleteContext(display_hglrc); + display_hglrc = NULL; } } Index: org_lwjgl_input_Controller.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Controller.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- org_lwjgl_input_Controller.cpp 12 Jun 2004 20:28:33 -0000 1.22 +++ org_lwjgl_input_Controller.cpp 6 Jul 2004 07:50:32 -0000 1.23 @@ -53,7 +53,6 @@ #define CONTROLLER_AXISMIN -1000 // Minimum range to which we'll gauge the swing extern HINSTANCE dll_handle; -extern HWND hwnd; static IDirectInput* cDI; // DI instance static IDirectInputDevice2* cDIDevice; // DI Device instance @@ -117,13 +116,6 @@ * Called when the Controller instance is to be created */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Controller_nCreate(JNIEnv *env, jclass clazz) { - - // assert that window has been created - if(hwnd == NULL) { - throwException(env, "Please create the window before initializing input devices"); - return; - } - // Create the DirectInput object. HRESULT hr; hr = DirectInputCreate(dll_handle, DIRECTINPUT_VERSION, &cDI, NULL); @@ -326,7 +318,7 @@ } // set the cooperative level - if(cDIDevice->SetCooperativeLevel(hwnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { + if(cDIDevice->SetCooperativeLevel(display_hwnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { printfDebug("SetCooperativeLevel failed\n"); cCreate_success = false; return; Index: Window.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/Window.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Window.h 3 Jul 2004 10:42:29 -0000 1.12 +++ Window.h 6 Jul 2004 07:50:32 -0000 1.13 @@ -52,20 +52,29 @@ #else #define WINDOW_H_API extern - extern HWND hwnd; // Handle to the window - extern HDC hdc; // Device context + extern HWND display_hwnd; // Handle to the window + extern HDC display_hdc; // Device context extern bool isFullScreen; // Whether we're fullscreen or not extern bool isMinimized; // Whether we're minimized or not extern bool isFocused; // Whether we're focused or not extern bool isDirty; // Whether we're dirty or not extern RECT clientSize; - extern HGLRC hglrc; + extern HGLRC display_hglrc; #endif /* _PRIVATE_WINDOW_H_ */ + WINDOW_H_API bool applyPixelFormat(JNIEnv *env, HDC hdc, int iPixelFormat); + + WINDOW_H_API void closeWindow(HWND hwnd, HDC hdc); + + /* + * Find a suitable pixel format + */ + WINDOW_H_API int findPixelFormat(JNIEnv *env, HDC hdc, jobject pixel_format); + /* * Find a suitable pixel format using the WGL_ARB_pixel_format extension */ - WINDOW_H_API int findPixelFormatARB(JNIEnv *env, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool double_buffer); + WINDOW_H_API int findPixelFormatARB(JNIEnv *env, HDC hdc, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool double_buffer); /* * Create a window with the specified title, position, size, and @@ -74,7 +83,7 @@ * * Returns true for success, or false for failure */ - WINDOW_H_API bool createWindow(const char * title, int x, int y, int width, int height, bool fullscreen); + WINDOW_H_API HWND createWindow(JNIEnv *env, int width, int height, bool fullscreen, bool undecorated); /* Index: org_lwjgl_opengl_Pbuffer.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Pbuffer.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- org_lwjgl_opengl_Pbuffer.cpp 4 Jul 2004 08:39:09 -0000 1.12 +++ org_lwjgl_opengl_Pbuffer.cpp 6 Jul 2004 07:50:33 -0000 1.13 @@ -91,11 +91,41 @@ jint width, jint height, jobject pixel_format, jobject pixelFormatCaps, jobject pBufferAttribs) { - int iPixelFormat = findPixelFormatARB(env, pixel_format, pixelFormatCaps, false, false, false); + HWND dummy_hwnd = createWindow(env, 1, 1, false, false); + if (dummy_hwnd == NULL) { + return (jint)NULL; + } + HDC dummy_hdc = GetDC(dummy_hwnd); + int iPixelFormat = findPixelFormat(env, dummy_hdc, pixel_format); if (iPixelFormat == -1) { - throwException(env, "Could not choose pixel formats."); return (jint)NULL; + } + if (!applyPixelFormat(env, dummy_hdc, iPixelFormat)) { + closeWindow(dummy_hwnd, dummy_hdc); + return (jint)NULL; + } + + HGLRC dummy_hglrc = wglCreateContext(dummy_hdc); + if (dummy_hglrc == NULL) { + closeWindow(dummy_hwnd, dummy_hdc); + throwException(env, "Failed to create OpenGL rendering context"); + return (jint)NULL; + } + BOOL result = wglMakeCurrent(dummy_hdc, dummy_hglrc); + if (!result) { + wglDeleteContext(dummy_hglrc); + closeWindow(dummy_hwnd, dummy_hdc); + throwException(env, "Could not bind context to dummy window"); + return (jint)NULL; + } + extgl_InitWGL(env); + iPixelFormat = findPixelFormatARB(env, dummy_hdc, pixel_format, pixelFormatCaps, false, false, false); + if (iPixelFormat == -1) { + wglDeleteContext(dummy_hglrc); + closeWindow(dummy_hwnd, dummy_hdc); + throwException(env, "Could not choose pixel formats."); + return (jint)NULL; } HPBUFFERARB Pbuffer; @@ -112,10 +142,12 @@ pBufferAttribList[i] = 0; - Pbuffer = wglCreatePbufferARB(hdc, iPixelFormat, width, height, pBufferAttribList); + Pbuffer = wglCreatePbufferARB(dummy_hdc, iPixelFormat, width, height, pBufferAttribList); } else { - Pbuffer = wglCreatePbufferARB(hdc, iPixelFormat, width, height, NULL); + Pbuffer = wglCreatePbufferARB(dummy_hdc, iPixelFormat, width, height, NULL); } + wglDeleteContext(dummy_hglrc); + closeWindow(dummy_hwnd, dummy_hdc); if (Pbuffer == NULL) { throwException(env, "Could not create Pbuffer."); @@ -138,13 +170,12 @@ return (jint)NULL; } - if (!wglShareLists(hglrc, Pbuffer_context)) { + if (display_hglrc != NULL && !wglShareLists(display_hglrc, Pbuffer_context)) { wglDeleteContext(Pbuffer_context); wglReleasePbufferDCARB(Pbuffer, Pbuffer_dc); wglDestroyPbufferARB(Pbuffer); throwException(env, "Could not share buffer context."); return (jint)NULL; - } PbufferInfo *Pbuffer_info = (PbufferInfo *)malloc(sizeof(PbufferInfo)); @@ -158,7 +189,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nReleaseContext (JNIEnv *env, jclass clazz) { - wglMakeCurrent(hdc, hglrc); + wglMakeCurrent(display_hdc, display_hglrc); } JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_Pbuffer_nIsBufferLost 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.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- org_lwjgl_input_Mouse.cpp 12 Jun 2004 20:28:34 -0000 1.54 +++ org_lwjgl_input_Mouse.cpp 6 Jul 2004 07:50:32 -0000 1.55 @@ -73,7 +73,7 @@ static void getScreenClientRect(RECT* clientRect, RECT* windowRect) { - GetClientRect(hwnd, clientRect); + GetClientRect(display_hwnd, clientRect); // transform clientRect to screen coordinates clientRect->top = -clientSize.top + windowRect->top; clientRect->left = -clientSize.left + windowRect->left; @@ -228,14 +228,14 @@ throwException(env, "null device!"); if (cursor_handle != 0) { HCURSOR cursor = (HCURSOR)cursor_handle; - SetClassLong(hwnd, GCL_HCURSOR, (LONG)cursor); + SetClassLong(display_hwnd, GCL_HCURSOR, (LONG)cursor); SetCursor(cursor); if (!usingNativeCursor) { usingNativeCursor = true; } } else { if (usingNativeCursor) { - SetClassLong(hwnd, GCL_HCURSOR, (LONG)NULL); + SetClassLong(display_hwnd, GCL_HCURSOR, (LONG)NULL); SetCursor(LoadCursor(NULL, IDC_ARROW)); usingNativeCursor = false; } @@ -300,14 +300,14 @@ /* Reset cursor position to middle of the window */ RECT clientRect; - GetWindowRect(hwnd, &windowRect); + GetWindowRect(display_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) { + if(mDIDevice->SetCooperativeLevel(display_hwnd, mouseMask) != DI_OK) { throwException(env, "Could not set the CooperativeLevel."); return; } @@ -403,7 +403,7 @@ mDIDevice->SetProperty(DIPROP_BUFFERSIZE, &dipropdw.diph); // set the cooperative level - if(mDIDevice->SetCooperativeLevel(hwnd, mouseMask) != DI_OK) { + if(mDIDevice->SetCooperativeLevel(display_hwnd, mouseMask) != DI_OK) { printfDebug("SetCooperativeLevel failed\n"); mCreate_success = false; return; @@ -412,11 +412,11 @@ /* Reset cursor position to middle of the window */ RECT clientRect; - GetWindowRect(hwnd, &windowRect); + GetWindowRect(display_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); + SetCursorPos(cursorPos.x, cursorPos.y); } static int cap(int val, int min, int max) { @@ -436,7 +436,7 @@ GetCursorPos(&newCursorPos); RECT clientRect; RECT newWindowRect; - GetWindowRect(hwnd, &newWindowRect); + GetWindowRect(display_hwnd, &newWindowRect); cursorPos.x += newWindowRect.left - windowRect.left; cursorPos.y += newWindowRect.top - windowRect.top; windowRect = newWindowRect; Index: org_lwjgl_input_Keyboard.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/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 Jun 2004 20:28:34 -0000 1.33 +++ org_lwjgl_input_Keyboard.cpp 6 Jul 2004 07:50:32 -0000 1.34 @@ -81,7 +81,7 @@ return; } - if (hwnd == NULL) { + if (display_hwnd == NULL) { throwException(env, "No window."); return; } @@ -92,7 +92,7 @@ return; } - if (lpdiKeyboard->SetCooperativeLevel(hwnd, DISCL_NONEXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { + if (lpdiKeyboard->SetCooperativeLevel(display_hwnd, DISCL_NONEXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { throwException(env, "Failed to set keyboard cooperation mode."); 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.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- org_lwjgl_input_Cursor.cpp 12 Jun 2004 20:28:34 -0000 1.11 +++ org_lwjgl_input_Cursor.cpp 6 Jul 2004 07:50:32 -0000 1.12 @@ -70,7 +70,7 @@ bitmapInfo.bmiHeader.biBitCount = 24; bitmapInfo.bmiHeader.biCompression = BI_RGB; - colorDIB = CreateDIBSection(hdc, (BITMAPINFO*)&(bitmapInfo), + colorDIB = CreateDIBSection(GetDC(NULL), (BITMAPINFO*)&(bitmapInfo), DIB_RGB_COLORS, (void**)&(ptrCursorImage), NULL, 0); @@ -91,7 +91,7 @@ } } - colorBitmap = CreateDIBitmap(hdc, + colorBitmap = CreateDIBitmap(GetDC(NULL), (BITMAPINFOHEADER*)&bitmapInfo.bmiHeader, CBM_INIT, (void *)ptrCursorImage, Index: org_lwjgl_Sys.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Sys.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- org_lwjgl_Sys.cpp 12 Jun 2004 20:28:33 -0000 1.26 +++ org_lwjgl_Sys.cpp 6 Jul 2004 07:50:32 -0000 1.27 @@ -42,9 +42,7 @@ #include <windows.h> #include "org_lwjgl_Sys.h" #include "common_tools.h" - -// Handle to the application's window -extern HWND hwnd; +#include "Window.h" unsigned __int64 hires_timer_freq = 0; // Hires timer frequency unsigned __int64 hires_timer = 0; // Hires timer current time @@ -125,7 +123,7 @@ jboolean copy = JNI_FALSE; const char * eMessageText = env->GetStringUTFChars(message, ©); const char * cTitleBarText = env->GetStringUTFChars(title, ©); - MessageBox(hwnd, eMessageText, cTitleBarText, MB_OK | MB_TOPMOST); + MessageBox(display_hwnd, eMessageText, cTitleBarText, MB_OK | MB_TOPMOST); printfDebug("*** Alert ***%s\n%s\n", cTitleBarText, eMessageText); |