You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
1
(1) |
|
2
(6) |
3
(8) |
4
(1) |
5
|
6
(6) |
7
(3) |
8
(2) |
|
9
|
10
|
11
|
12
|
13
(4) |
14
|
15
|
|
16
(12) |
17
(4) |
18
(1) |
19
(8) |
20
|
21
(12) |
22
(4) |
|
23
(4) |
24
(14) |
25
|
26
|
27
(20) |
28
(31) |
29
(3) |
|
30
(13) |
31
(1) |
|
|
|
|
|
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-03-24 22:16:04
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl
In directory sc8-pr-cvs1:/tmp/cvs-serv8086/src/java/org/lwjgl
Modified Files:
Tag: experimental
Sys.java
Log Message:
Index: Sys.java
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v
retrieving revision 1.16.2.2
retrieving revision 1.16.2.3
diff -u -d -r1.16.2.2 -r1.16.2.3
--- Sys.java 24 Mar 2003 22:12:14 -0000 1.16.2.2
+++ Sys.java 24 Mar 2003 22:15:58 -0000 1.16.2.3
@@ -124,6 +124,9 @@
}
}
+ /** The game title */
+ private static String title;
+
/**
* No constructor for Sys.
*/
@@ -283,6 +286,7 @@
public static void mainLoop(Game game) {
try {
+ title = game.getTitle();
game.init();
boolean wasMinimized = true;
@@ -333,7 +337,7 @@
}
} catch (Throwable t) {
t.printStackTrace(System.err);
- alert(game.getTitle(), "An internal error has occurred.");
+ alert(title, "An internal error has occurred.");
} finally {
try {
game.cleanup();
|
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-03-24 22:12:20
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl
In directory sc8-pr-cvs1:/tmp/cvs-serv1547/src/java/org/lwjgl
Modified Files:
Tag: experimental
Sys.java
Log Message:
Index: Sys.java
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v
retrieving revision 1.16.2.1
retrieving revision 1.16.2.2
diff -u -d -r1.16.2.1 -r1.16.2.2
--- Sys.java 24 Mar 2003 21:41:12 -0000 1.16.2.1
+++ Sys.java 24 Mar 2003 22:12:14 -0000 1.16.2.2
@@ -107,10 +107,6 @@
*/
public static final boolean DEBUG;
- /** Finish flag. This will exit the game's main loop. */
- private static boolean finished;
-
-
private static boolean _debug;
static {
try {
@@ -291,11 +287,11 @@
boolean wasMinimized = true;
- while (!finished) {
+ for (;;) {
if (isCloseRequested()) {
// Immediately exit
- finished = true;
+ break;
} if (isMinimized()) {
if (!wasMinimized) {
// Set task priority to LOW.
@@ -358,13 +354,6 @@
}
}
- /**
- * Finish the main loop. This will cause the game to exit cleanly.
- */
- public static void finish() {
- finished = true;
- }
-
/**
* Swap the video buffers.
*/
|
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-03-24 22:08:54
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl
In directory sc8-pr-cvs1:/tmp/cvs-serv27883/src/java/org/lwjgl/opengl
Modified Files:
Tag: experimental
BaseGL.java GL.java CoreGL.java
Log Message:
Index: BaseGL.java
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/BaseGL.java
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/BaseGL.java,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -u -d -r1.9 -r1.9.2.1
--- BaseGL.java 21 Mar 2003 17:05:55 -0000 1.9
+++ BaseGL.java 24 Mar 2003 22:08:47 -0000 1.9.2.1
@@ -68,18 +68,46 @@
/** This GL will be valid for use in only one thread */
protected Thread renderThread;
+ /** Colour bits */
+ protected final int colorBits;
+
+ /** Alpha bits */
+ protected final int alphaBits;
+
+ /** Depth bits */
+ protected final int depthBits;
+
+ /** Stencil bits */
+ protected final int stencilBits;
+
/**
* Constructor for BaseGL. The context is not created at this point;
* to create the GL you must call create().
+ *
+ * @param colorBits The number of color bits required (typically 16 or 32)
+ * @param alphaBits The number of alpha bits required (typically 0 or 8)
+ * @param depthBits The number of depth bits required
+ * @param stencilBits The number of stencil bits required (typically 0 or 8)
+ * @param debug Debug mode
*
* @see #create()
*/
- public BaseGL() {
+ public BaseGL(int colorBits, int alphaBits, int depthBits, int stencilBits) {
+ this.colorBits = colorBits;
+ this.alphaBits = alphaBits;
+ this.depthBits = depthBits;
+ this.stencilBits = stencilBits;
}
/**
* Creates the GL, with the best match it can get for the specified
- * parameters. The display must first have been created.
+ * parameters. A window will be created for the GL to draw in which will
+ * equal or exceed the specified color, alpha, depth, and stencil requirements.
+ * If such a window cannot be created an Exception is thrown.
+ *
+ * When using the debug version of LWJGL the window created may not be fullscreen
+ * but may, according to the target platform, be a draggable window on the
+ * desktop.
*
* @throws Exception if the GL could not be created for some reason
*/
@@ -148,7 +176,7 @@
/**
* Free the context from the current thread.
*/
- public final void releaseContext() {
+ private final void releaseContext() {
assert created : "GL has not been created yet.";
renderThread = null;
currentContext = null;
@@ -158,17 +186,12 @@
/**
* Make this the current context for the current thread.
*/
- public final void makeCurrent() {
+ private final void makeCurrent() {
assert created : "GL has not been created yet.";
renderThread = Thread.currentThread();
currentContext = this;
nMakeCurrent();
}
-
- /**
- * Swap the buffers
- */
- public native void swapBuffers();
/**
* Native method to free the context
Index: GL.java
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL.java
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL.java,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -u -d -r1.17 -r1.17.2.1
--- GL.java 6 Mar 2003 20:54:03 -0000 1.17
+++ GL.java 24 Mar 2003 22:08:48 -0000 1.17.2.1
@@ -37,8 +37,6 @@
import java.util.HashMap;
import java.util.StringTokenizer;
-import org.lwjgl.Display;
-
/**
* $Id$
*
@@ -52,13 +50,7 @@
public native void activeTextureARB(int texture);
[...1039 lines suppressed...]
- if(org.lwjgl.Sys.DEBUG) {
- System.out.println("Available WGL extensions:");
- }
+ if (org.lwjgl.Sys.DEBUG) {
+ System.out.println("Available WGL extensions:");
+ }
StringTokenizer st = new StringTokenizer(exts);
while (st.hasMoreTokens()) {
String ext = st.nextToken();
- if(org.lwjgl.Sys.DEBUG) {
- System.out.println(ext);
- }
+ if (org.lwjgl.Sys.DEBUG) {
+ System.out.println(ext);
+ }
Field f = (Field) map.get(ext);
if (f != null) {
Index: CoreGL.java
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/CoreGL.java
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/CoreGL.java,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -u -d -r1.11 -r1.11.2.1
--- CoreGL.java 17 Feb 2003 15:13:40 -0000 1.11
+++ CoreGL.java 24 Mar 2003 22:08:48 -0000 1.11.2.1
@@ -44,9 +44,13 @@
/**
* Constructor for CoreGL.
+ * @param colorBits The number of color bits required (typically 16 or 32)
+ * @param alphaBits The number of alpha bits required (typically 0 or 8)
+ * @param depthBits The number of depth bits required
+ * @param stencilBits The number of stencil bits required (typically 0 or 8)
*/
- public CoreGL() {
- super();
+ public CoreGL(int colorBits, int alphaBits, int depthBits, int stencilBits) {
+ super(colorBits, alphaBits, depthBits, stencilBits);
}
public native void accum(int op, float value);
|
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-03-24 21:44:16
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl
In directory sc8-pr-cvs1:/tmp/cvs-serv24740/src/java/org/lwjgl
Modified Files:
Tag: experimental
Display.java
Log Message:
Index: Display.java
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java,v
retrieving revision 1.19.2.1
retrieving revision 1.19.2.2
diff -u -d -r1.19.2.1 -r1.19.2.2
--- Display.java 24 Mar 2003 21:41:09 -0000 1.19.2.1
+++ Display.java 24 Mar 2003 21:44:08 -0000 1.19.2.2
@@ -147,4 +147,45 @@
return currentMode;
}
+ /**
+ * Retrieves the current display frequency of the created display.
+ * This will be 0 if the frequency cannot be determined.
+ *
+ * @return the current display frequency.
+ * @throws AssertionError if the display has not been created yet.
+ */
+ public static int getFrequency() {
+ return currentMode.freq;
+ }
+
+ /**
+ * Retrieves the current display depth of the created display
+ *
+ * @return the current display depth.
+ * @throws AssertionError if the display has not been created yet.
+ */
+ public static int getDepth() {
+ return currentMode.bpp;
+ }
+
+ /**
+ * Retrieves the height of the created display
+ *
+ * @return the current display height.
+ * @throws AssertionError if the display has not been created yet.
+ */
+ public static int getHeight() {
+ return currentMode.height;
+ }
+
+ /**
+ * Retrieves the width of the created display
+ *
+ * @return the current display width.
+ * @throws AssertionError if the display has not been created yet.
+ */
+ public static int getWidth() {
+ return currentMode.width;
+ }
+
}
|
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-03-24 21:42:22
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input
In directory sc8-pr-cvs1:/tmp/cvs-serv21875/src/java/org/lwjgl/input
Modified Files:
Tag: experimental
Controller.java Mouse.java Keyboard.java
Log Message:
Index: Controller.java
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Controller.java
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Controller.java,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -d -r1.3 -r1.3.2.1
--- Controller.java 10 Feb 2003 23:07:12 -0000 1.3
+++ Controller.java 24 Mar 2003 21:42:15 -0000 1.3.2.1
@@ -211,4 +211,12 @@
* Register fields with the native library
*/
private static native void initIDs();
+
+ /**
+ * @return true if the controller has been created.
+ */
+ public static boolean isCreated() {
+ return created;
+ }
+
}
Index: Mouse.java
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -u -d -r1.14 -r1.14.2.1
--- Mouse.java 17 Mar 2003 18:57:05 -0000 1.14
+++ Mouse.java 24 Mar 2003 21:42:15 -0000 1.14.2.1
@@ -32,7 +32,6 @@
package org.lwjgl.input;
-import org.lwjgl.Display;
import org.lwjgl.Sys;
/**
@@ -102,8 +101,6 @@
public static void create() throws Exception {
if (created)
return;
- if (!Display.isCreated())
- throw new Exception("The display has not yet been created.");
if (!nCreate())
throw new Exception("The mouse could not be created.");
created = true;
@@ -153,5 +150,12 @@
public static boolean isButtonDown(int button) {
assert created : "The mouse has not been created.";
return Mouse.buttons[button];
+ }
+
+ /**
+ * @return true if the mouse has been created.
+ */
+ public static boolean isCreated() {
+ return created;
}
}
Index: Keyboard.java
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Keyboard.java
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Keyboard.java,v
retrieving revision 1.16
retrieving revision 1.16.2.1
diff -u -d -r1.16 -r1.16.2.1
--- Keyboard.java 11 Jan 2003 23:09:38 -0000 1.16
+++ Keyboard.java 24 Mar 2003 21:42:15 -0000 1.16.2.1
@@ -35,7 +35,6 @@
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
-import org.lwjgl.Display;
import org.lwjgl.Sys;
/**
@@ -249,8 +248,6 @@
public static void create() throws Exception {
if (created)
return;
- if (!Display.isCreated())
- throw new Exception("The display has not yet been created.");
if (!nCreate())
throw new Exception("The keyboard could not be created.");
created = true;
@@ -344,6 +341,13 @@
}
/**
+ * @return true if keyboard buffering is enabled
+ */
+ public static boolean isBufferEnabled() {
+ return readBuffer != null;
+ }
+
+ /**
* Native method to enable the buffer
* @return the size of the buffer allocated, in events (1 event is 2 bytes),
* or 0 if no buffer can be allocated
@@ -389,4 +393,12 @@
} else
return false;
}
+
+ /**
+ * @return true if the keyboard has been created.
+ */
+ public static boolean isCreated() {
+ return created;
+ }
+
}
|
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-03-24 21:41:20
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl
In directory sc8-pr-cvs1:/tmp/cvs-serv20215/src/java/org/lwjgl
Modified Files:
Tag: experimental
Display.java Sys.java
Log Message:
Index: Display.java
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java,v
retrieving revision 1.19
retrieving revision 1.19.2.1
diff -u -d -r1.19 -r1.19.2.1
--- Display.java 21 Mar 2003 17:05:55 -0000 1.19
+++ Display.java 24 Mar 2003 21:41:09 -0000 1.19.2.1
@@ -37,9 +37,7 @@
/**
* $Id$
*
- * Encapsulates everything you need for game display.
- * It must be created before any input devices are created.
- * The game display has NO mouse cursor or any other window decorations.
+ * Methods for setting and querying display resolution.
*
* @author cix_foo <ci...@us...>
* @version $Revision$
@@ -47,15 +45,11 @@
public final class Display {
- static {
- System.loadLibrary(Sys.getLibraryName());
- }
-
- /** Has the display been created? */
- private static boolean created;
+ /** The initial display mode. Initialized on library load. */
+ private static DisplayMode initialMode;
- /** The current display mode, if created */
- private static DisplayMode mode;
+ /** The current display mode */
+ private static DisplayMode currentMode;
/** A pointer to the native display window. On Windows this will be an hWnd. */
private static int handle;
@@ -63,26 +57,24 @@
/** Whether or not the display has been requested to shutdown by the user */
private static boolean closeRequested = false;
- /*
- * Platforms. This will let you determine which platform you are running
- * on, which is handy to know for some GL context calls.
- */
-
- /** Windows platform */
- public static final int PLATFORM_WGL = 0;
-
- /** GLX (Linux/Unix) platform */
- public static final int PLATFORM_GLX = 1;
+ static {
+ System.loadLibrary(Sys.getLibraryName());
+ init();
+ currentMode = initialMode;
+ }
- /** MacOSX platform */
- public static final int PLATFORM_AGL = 2;
-
/**
* No construction allowed.
*/
private Display() {
super();
}
+
+ /**
+ * Initialize the Display class. This finds the initial display mode by
+ * querying the O/S.
+ */
+ private static native void init();
/**
* Returns the entire list of display modes as an array, in no
@@ -116,123 +108,32 @@
/**
* Native method for getting displaymodes
*/
- public static native DisplayMode[] nGetAvailableDisplayModes();
+ private static native DisplayMode[] nGetAvailableDisplayModes();
/**
- * Create a display with the specified display mode. If the display is
- * already created then no action is taken - the display must first be
- * destroyed.
- *
+ * Set the current display mode. The actual display mode set by the O/S
+ * may not match exactly the mode specified; for example, if frequency
+ * is 0 then the O/S will choose a default frequency.
+ *
* @param displayMode A display mode to choose
- * @param alpha Minimun number of alpha bits on the display
- * @param depth Minimun number of depth bits on the display
- * @param stencil Minimun number of stencil bits on the display
- * @param fullscreen Whether to create the display fullscreen
- * @param title The title for the application
+ * @return the actual display mode set
* @throws Exception if the display mode could not be set
* @see #destroy()
*/
- public static void create(DisplayMode displayMode, int alpha, int depth, int stencil, boolean fullscreen, String title)
- throws Exception {
-
- if (created) {
- return;
- }
-
- if (!nCreate(displayMode.width,
- displayMode.height,
- displayMode.bpp,
- displayMode.freq,
- alpha,
- depth,
- stencil,
- fullscreen,
- title)) {
- throw new Exception("Failed to set display mode to " + displayMode);
- }
-
- created = true;
- mode = displayMode;
- }
-
- /**
- * Native method to create the display. This will set the handle if it is
- * successful.
- * @return true if the display was successfully created
- * @see #create(org.lwjgl.DisplayMode, boolean)
- */
- private static native boolean nCreate(
- int width,
- int height,
- int bpp,
- int freq,
- int alpha_bits,
- int depth_bits,
- int stencil_bits,
- boolean fullscreen,
- String title);
+ public static native DisplayMode setDisplayMode(DisplayMode displayMode) throws Exception;
/**
- * Destroy the display and return it to normal. If the display has not yet
- * been created no action is taken.
+ * Reset the display back to its initial display mode. This method should
+ * always be called before the application exits.
*/
- public static void destroy() {
- if (!created) {
- return;
+ public static void resetDisplayMode() {
+ try {
+ if (!currentMode.equals(initialMode))
+ setDisplayMode(initialMode);
+ } catch (Exception e) {
+ System.err.println("Failed to reset display mode!");
+ e.printStackTrace(System.err);
}
-
- nDestroy();
- created = false;
- mode = null;
- }
-
- /**
- * Native method to destroy the display. This will reset the handle.
- */
- private static native void nDestroy();
-
- /**
- * Retrieves the width of the created display
- *
- * @return the current display width.
- * @throws AssertionError if the display has not been created yet.
- */
- public static int getWidth() {
- assert created : "The display has not been created yet.";
- return mode.width;
- }
-
- /**
- * Retrieves the height of the created display
- *
- * @return the current display height.
- * @throws AssertionError if the display has not been created yet.
- */
- public static int getHeight() {
- assert created : "The display has not been created yet.";
- return mode.height;
- }
-
- /**
- * Retrieves the current display depth of the created display
- *
- * @return the current display depth.
- * @throws AssertionError if the display has not been created yet.
- */
- public static int getDepth() {
- assert created : "The display has not been created yet.";
- return mode.bpp;
- }
-
- /**
- * Retrieves the current display frequency of the created display
- *
- * @return the current display frequency.
- * @throws AssertionError if the display has not been created yet.
- */
- public static int getFrequency() {
- assert created : "The display has not been created yet.";
- return mode.freq;
}
/**
@@ -243,61 +144,7 @@
* @throws AssertionError if the display has not been created yet.
*/
public static DisplayMode getDisplayMode() {
- assert created : "The display has not been created yet.";
- return mode;
- }
-
- /**
- * Retrieves the native handle to the created window
- *
- * @return the native handle
- * @throws AssertionError if the display has not been created yet.
- */
- public static int getHandle() {
- assert created : "The display has not been created yet.";
- return handle;
- }
-
- /**
- * Tests whether or not the display has been created
- *
- * @return true if the display has been created
- */
- public static boolean isCreated() {
- return created;
- }
-
- /**
- * Determines if the display is minimized. When the display is minimized it is
- * effectively invisible, and you need perform no rendering in your game loop.
- * On the native side, when the application is switched to some other application,
- * the display window will minimize; when focus is regained, it will maximize and
- * automatically gain focus and become the foreground window again.
- * @return true if the display is minimized
- */
- public static native boolean isMinimized();
-
- /**
- * Determines if the user has requested that the application should close.
- * When a user has requested that the application should shutdown, it is up to
- * the application to perform the actual shutdown and cleanup of any allocated
- * resources.
- *
- * @return true if the user has requested that the application should close
- */
- public static boolean isCloseRequested() {
- return closeRequested;
+ return currentMode;
}
-
- /**
- * Returns the operating system windowing platform. This will be one of the
- * constants defined above. There is no "unknown" platform; a native library port
- * has to provide a unique platform number for this mechanism to work. If the LWJGL
- * is ported to, say, QNX, we will have a PLATFORM_QNX at the ready.
- *
- * @return the windowing system
- */
- public static native int getPlatform();
-
}
Index: Sys.java
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v
retrieving revision 1.16
retrieving revision 1.16.2.1
diff -u -d -r1.16 -r1.16.2.1
--- Sys.java 21 Mar 2003 17:05:56 -0000 1.16
+++ Sys.java 24 Mar 2003 21:41:12 -0000 1.16.2.1
@@ -35,6 +35,10 @@
import java.nio.Buffer;
import java.nio.ByteBuffer;
+import org.lwjgl.input.*;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.input.Mouse;
+
/**
* $Id$
*
@@ -44,6 +48,12 @@
* @version $Revision$
*/
public final class Sys {
+
+ /**
+ * The LWJGL version sequence number. This is used to check that the Java
+ * code is loading the correct version of the native library.
+ */
+ public static final int VERSION = 1;
/** Low process priority. @see #setProcessPriority() */
public static final int LOW_PRIORITY = -1;
@@ -77,12 +87,29 @@
/** The native library name */
private static String LIBRARY_NAME;
+ /*
+ * Platforms. This will let you determine which platform you are running
+ * on, which is handy to know for some GL context calls.
+ */
+
+ /** Windows platform */
+ public static final int PLATFORM_WGL = 0;
+
+ /** GLX (Linux/Unix) platform */
+ public static final int PLATFORM_GLX = 1;
+
+ /** MacOSX platform */
+ public static final int PLATFORM_AGL = 2;
+
/**
* Debug flag. This will tell you if you are using the debug version of
* the library, and whether assertions are enabled or not.
*/
public static final boolean DEBUG;
+ /** Finish flag. This will exit the game's main loop. */
+ private static boolean finished;
+
private static boolean _debug;
static {
@@ -101,14 +128,6 @@
}
}
-
- /**
- * @return the name of the native library to load
- */
- public static String getLibraryName() {
- return LIBRARY_NAME;
- }
-
/**
* No constructor for Sys.
*/
@@ -120,6 +139,13 @@
*/
private static void initialize() {
System.loadLibrary(LIBRARY_NAME);
+
+ // Check the library version is correct. If not, we'll bung up an alert
+ // and bail out.
+ if (getVersion() != VERSION) {
+ alert("LWJGL", "The LWJGL dll version is incorrect. You have a lwjgl.dll somewhere in your path which should be removed, or an incorrect installation of this application.");
+ throw new RuntimeException("Mismatched DLL version.");
+ }
setTime(0);
}
@@ -175,7 +201,7 @@
* differences in operating systems this might or might not have any effect or
* the correct effect.
*
- * The default process priority is NORMAL_PRIORITY.
+ * The default process priority is HIGH_PRIORITY.
*
* REALTIME_PRIORITY processes should theoretically be the maximum priority of
* any process on the system and may have side effects on I/O and other fundamental
@@ -189,7 +215,7 @@
* @param priority a priority class, which will be one of REALTIME_PRIORITY,
* HIGH_PRIORITY, NORMAL_PRIORITY, or LOW_PRIORITY.
*/
- public static native void setProcessPriority(int priority);
+ private static native void setProcessPriority(int priority);
/**
* Attempt to display a modal alert to the user. This method should be used
@@ -209,5 +235,141 @@
* @param message The message text for the alert.
*/
public static native void alert(String title, String message);
+
+ /**
+ * Determines if the display is minimized. When the display is minimized it is
+ * effectively invisible, and you need perform no rendering in your game loop.
+ * On the native side, when the application is switched to some other application,
+ * the display window will minimize; when focus is regained, it will maximize and
+ * automatically gain focus and become the foreground window again.
+ * @return true if the display is minimized
+ */
+ private static native boolean isMinimized();
+
+ /**
+ * Determines if the user has requested that the application should close.
+ * When a user has requested that the application should shutdown, it is up to
+ * the application to perform the actual shutdown and cleanup of any allocated
+ * resources.
+ *
+ * @return true if the user has requested that the application should close
+ */
+ private static native boolean isCloseRequested();
+
+ /**
+ * Returns the operating system windowing platform. This will be one of the
+ * constants defined above. There is no "unknown" platform; a native library port
+ * has to provide a unique platform number for this mechanism to work. If the LWJGL
+ * is ported to, say, QNX, we will have a PLATFORM_QNX at the ready.
+ *
+ * @return the windowing system
+ */
+ public static native int getPlatform();
+
+ /**
+ * Gets the native library version sequence number. This should match the VERSION
+ * constant defined here.
+ * @return the native version sequence number
+ */
+ private static native int getVersion();
+
+ /**
+ * @return the name of the native library to load
+ */
+ public static String getLibraryName() {
+ return LIBRARY_NAME;
+ }
+
+ /**
+ * Run the game.
+ * @param game The Game to run
+ */
+ public static void mainLoop(Game game) {
+ try {
+
+ game.init();
+
+ boolean wasMinimized = true;
+
+ while (!finished) {
+
+ if (isCloseRequested()) {
+ // Immediately exit
+ finished = true;
+ } if (isMinimized()) {
+ if (!wasMinimized) {
+ // Set task priority to LOW.
+ setProcessPriority(LOW_PRIORITY);
+ wasMinimized = true;
+ }
+ long then = getTime();
+ game.idle();
+ long now = getTime();
+ // CPU throttle
+ float timeTaken = ((float)(then - now)) / (float)getTimerResolution();
+ try {
+ Thread.sleep(java.lang.Math.min(1, (int)(timeTaken * 1000.0f)));
+ } catch (InterruptedException e) {
+ }
+ } else {
+ if (wasMinimized) {
+ // Return task priority to HIGH (or NORMAL, if in debug mode)
+ setProcessPriority(DEBUG ? NORMAL_PRIORITY : HIGH_PRIORITY);
+ wasMinimized = false;
+ }
+ // Poll all input devices
+ if (Mouse.isCreated())
+ Mouse.poll();
+ if (Keyboard.isCreated()) {
+ Keyboard.poll();
+ if (Keyboard.isBufferEnabled())
+ Keyboard.read();
+ }
+ if (Controller.isCreated())
+ Controller.poll();
+
+ // Perform one tick
+ game.tick();
+
+ // Swap video buffers
+ swapBuffers();
+ }
+ }
+ } catch (Throwable t) {
+ t.printStackTrace(System.err);
+ alert(game.getTitle(), "An internal error has occurred.");
+ } finally {
+ try {
+ game.cleanup();
+ } catch (Throwable t) {
+ t.printStackTrace(System.err);
+ }
+
+ System.runFinalization();
+
+ // Just in case
+ if (Mouse.isCreated())
+ Mouse.destroy();
+ if (Keyboard.isCreated())
+ Keyboard.destroy();
+ if (Controller.isCreated())
+ Controller.destroy();
+ Display.resetDisplayMode();
+ }
+ }
+
+ /**
+ * Finish the main loop. This will cause the game to exit cleanly.
+ */
+ public static void finish() {
+ finished = true;
+ }
+ /**
+ * Swap the video buffers.
+ */
+ private static native void swapBuffers();
+
+
+
}
|
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-03-24 21:38:45
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl
In directory sc8-pr-cvs1:/tmp/cvs-serv17186/src/java/org/lwjgl
Added Files:
Tag: experimental
Game.java
Log Message:
--- NEW FILE: Game.java ---
CVS Browser:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Game.java
/*
* Created on 24-Mar-2003
*
* To change this generated comment go to
* Window>Preferences>Java>Code Generation>Code Template
*/
package org.lwjgl;
/**
* To ensure the LWJGL is used correctly in a platform-independent manner that
* will behave impeccably on all systems we provide a main loop for games written
* using the LWJGL. The Game interface should be implemented by your game itself
* to perform all the things it needs to do during the normal course of running
* a game.
*
* @author foo
*/
public interface Game {
/**
* This is called to initialize your game. Here you should set the display mode,
* create GL and AL, and create any input devices such as Mouse, Keyboard, and
* Controller.
*
* Should your initialization fail for any reason, throw an Exception. The
* cleanup() method will be called and then the application will terminate.
*
* @throws Exception if initialization fails
*/
public void init() throws Exception;
/**
* This is called to cleanup when your game terminates, for any reason. This
* method is always called when the game exits, except in the case of a JVM
* crash.
*/
public void cleanup();
/**
* Frame tick. This is the main loop of the game. Every video frame this method
* is called, allowing you to perform game logic, and then render your frame.
*
* Important note: all input device polling is done for you before tick() is called.
* After tick() returns, doubble buffer swapping is automatically done for you.
*/
public void tick();
/**
* Idle tick. This is called instead of tick() when the application is minimized.
* You are automatically restricted to 50% CPU during idle tick. You should perform
* no rendering. Ideally your game should pause completely and this method should be
* a no-op.
*
* Use the idle tick to process network protocols whilst the game is minimized.
*/
public void idle();
/**
* @return the title of your game. Must be non-null.
*/
public String getTitle();
}
|
|
From: Elias N. <eli...@us...> - 2003-03-24 18:10:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv26769/linux Modified Files: org_lwjgl_input_Mouse.cpp Log Message: Updated linux Mouse Index: org_lwjgl_input_Mouse.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- org_lwjgl_input_Mouse.cpp 21 Mar 2003 23:28:00 -0000 1.19 +++ org_lwjgl_input_Mouse.cpp 24 Mar 2003 18:10:04 -0000 1.20 @@ -173,8 +173,6 @@ { int i; - jbooleanArray buttons_array = env->NewBooleanArray(NUM_BUTTONS); - env->SetStaticObjectField(clazz, fid_buttons, buttons_array); env->SetStaticIntField(clazz, fid_button_count, NUM_BUTTONS); env->SetStaticBooleanField(clazz, fid_has_wheel, JNI_TRUE); current_x = current_y = current_z = last_x = last_y = last_z = pointer_grabbed = 0; |
|
From: Brian M. <ma...@us...> - 2003-03-24 17:16:47
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1:/tmp/cvs-serv32437 Added Files: WindowCreationTest.java Log Message: add: small window test - wanted to test how fast a display is created --- NEW FILE: WindowCreationTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java /* * Created on 18-03-2003 * * To change this generated comment go to * Window>Preferences>Java>Code Generation>Code Template */ package org.lwjgl.test; import org.lwjgl.*; /** * @author Brian */ public class WindowCreationTest { public static void main(String[] args) { DisplayMode[] modes = Display.getAvailableDisplayModes(); System.out.println("Found " + modes.length + " display modes"); //find 640*480*32*100 DisplayMode mode = modes[0]; for(int i=0;i<modes.length;i++) { if(modes[i].width == 640 && modes[i].height == 480 && modes[i].bpp == 16 && mode.freq <= modes[i].freq) { mode = modes[i]; } } if(mode == null) { System.out.println("Unable to find displaymode with following features: 640*480*16*60"); System.exit(-1); } System.out.println("mode: " + mode); try { Display.create(mode, 0, 0, 0, false, "WindowCreationTest"); } catch (Exception e) { e.printStackTrace(); } System.out.println("Display created"); Display.destroy(); } } |
|
From: Brian M. <ma...@us...> - 2003-03-24 17:07:33
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1:/tmp/cvs-serv21251 Modified Files: MouseCreationTest.java MouseTest.java Log Message: mod: making it possible to see color differences by clicking mouse buttons Index: MouseCreationTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseCreationTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- MouseCreationTest.java 19 Mar 2003 12:41:27 -0000 1.4 +++ MouseCreationTest.java 24 Mar 2003 17:07:25 -0000 1.5 @@ -201,22 +201,26 @@ private void render() { gl.clear(GL.COLOR_BUFFER_BIT); - gl.pushMatrix(); - gl.begin(GL.POLYGON); - { - gl.color3f(0.0f, 1.0f, 1.0f); - gl.vertex2f(position.x + 0.0f, position.y + 0.0f); - - gl.color3f(1.0f, 0.0f, 1.0f); - gl.vertex2f(position.x + 0.0f, position.y + 30.0f); - gl.vertex2f(position.x + 40.0f, position.y + 30.0f); - - gl.color3f(1.0f, 1.0f, 0.0f); - gl.vertex2f(position.x + 60.0f, position.y + 15.f); - gl.vertex2f(position.x + 40.0f, position.y + 0.0f); - } - gl.end(); - gl.popMatrix(); + gl.begin(GL.POLYGON); + { + float color = 1.0f; + int buttonDown = 0; + + for(int i=0;i<Mouse.buttonCount; i++) { + if(Mouse.isButtonDown(i)) { + color = (1.0f / Mouse.buttonCount) * (i+1); + break; + } + } + gl.color3f(color, color, color); + + gl.vertex2f(position.x + 0.0f, position.y + 0.0f); + gl.vertex2f(position.x + 0.0f, position.y + 30.0f); + gl.vertex2f(position.x + 40.0f, position.y + 30.0f); + gl.vertex2f(position.x + 60.0f, position.y + 15.f); + gl.vertex2f(position.x + 40.0f, position.y + 0.0f); + } + gl.end(); } /** Index: MouseTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- MouseTest.java 19 Mar 2003 12:41:27 -0000 1.6 +++ MouseTest.java 24 Mar 2003 17:07:25 -0000 1.7 @@ -168,22 +168,26 @@ private void render() { gl.clear(GL.COLOR_BUFFER_BIT); - gl.pushMatrix(); gl.begin(GL.POLYGON); { - gl.color3f(0.0f, 1.0f, 1.0f); + float color = 1.0f; + int buttonDown = 0; + + for(int i=0;i<Mouse.buttonCount; i++) { + if(Mouse.isButtonDown(i)) { + color = (1.0f / Mouse.buttonCount) * (i+1); + break; + } + } + gl.color3f(color, color, color); + gl.vertex2f(position.x + 0.0f, position.y + 0.0f); - - gl.color3f(1.0f, 0.0f, 1.0f); gl.vertex2f(position.x + 0.0f, position.y + 30.0f); gl.vertex2f(position.x + 40.0f, position.y + 30.0f); - - gl.color3f(1.0f, 1.0f, 0.0f); gl.vertex2f(position.x + 60.0f, position.y + 15.f); gl.vertex2f(position.x + 40.0f, position.y + 0.0f); } gl.end(); - gl.popMatrix(); } /** |
|
From: Brian M. <ma...@us...> - 2003-03-24 16:58:14
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1:/tmp/cvs-serv11581 Modified Files: Mouse.java Log Message: fix: creation of buttons array now occurs in java side Index: Mouse.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Mouse.java 17 Mar 2003 18:57:05 -0000 1.14 +++ Mouse.java 24 Mar 2003 16:58:10 -0000 1.15 @@ -54,7 +54,7 @@ private static boolean created; /** The mouse buttons status from the last poll */ - private static boolean[] buttons = new boolean[4]; + private static boolean[] buttons; /** Delta X */ public static int dx; @@ -107,6 +107,9 @@ if (!nCreate()) throw new Exception("The mouse could not be created."); created = true; + + //set mouse buttons + buttons = new boolean[buttonCount]; } /** @@ -123,6 +126,8 @@ if (!created) return; created = false; + buttons = null; + nDestroy(); } @@ -152,6 +157,6 @@ */ public static boolean isButtonDown(int button) { assert created : "The mouse has not been created."; - return Mouse.buttons[button]; + return buttons[button]; } } |
|
From: Elias N. <eli...@us...> - 2003-03-24 11:56:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv22996/src/native/common Modified Files: extal.cpp org_lwjgl_openal_ALC.cpp Log Message: Fixed Brian's bugs Index: extal.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extal.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- extal.cpp 23 Mar 2003 12:52:11 -0000 1.1 +++ extal.cpp 24 Mar 2003 11:56:05 -0000 1.2 @@ -168,30 +168,26 @@ #ifdef _DEBUG printf("Found %d OpenAL paths\n", pathcount); #endif -#ifdef _WIN32 for(int i=0;i<pathcount;i++) { jstring path = (jstring) env->GetObjectArrayElement(oalPaths, i); + const char *path_str = env->GetStringUTFChars(path, NULL); #ifdef _DEBUG - printf("Testing '%s'\n", env->GetStringUTFChars(path, NULL)); + printf("Testing '%s'\n", path_str); #endif - handleOAL = LoadLibrary(env->GetStringUTFChars(path, NULL)); +#ifdef _WIN32 + handleOAL = LoadLibrary(path_str); +#endif +#ifdef _X11 + handleOAL = dlopen(path_str, RTLD_LAZY); +#endif if (handleOAL != NULL) { #ifdef _DEBUG - printf("Found OpenAL at '%s'\n", env->GetStringUTFChars(path, NULL)); + printf("Found OpenAL at '%s'\n", path_str); #endif break; } + env->ReleaseStringUTFChars(path, path_str); } -#endif -#ifdef _X11 - for(int i=0;i<pathcount;i++) { - jstring path = (jstring) env->GetObjectArrayElement(oalPaths, i); - handleOAL = dlopen(env->GetStringUTFChars(path, NULL), RTLD_LAZY); - if (handleOAL != NULL) { - break; - } - } -#endif } /** @@ -199,10 +195,10 @@ */ void UnLoadOpenAL() { #ifdef _WIN32 - //FreeLibrary(handleOAL); + FreeLibrary(handleOAL); #endif #ifdef _X11 - dlclose(handleOAL); + dlclose(handleOAL); #endif } Index: org_lwjgl_openal_ALC.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_openal_ALC.cpp 17 Mar 2003 18:34:43 -0000 1.5 +++ org_lwjgl_openal_ALC.cpp 24 Mar 2003 11:56:05 -0000 1.6 @@ -387,4 +387,4 @@ CHECK_ALC_ERROR return result; -} \ No newline at end of file +} |
|
From: Elias N. <eli...@us...> - 2003-03-24 11:56:08
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv22996/src/java/org/lwjgl/test/openal Modified Files: ALTest.java Log Message: Fixed Brian's bugs Index: ALTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/ALTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/ALTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ALTest.java 21 Dec 2002 12:37:20 -0000 1.4 +++ ALTest.java 24 Mar 2003 11:56:04 -0000 1.5 @@ -298,6 +298,10 @@ // Initialize Open AL manually //Open device device = alc.openDevice(null); + if (device == null) { + System.out.println("Could not create ALC device"); + System.exit(-1); + } //Create context(s) context = alc.createContext(device, 0); //Set active context |
|
From: Elias N. <eli...@us...> - 2003-03-24 11:56:08
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1:/tmp/cvs-serv22996/src/java/org/lwjgl/openal Modified Files: BaseAL.java Log Message: Fixed Brian's bugs Index: BaseAL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/BaseAL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/BaseAL.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- BaseAL.java 22 Mar 2003 23:16:01 -0000 1.6 +++ BaseAL.java 24 Mar 2003 11:56:04 -0000 1.7 @@ -74,38 +74,36 @@ */ public void create() throws Exception { if (created) { - return; - } - - - // need to pass path of possible locations of OAL to native side - String libpath = System.getProperty("java.library.path"); - String seperator = System.getProperty("path.separator"); - String libname; - - // libname is hardcoded atm - this will change in a near future... - libname = (System.getProperty("os.name").toLowerCase().indexOf("windows") == -1) - ? "libopenal.so" - : "OpenAL32.dll"; - - StringTokenizer st = new StringTokenizer(libpath, seperator); - - //create needed string array - String[] oalPaths = new String[st.countTokens()+1]; - - //build paths - for(int i=0;i<st.countTokens();i++) { - oalPaths[i] = st.nextToken() + File.separator + libname; - } - - //add cwd path - oalPaths[oalPaths.length-1] = libname; - + return; + } + + // need to pass path of possible locations of OAL to native side + String libpath = System.getProperty("java.library.path"); + String seperator = System.getProperty("path.separator"); + String libname; + + // libname is hardcoded atm - this will change in a near future... + libname = (System.getProperty("os.name").toLowerCase().indexOf("windows") == -1) + ? "libopenal.so" + : "OpenAL32.dll"; + + StringTokenizer st = new StringTokenizer(libpath, seperator); + + //create needed string array + String[] oalPaths = new String[st.countTokens()+1]; + + //build paths + for(int i=0;i<oalPaths.length - 1;i++) { + oalPaths[i] = st.nextToken() + File.separator + libname; + } + + //add cwd path + oalPaths[oalPaths.length-1] = libname; if (!nCreate(oalPaths)) { throw new Exception("AL instance could not be created."); - } + } created = true; - init(); + init(); } /** @@ -130,4 +128,4 @@ * Native method the destroy the AL */ protected native void nDestroy(); -} \ No newline at end of file +} |