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
|
From: Elias N. <eli...@us...> - 2002-12-19 16:35:38
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv17077/src/native/common Modified Files: org_lwjgl_Display.h org_lwjgl_opengl_BaseGL.h Log Message: Moved BaseGL constructor parameters to Display Index: org_lwjgl_Display.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_Display.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_Display.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- org_lwjgl_Display.h 11 Aug 2002 11:49:33 -0000 1.1.1.1 +++ org_lwjgl_Display.h 19 Dec 2002 16:35:35 -0000 1.2 @@ -26,7 +26,7 @@ * Signature: (IIIIZ)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_Display_nCreate - (JNIEnv *, jclass, jint, jint, jint, jint, jboolean); + (JNIEnv *, jclass, jint, jint, jint, jint, jint, jint, jint, jboolean); /* * Class: org_lwjgl_Display Index: org_lwjgl_opengl_BaseGL.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_BaseGL.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_BaseGL.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_opengl_BaseGL.h 25 Nov 2002 17:04:56 -0000 1.2 +++ org_lwjgl_opengl_BaseGL.h 19 Dec 2002 16:35:35 -0000 1.3 @@ -16,7 +16,7 @@ * Signature: (IIII)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_BaseGL_nCreate - (JNIEnv *, jobject, jint, jint, jint, jint); + (JNIEnv *, jobject); /* * Class: org_lwjgl_opengl_BaseGL |
From: Luke H. <lh...@us...> - 2002-12-18 21:57:37
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1:/tmp/cvs-serv13175 Modified Files: Mouse.java Log Message: Commented out the enableBuffer methods. Looks like these methods wont be implemented in the JNI side, so they should not exist in the API. 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.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Mouse.java 28 Aug 2002 21:58:14 -0000 1.9 +++ Mouse.java 18 Dec 2002 21:57:31 -0000 1.10 @@ -193,23 +193,23 @@ return Mouse.button[button]; } - /** - * Enable mouse buffering. Must be called after the mouse is created. - * @return the size of the mouse buffer in events, or 0 if no buffering - * can be enabled for any reason - */ - public static int enableBuffer() { - assert created : "The mouse has not been created."; - return nEnableBuffer(); - } - - - /** - * 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 - */ - private static native int nEnableBuffer(); +// /** +// * Enable mouse buffering. Must be called after the mouse is created. +// * @return the size of the mouse buffer in events, or 0 if no buffering +// * can be enabled for any reason +// */ +// public static int enableBuffer() { +// assert created : "The mouse has not been created."; +// return nEnableBuffer(); +// } +// +// +// /** +// * 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 +// */ +// private static native int nEnableBuffer(); /** |
From: Brian M. <ma...@us...> - 2002-12-18 21:39:11
|
Update of /cvsroot/java-game-lib/LWJGL/examples In directory sc8-pr-cvs1:/tmp/cvs-serv6546 Modified Files: BaseWindow.java Log Message: fix: enableBuffer isn't implemented! Index: BaseWindow.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/examples/BaseWindow.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/examples/BaseWindow.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- BaseWindow.java 29 Nov 2002 08:29:53 -0000 1.2 +++ BaseWindow.java 18 Dec 2002 21:39:02 -0000 1.3 @@ -117,7 +117,7 @@ Keyboard.create(); Keyboard.enableBuffer(); Mouse.create(); - Mouse.enableBuffer(); + //Mouse.enableBuffer(); resizeGLScene(Display.getWidth(), Display.getHeight()); |
From: Elias N. <eli...@us...> - 2002-12-18 20:32:15
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv16778/common Modified Files: Makefile.am Log Message: Removed ALUT from automake Index: Makefile.am CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/Makefile.am =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 30 Nov 2002 00:19:59 -0000 1.3 +++ Makefile.am 18 Dec 2002 20:32:12 -0000 1.4 @@ -55,8 +55,6 @@ org_lwjgl_Math_MatrixOpSubtract_MatrixOpSafe.h \ org_lwjgl_openal_ALC.cpp \ org_lwjgl_openal_ALC.h \ - org_lwjgl_openal_ALUT.cpp \ - org_lwjgl_openal_ALUT.h \ org_lwjgl_openal_BaseAL.cpp \ org_lwjgl_openal_BaseAL.h \ org_lwjgl_openal_CoreAL.cpp \ |
From: Brian M. <ma...@us...> - 2002-12-18 17:09:14
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv7816 Modified Files: extal.h Log Message: fix: removed alut related stuff Index: extal.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extal.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- extal.h 14 Dec 2002 13:52:25 -0000 1.12 +++ extal.h 18 Dec 2002 17:09:09 -0000 1.13 @@ -43,9 +43,6 @@ extern "C" { #endif -#define ALUTAPI -#define ALUTAPIENTRY __cdecl - #ifdef _WIN32 #ifdef _OPENAL32LIB #define ALCAPI __declspec(dllexport) |
From: Brian M. <ma...@us...> - 2002-12-18 17:03:31
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv567 Added Files: WaveData.java Log Message: add: new class for loading wave files, in preperation of removing ALUT --- NEW FILE: WaveData.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/WaveData.java /* * Copyright (c) 2002 Light Weight Java Game Library 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 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.test.openal; import org.lwjgl.openal.AL; import java.nio.ByteBuffer; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.*; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.FileInputStream; import java.io.IOException; /** * $Id: WaveData.java,v 1.1 2002/12/18 16:51:02 matzon Exp $ * * Utitlity class for loading wavefiles. * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class WaveData { /** actual wave data */ public final ByteBuffer data; /** format type of data */ public final int format; /** sample rate of data */ public final int samplerate; /** * Creates a new WaveData * * @param data actual wavedata * @param format format of wave data * @param samplerate sample rate of data */ private WaveData(ByteBuffer data, int format, int samplerate) { this.data = data; this.format = format; this.samplerate = samplerate; } /** * Disposes the wavedata */ public void dispose() { data.clear(); } /** * Creates a WaveData container from the specified filename * * @param filepath path to file * @return WaveData containing data, or null if a failure occured */ public static WaveData create(String filepath) { try { return create( AudioSystem.getAudioInputStream( new BufferedInputStream(new FileInputStream(filepath)))); } catch (Exception e) { e.printStackTrace(); return null; } } /** * Creates a WaveData container from the specified bytes * * @param buffer array of bytes containing the complete wave file * @return WaveData containing data, or null if a failure occured */ public static WaveData create(byte[] buffer) { try { return create( AudioSystem.getAudioInputStream( new BufferedInputStream(new ByteArrayInputStream(buffer)))); } catch (Exception e) { e.printStackTrace(); return null; } } /** * Creates a WaveData container from the specified stream * * @param ais AudioInputStream to read from * @return WaveData containing data, or null if a failure occured */ public static WaveData create(AudioInputStream ais) { //get format of data AudioFormat audioformat = ais.getFormat(); // get channels int channels = 0; if (audioformat.getChannels() == 1) { if (audioformat.getSampleSizeInBits() == 8) { channels = AL.FORMAT_MONO8; } else if (audioformat.getSampleSizeInBits() == 16) { channels = AL.FORMAT_MONO16; } else { assert false : "Illegal sample size"; } } else if (audioformat.getChannels() == 2) { if (audioformat.getSampleSizeInBits() == 8) { channels = AL.FORMAT_STEREO8; } else if (audioformat.getSampleSizeInBits() == 16) { channels = AL.FORMAT_STEREO16; } else { assert false : "Illegal sample size"; } } else { assert false : "Only mono or stereo is supported"; } //read data into buffer byte[] buf = new byte[audioformat.getChannels() * (int) ais.getFrameLength() * audioformat.getSampleSizeInBits() / 8]; int read = 0, total = 0; try { while ((read = ais.read(buf, total, buf.length - total)) != -1 && total < buf.length) { total += read; } } catch (IOException ioe) { return null; } //insert data into bytebuffer ByteBuffer buffer = ByteBuffer.allocateDirect(buf.length); buffer.put(buf); //create our result WaveData wavedata = new WaveData(buffer, channels, (int) audioformat.getSampleRate()); //close stream try { ais.close(); } catch (IOException ioe) { } return wavedata; } } |
From: Brian M. <ma...@us...> - 2002-12-18 16:54:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv2896 Removed Files: org_lwjgl_openal_ALUT.cpp org_lwjgl_openal_ALUT.h Log Message: mod: ALUT removed, caused waaay to many headaches --- org_lwjgl_openal_ALUT.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALUT.cpp --- org_lwjgl_openal_ALUT.h DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALUT.h |
From: Brian M. <ma...@us...> - 2002-12-18 16:54:05
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1:/tmp/cvs-serv2513 Removed Files: ALUT.java ALUTLoadWAVData.java Log Message: mod: ALUT removed, caused waaay to many headaches --- ALUT.java DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALUT.java --- ALUTLoadWAVData.java DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALUTLoadWAVData.java |
From: Brian M. <ma...@us...> - 2002-12-18 16:53:30
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv2148/openal Modified Files: ALTest.java BasicTest.java PlayTest.java PlayTestMemory.java Removed Files: ALUTTest.java Log Message: mod: ALUT removed, caused waaay to many headaches 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.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ALTest.java 21 Nov 2002 22:38:07 -0000 1.2 +++ ALTest.java 18 Dec 2002 16:53:27 -0000 1.3 @@ -35,7 +35,6 @@ import org.lwjgl.openal.ALC; import org.lwjgl.openal.ALCcontext; import org.lwjgl.openal.ALCdevice; -import org.lwjgl.openal.ALUTLoadWAVData; import org.lwjgl.openal.eax.EAX; import org.lwjgl.openal.eax.EAXBufferProperties; import org.lwjgl.openal.eax.EAXListenerProperties; @@ -340,16 +339,16 @@ // Load in samples to be used by Test functions // Load footsteps.wav - ALUTLoadWAVData data = alut.loadWAVFile("Footsteps.wav"); - if ((error = al.getError()) != AL.NO_ERROR) { - displayALError("alutLoadWAVFile footsteps.wav : ", error); + WaveData wavefile = WaveData.create("Footsteps.wav"); + if (wavefile == null) { + displayALError("LoadWAVFile footsteps.wav : ", error); // Delete Buffers al.deleteBuffers(NUM_BUFFERS, Sys.getDirectBufferAddress(buffers)); System.exit(-1); } // Copy footsteps.wav data into AL Buffer 0 - al.bufferData(buffers.get(0), data.format, data.data, data.size, data.freq); + al.bufferData(buffers.get(0), wavefile.format, Sys.getDirectBufferAddress(wavefile.data), wavefile.data.capacity(), wavefile.samplerate); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alBufferData buffer 0 : ", error); // Delete buffers @@ -358,25 +357,20 @@ } // Unload footsteps.wav - alut.unloadWAV(data.format, data.data, data.size, data.freq); - if ((error = al.getError()) != AL.NO_ERROR) { - displayALError("alutUnloadWAV : ", error); - // Delete buffers - al.deleteBuffers(NUM_BUFFERS, Sys.getDirectBufferAddress(buffers)); - System.exit(-1); - } + wavefile.dispose(); + wavefile = null; // Load ding.wav - data = alut.loadWAVFile("ding.wav"); - if ((error = al.getError()) != AL.NO_ERROR) { - displayALError("alutLoadWAVFile ding.wav : ", error); + wavefile = WaveData.create("ding.wav"); + if (wavefile == null) { + displayALError("LoadWAVFile ding.wav : ", error); // Delete Buffers al.deleteBuffers(NUM_BUFFERS, Sys.getDirectBufferAddress(buffers)); System.exit(-1); } // Copy ding.wav data into AL Buffer 1 - al.bufferData(buffers.get(1), data.format, data.data, data.size, data.freq); + al.bufferData(buffers.get(1), wavefile.format, Sys.getDirectBufferAddress(wavefile.data), wavefile.data.capacity(), wavefile.samplerate); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alBufferData buffer 1 : ", error); // Delete buffers @@ -385,25 +379,20 @@ } // Unload footsteps.wav - alut.unloadWAV(data.format, data.data, data.size, data.freq); - if ((error = al.getError()) != AL.NO_ERROR) { - displayALError("alutUnloadWAV : ", error); - // Delete buffers - al.deleteBuffers(NUM_BUFFERS, Sys.getDirectBufferAddress(buffers)); - System.exit(-1); - } - + wavefile.dispose(); + wavefile = null; + // Load wave1.wav - data = alut.loadWAVFile("Wave1.WAV"); - if ((error = al.getError()) != AL.NO_ERROR) { - displayALError("alutLoadWAVFile wave1.wav : ", error); + wavefile = WaveData.create("Wave1.WAV"); + if (wavefile == null) { + displayALError("LoadWAVFile wave1.wav : ", error); // Delete Buffers al.deleteBuffers(NUM_BUFFERS, Sys.getDirectBufferAddress(buffers)); System.exit(-1); } // Copy wave1.wav data into AL Buffer 2 - al.bufferData(buffers.get(2), data.format, data.data, data.size, data.freq); + al.bufferData(buffers.get(2), wavefile.format, Sys.getDirectBufferAddress(wavefile.data), wavefile.data.capacity(), wavefile.samplerate); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alBufferData buffer 2 : ", error); // Delete buffers @@ -412,25 +401,20 @@ } // Unload wave1.wav - alut.unloadWAV(data.format, data.data, data.size, data.freq); - if ((error = al.getError()) != AL.NO_ERROR) { - displayALError("alutUnloadWAV : ", error); - // Delete buffers - al.deleteBuffers(NUM_BUFFERS, Sys.getDirectBufferAddress(buffers)); - System.exit(-1); - } + wavefile.dispose(); + wavefile = null; // Load Wave2.wav - data = alut.loadWAVFile("Wave2.WAV"); - if ((error = al.getError()) != AL.NO_ERROR) { - displayALError("alutLoadWAVFile Wave2.wav : ", error); + wavefile = WaveData.create("Wave2.WAV"); + if (wavefile == null) { + displayALError("LoadWAVFile Wave2.wav : ", error); // Delete Buffers al.deleteBuffers(NUM_BUFFERS, Sys.getDirectBufferAddress(buffers)); System.exit(-1); } // Copy Wave2.wav data into AL Buffer 3 - al.bufferData(buffers.get(3), data.format, data.data, data.size, data.freq); + al.bufferData(buffers.get(3), wavefile.format, Sys.getDirectBufferAddress(wavefile.data), wavefile.data.capacity(), wavefile.samplerate); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alBufferData buffer 3 : ", error); // Delete buffers @@ -439,25 +423,20 @@ } // Unload Wave2.wav - alut.unloadWAV(data.format, data.data, data.size, data.freq); - if ((error = al.getError()) != AL.NO_ERROR) { - displayALError("alutUnloadWAV : ", error); - // Delete buffers - al.deleteBuffers(NUM_BUFFERS, Sys.getDirectBufferAddress(buffers)); - System.exit(-1); - } + wavefile.dispose(); + wavefile = null; // Load wave3.wav - data = alut.loadWAVFile("Wave3.WAV"); - if ((error = al.getError()) != AL.NO_ERROR) { - displayALError("alutLoadWAVFile wave3.wav : ", error); + wavefile = WaveData.create("Wave3.WAV"); + if (wavefile == null) { + displayALError("LoadWAVFile wave3.wav : ", error); // Delete Buffers al.deleteBuffers(NUM_BUFFERS, Sys.getDirectBufferAddress(buffers)); System.exit(-1); } // Copy wave3.wav data into AL Buffer 4 - al.bufferData(buffers.get(4), data.format, data.data, data.size, data.freq); + al.bufferData(buffers.get(4), wavefile.format, Sys.getDirectBufferAddress(wavefile.data), wavefile.data.capacity(), wavefile.samplerate); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alBufferData buffer 4 : ", error); // Delete buffers @@ -466,25 +445,20 @@ } // Unload wave3.wav - alut.unloadWAV(data.format, data.data, data.size, data.freq); - if ((error = al.getError()) != AL.NO_ERROR) { - displayALError("alutUnloadWAV : ", error); - // Delete buffers - al.deleteBuffers(NUM_BUFFERS, Sys.getDirectBufferAddress(buffers)); - System.exit(-1); - } + wavefile.dispose(); + wavefile = null; // Load wave4.wav - data = alut.loadWAVFile("Wave4.WAV"); - if ((error = al.getError()) != AL.NO_ERROR) { - displayALError("alutLoadWAVFile wave4.wav : ", error); + wavefile = WaveData.create("Wave4.WAV"); + if (wavefile == null) { + displayALError("LoadWAVFile wave4.wav : ", error); // Delete Buffers al.deleteBuffers(NUM_BUFFERS, Sys.getDirectBufferAddress(buffers)); System.exit(-1); } // Copy wave4.wav data into AL Buffer 5 - al.bufferData(buffers.get(5), data.format, data.data, data.size, data.freq); + al.bufferData(buffers.get(5), wavefile.format, Sys.getDirectBufferAddress(wavefile.data), wavefile.data.capacity(), wavefile.samplerate); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alBufferData buffer 5 : ", error); // Delete buffers @@ -493,25 +467,20 @@ } // Unload wave4.wav - alut.unloadWAV(data.format, data.data, data.size, data.freq); - if ((error = al.getError()) != AL.NO_ERROR) { - displayALError("alutUnloadWAV : ", error); - // Delete buffers - al.deleteBuffers(NUM_BUFFERS, Sys.getDirectBufferAddress(buffers)); - System.exit(-1); - } + wavefile.dispose(); + wavefile = null; // Load stereo.wav - data = alut.loadWAVFile("stereo.wav"); - if ((error = al.getError()) != AL.NO_ERROR) { - displayALError("alutLoadWAVFile stereo.wav : ", error); + wavefile = WaveData.create("stereo.wav"); + if (wavefile == null) { + displayALError("LoadWAVFile stereo.wav : ", error); // Delete Buffers al.deleteBuffers(NUM_BUFFERS, Sys.getDirectBufferAddress(buffers)); System.exit(-1); } // Copy stereo.wav data into AL Buffer 6 - al.bufferData(buffers.get(6), data.format, data.data, data.size, data.freq); + al.bufferData(buffers.get(6), wavefile.format, Sys.getDirectBufferAddress(wavefile.data), wavefile.data.capacity(), wavefile.samplerate); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alBufferData buffer 6 : ", error); // Delete buffers @@ -520,13 +489,8 @@ } // Unload stereo.wav - alut.unloadWAV(data.format, data.data, data.size, data.freq); - if ((error = al.getError()) != AL.NO_ERROR) { - displayALError("alutUnloadWAV : ", error); - // Delete buffers - al.deleteBuffers(NUM_BUFFERS, Sys.getDirectBufferAddress(buffers)); - System.exit(-1); - } + wavefile.dispose(); + wavefile = null; //do EAX check (can only be performed after device / context creation eaxAvailable = al.isExtensionPresent("EAX"); Index: BasicTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- BasicTest.java 14 Dec 2002 12:43:45 -0000 1.2 +++ BasicTest.java 18 Dec 2002 16:53:27 -0000 1.3 @@ -35,7 +35,6 @@ import org.lwjgl.openal.ALC; import org.lwjgl.openal.ALCcontext; import org.lwjgl.openal.ALCdevice; -import org.lwjgl.openal.ALUT; import java.nio.ByteBuffer; import java.nio.ByteOrder; @@ -56,10 +55,7 @@ /** OpenAL Context instance */ protected ALC alc; - - /** OpenAL Util library instance */ - protected ALUT alut; - + /** OpenAL context */ protected ALCcontext context; @@ -84,15 +80,7 @@ } catch (Exception e) { e.printStackTrace(); return; - } - - alut = new ALUT(); - try { - alut.create(); - } catch (Exception e) { - e.printStackTrace(); - return; - } + } } /** @@ -152,7 +140,7 @@ temp.order(ByteOrder.nativeOrder()); return temp.asIntBuffer(); - } + } /** * Exits the test NOW, printing errorcode to stdout Index: PlayTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- PlayTest.java 14 Dec 2002 12:44:17 -0000 1.2 +++ PlayTest.java 18 Dec 2002 16:53:27 -0000 1.3 @@ -33,7 +33,6 @@ import org.lwjgl.Sys; import org.lwjgl.openal.AL; -import org.lwjgl.openal.ALUTLoadWAVData; import java.nio.IntBuffer; @@ -85,23 +84,16 @@ } //load wave data - ALUTLoadWAVData file = alut.loadWAVFile(args[0]); - if((lastError = al.getError()) != AL.NO_ERROR) { - exit(lastError); - } - + WaveData wavefile = WaveData.create(args[0]); //copy to buffers - al.bufferData(buffers.get(0), file.format, file.data, file.size, file.freq); + al.bufferData(buffers.get(0), wavefile.format, Sys.getDirectBufferAddress(wavefile.data), wavefile.data.capacity(), wavefile.samplerate); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //unload file again - alut.unloadWAV(file.format, file.data, file.size, file.freq); - if((lastError = al.getError()) != AL.NO_ERROR) { - exit(lastError); - } + wavefile.dispose(); //set up source input al.sourcei(sources.get(0), AL.BUFFER, buffers.get(0)); Index: PlayTestMemory.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTestMemory.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTestMemory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- PlayTestMemory.java 14 Dec 2002 12:44:17 -0000 1.2 +++ PlayTestMemory.java 18 Dec 2002 16:53:27 -0000 1.3 @@ -33,7 +33,6 @@ import org.lwjgl.Sys; import org.lwjgl.openal.AL; -import org.lwjgl.openal.ALUTLoadWAVData; import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; @@ -97,23 +96,18 @@ System.exit(-1); } - ALUTLoadWAVData file = alut.loadWAVMemory(Sys.getDirectBufferAddress(filebuffer)); - if((lastError = al.getError()) != AL.NO_ERROR) { - exit(lastError); - } + //ALUTLoadWAVData file = alut.loadWAVMemory(Sys.getDirectBufferAddress(filebuffer)); + WaveData wavefile = WaveData.create(filebuffer.array()); //copy to buffers - al.bufferData(buffers.get(0), file.format, file.data, file.size, file.freq); + al.bufferData(buffers.get(0), wavefile.format, Sys.getDirectBufferAddress(wavefile.data), wavefile.data.capacity(), wavefile.samplerate); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); - } - + } + //unload file again - alut.unloadWAV(file.format, file.data, file.size, file.freq); - if((lastError = al.getError()) != AL.NO_ERROR) { - exit(lastError); - } + wavefile.dispose(); //set up source input al.sourcei(sources.get(0), AL.BUFFER, buffers.get(0)); @@ -158,7 +152,6 @@ } //no errorchecking from now on, since our context is gone. - //shutdown alExit(); } @@ -198,7 +191,7 @@ //done reading, close bis.close(); - buffer = ByteBuffer.allocateDirect(baos.size()); + buffer = ByteBuffer.allocate(baos.size()); buffer.order(ByteOrder.nativeOrder()); buffer.put(baos.toByteArray()); } catch (Exception ioe) { --- ALUTTest.java DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/ALUTTest.java |
From: Brian M. <ma...@us...> - 2002-12-18 16:51:31
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv830 Added Files: StressTest.java Log Message: add: simple stress test for oal --- NEW FILE: StressTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/StressTest.java /* * Copyright (c) 2002 Light Weight Java Game Library 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 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.test.openal; import org.lwjgl.Sys; import org.lwjgl.openal.AL; import java.nio.IntBuffer; /** * $Id: StressTest.java,v 1.1 2002/12/18 16:51:28 matzon Exp $ * * Simple test for stresstesting OpenAL playing random samples ad nausea * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class StressTest extends BasicTest { /** Buffer containing sources */ private IntBuffer sources; /** Buffer containing buffers */ private IntBuffer buffers; /** * Creates an instance of StressTest */ public StressTest() { super(); } /** * Runs the actual test, using supplied arguments */ protected void execute(String[] args) { alInitialize(); createSources(); createBuffers(); try { loadSamples(); runTest(); } catch (Exception e) { e.printStackTrace(); } alExit(); } private void createSources() { sources = createIntBuffer(4); al.genSources(4, Sys.getDirectBufferAddress(sources)); if (al.getError() != AL.NO_ERROR) { System.out.println("Unable to create 4 sources"); alExit(); } } private void createBuffers() { buffers = createIntBuffer(10); al.genBuffers(10, Sys.getDirectBufferAddress(buffers)); if (al.getError() != AL.NO_ERROR) { System.out.println("Unable to create 10 buffers"); al.deleteSources(4, Sys.getDirectBufferAddress(sources)); alExit(); } } private void loadSamples() throws Exception { al.getError(); WaveData data; for (int i = 1; i <= 10; i++) { data = WaveData.create(i + ".wav"); al.bufferData( buffers.get(i - 1), data.format, Sys.getDirectBufferAddress(data.data), data.data.capacity(), data.samplerate); if (al.getError() != AL.NO_ERROR) { System.out.println("Failed to load " + i + ".wav into buffer"); al.deleteSources(4, Sys.getDirectBufferAddress(sources)); al.deleteBuffers(10, Sys.getDirectBufferAddress(buffers)); alExit(); } } } public void runTest() { int iterations = 0; int randomBuffer; int startSlot = 1; int nextSlot = startSlot; long startTime = System.currentTimeMillis(); //mark background source as looping al.sourcei(sources.get(0), AL.LOOPING, AL.TRUE); //play background al.sourcei(sources.get(0), AL.BUFFER, buffers.get(0)); al.sourcePlay(sources.get(0)); while (System.currentTimeMillis() - startTime < (60000 * 60)) { randomBuffer = getRandomBuffer(); System.out.println("random:" + randomBuffer); //stop source at slot al.sourceStop(sources.get(nextSlot)); if (al.getError() != AL.NO_ERROR) { System.out.println("Error stopping source."); } System.out.println("Stopped source: " + nextSlot); //link source<->buffer al.sourcei(sources.get(nextSlot), AL.BUFFER, buffers.get(randomBuffer)); if (al.getError() != AL.NO_ERROR) { System.out.println("Error linking buffer and source."); } System.out.println("linked source " + nextSlot + " with buffer " + randomBuffer); //start playing System.out.println("playing source " + nextSlot); al.sourcePlay(sources.get(nextSlot++)); if (nextSlot == 4) { nextSlot = startSlot; } //pause try { Thread.sleep(500); } catch (InterruptedException inte) { } //debug info if ((++iterations % 10) == 0) { System.out.println("========================"); System.out.println("MaxMemory: " + Runtime.getRuntime().maxMemory() / 1024); System.out.println("FreeMemory: " + Runtime.getRuntime().freeMemory() / 1024); System.out.println("TotalMemory: " + Runtime.getRuntime().totalMemory() / 1024); System.out.println("========================"); } } //test done - ask for user input try { System.out.println("Test completed"); System.out.println("========================"); System.out.println("MaxMemory: " + Runtime.getRuntime().maxMemory() / 1024); System.out.println("FreeMemory: " + Runtime.getRuntime().freeMemory() / 1024); System.out.println("TotalMemory: " + Runtime.getRuntime().totalMemory() / 1024); System.out.println("========================"); System.in.read(); } catch (Exception e) { } //stop all sources for (int i = 0; i < 4; i++) { al.sourceStop(sources.get(i)); } al.deleteSources(4, Sys.getDirectBufferAddress(sources)); al.deleteBuffers(10, Sys.getDirectBufferAddress(buffers)); } private int getRandomBuffer() { return (int) (Math.random() * 10.0); } /** * main entry point * * @param args String array containing arguments */ public static void main(String[] args) { StressTest stressTest = new StressTest(); stressTest.execute(args); } } |
From: Elias N. <eli...@us...> - 2002-12-18 16:40:16
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv28043/win32 Modified Files: LWJGL.cpp org_lwjgl_Display.cpp Log Message: Fixed the RegisterClass call Index: LWJGL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/LWJGL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/LWJGL.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- LWJGL.cpp 24 Aug 2002 21:16:53 -0000 1.4 +++ LWJGL.cpp 18 Dec 2002 16:40:12 -0000 1.5 @@ -41,7 +41,9 @@ #define WIN32_LEAN_AND_MEAN #include <windows.h> -#include <stdio.h> +#include <stdio.h> + +HINSTANCE dll_handle; /* * DLL entry point for Windows. Called when Java loads the .dll @@ -51,6 +53,7 @@ DWORD fdwReason, // reason for calling function LPVOID lpvReserved // reserved ) -{ +{ + dll_handle = hinstDLL; return TRUE; // Success } Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Display.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- org_lwjgl_Display.cpp 14 Dec 2002 15:23:53 -0000 1.8 +++ org_lwjgl_Display.cpp 18 Dec 2002 16:40:12 -0000 1.9 @@ -49,7 +49,8 @@ #define WINDOWCLASSNAME "LWJGLWINDOW" -// Initialise static variables +extern HINSTANCE dll_handle; +// Initialise static variables bool oneShotInitialised = false; HWND hwnd = NULL; // Handle to the window HDC hdc = NULL; // Device context @@ -210,7 +211,7 @@ windowClass.lpfnWndProc = WindowProc; windowClass.cbClsExtra = 0; windowClass.cbWndExtra = 0; - windowClass.hInstance = (HINSTANCE) GetCurrentProcess(); + windowClass.hInstance = dll_handle; windowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); windowClass.hCursor = LoadIcon(NULL, IDC_ARROW); windowClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); |
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv19558 Added Files: org_lwjgl_Sys.cpp org_lwjgl_opengl_BaseGL.cpp org_lwjgl_input_Mouse.cpp org_lwjgl_input_Keyboard.cpp org_lwjgl_input_Joystick.cpp Log Message: no message --- NEW FILE: org_lwjgl_Sys.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Sys.cpp /* * Copyright (c) 2002 Light Weight Java Game Library 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 'Light Weight Java Game Library' 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. */ /** * $Id: org_lwjgl_Sys.cpp,v 1.1 2002/12/18 03:38:57 gregorypierce Exp $ * * OSX system library. * * @author Gregory Pierce <me...@gr...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_Sys.h" /* * Class: org_lwjgl_Sys * Method: getDirectBufferAddress * Signature: (Ljava/nio/Buffer;)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_Sys_getDirectBufferAddress (JNIEnv * env, jclass clazz, jobject buf) { return (jint) env->GetDirectBufferAddress(buf); } /* * Class: org_lwjgl_Sys * Method: createDirectBuffer * Signature: (II)Ljava/nio/ByteBuffer; */ JNIEXPORT jobject JNICALL Java_org_lwjgl_Sys_createDirectBuffer (JNIEnv * env, jclass clazz, jint address, jint length) { return env->NewDirectByteBuffer((void *)address, length); } /* * Class: org_lwjgl_Sys * Method: getTimerResolution * Signature: ()J */ JNIEXPORT jlong JNICALL Java_org_lwjgl_Sys_getTimerResolution (JNIEnv * env, jclass clazz) { return 0L; } /* * Class: org_lwjgl_Sys * Method: getTime * Signature: ()J */ JNIEXPORT jlong JNICALL Java_org_lwjgl_Sys_getTime (JNIEnv * env, jclass clazz) { } /* * Class: org_lwjgl_Sys * Method: setTime * Signature: (J)V */ JNIEXPORT void JNICALL Java_org_lwjgl_Sys_setTime (JNIEnv * env, jclass clazz, jlong startTime) { } /* * Class: org_lwjgl_Sys * Method: setProcessPriority * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_Sys_setProcessPriority (JNIEnv * env, jclass clazz, jint priority) { } --- NEW FILE: org_lwjgl_opengl_BaseGL.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_BaseGL.cpp /* * Copyright (c) 2002 Light Weight Java Game Library 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 'Light Weight Java Game Library' 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. */ /** * $Id: org_lwjgl_opengl_BaseGL.cpp,v 1.1 2002/12/18 03:38:57 gregorypierce Exp $ * * Base OSX functionality for GL. * * @author Gregory Pierce <me...@gr...> * @version $Revision: 1.1 $ */ #include "extgl.h" #include "org_lwjgl_opengl_BaseGL.h" /* * Class: org_lwjgl_opengl_BaseGL * Method: nCreate * Signature: (IIII)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_BaseGL_nCreate (JNIEnv * env, jobject obj, jint colorBits, jint alphaBits, jint depthBits, jint stencilBits) { return JNI_TRUE; } /* * Class: org_lwjgl_opengl_BaseGL * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nDestroy (JNIEnv * env, jobject obj) { } /* * Class: org_lwjgl_opengl_BaseGL * Method: swapBuffers * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_swapBuffers(JNIEnv * env, jobject obj) { } /* * Class: org_lwjgl_opengl_BaseGL * Method: nMakeCurrent * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nMakeCurrent (JNIEnv * env, jobject obj) { } /* * * Class: org_lwjgl_opengl_BaseGL * * Method: nFreeContext * * Signature: ()V * */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nReleaseContext (JNIEnv *, jobject) { } --- NEW FILE: org_lwjgl_input_Mouse.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.cpp /* * Copyright (c) 2002 Light Weight Java Game Library 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 'Light Weight Java Game Library' 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. */ /** * $Id: org_lwjgl_input_Mouse.cpp,v 1.1 2002/12/18 03:38:57 gregorypierce Exp $ * * OSX mouse handling. * * @author Gregory Pierce <me...@gr...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_input_Mouse.h" /* * Class: org_lwjgl_input_Mouse * Method: initIDs * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_initIDs (JNIEnv * env, jclass clazz) { } /* * Class: org_lwjgl_input_Mouse * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nCreate (JNIEnv * env, jclass clazz) { return JNI_TRUE; } /* * Class: org_lwjgl_input_Mouse * Method: nGetNumButtons * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetNumButtons(JNIEnv *env, jclass clazz) { return (jint)NUM_BUTTONS; } /* * Class: org_lwjgl_input_Mouse * Method: nHasZValue * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nHasZValue(JNIEnv *env, jclass clazz) { return JNI_TRUE; } /* * Class: org_lwjgl_input_Mouse * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nDestroy (JNIEnv * env, jclass clazz) { } /* * Class: org_lwjgl_input_Mouse * Method: nPoll * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nPoll (JNIEnv * env, jclass clazz) { } /* * Class: org_lwjgl_input_Mouse * Method: nEnableBuffer * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nEnableBuffer (JNIEnv * env, jclass clazz) { } --- NEW FILE: org_lwjgl_input_Keyboard.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Keyboard.cpp /* * Copyright (c) 2002 Light Weight Java Game Library 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 'Light Weight Java Game Library' 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. */ /** * $Id: org_lwjgl_input_Keyboard.cpp,v 1.1 2002/12/18 03:38:57 gregorypierce Exp $ * * Linux keyboard handling. * * @author elias_naur <eli...@us...> * @version $Revision: 1.1 $ */ #include <X11/X.h> #include <X11/Xlib.h> #include <string.h> #include <assert.h> #include "org_lwjgl_input_Keyboard.h" #define KEYBOARD_BUFFER_SIZE 50 #define KEYBOARD_SIZE 256 #define KEY_EVENT_BACKLOG 20 unsigned char readBuffer[KEYBOARD_BUFFER_SIZE * 2]; jfieldID fid_readBuffer; jfieldID fid_readBufferAddress; unsigned char key_buf[KEYBOARD_SIZE]; unsigned char key_map[KEYBOARD_SIZE]; typedef struct { unsigned char keycode; unsigned char state; } input_event; input_event saved_key_events[KEY_EVENT_BACKLOG]; int list_start = 0; int list_end = 0; bool keyboard_grabbed; extern Display *disp; extern Window win; extern int current_fullscreen; extern int isFocused(void); /* * Class: org_lwjgl_input_Keyboard * Method: initIDs * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_initIDs (JNIEnv * env, jclass clazz) { // Get a global class instance, just to be sure static jobject globalClassLock = NULL; if (globalClassLock == NULL) { globalClassLock = env->NewGlobalRef(clazz); } fid_readBuffer = env->GetStaticFieldID(clazz, "readBuffer", "Ljava/nio/ByteBuffer;"); fid_readBufferAddress = env->GetStaticFieldID(clazz, "readBufferAddress", "I"); } int grabKeyboard(void) { int result = XGrabKeyboard(disp, win, False, GrabModeAsync, GrabModeAsync, CurrentTime); if (result == GrabSuccess) keyboard_grabbed = true; return result; } void ungrabKeyboard(void) { keyboard_grabbed = false; XUngrabKeyboard(disp, CurrentTime); } int updateKeyboardGrab(void) { if (current_fullscreen) { if (!keyboard_grabbed) return grabKeyboard(); } else { if (isFocused()) { if (!keyboard_grabbed) return grabKeyboard(); } else { if (keyboard_grabbed) ungrabKeyboard(); } } return GrabSuccess; } /* * Class: org_lwjgl_input_Keyboard * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nCreate (JNIEnv * env, jclass clazz) { keyboard_grabbed = 0; if (updateKeyboardGrab() != GrabSuccess) { #ifdef _DEBUG printf("Could not grab keyboard\n"); #endif return JNI_FALSE; } for (int i = 0; i < KEYBOARD_SIZE; i++) key_map[i] = i; key_map[0x6b] = 0xdb; // Left doze key key_map[0x6c] = 0xdc; // Right doze key key_map[0x6d] = 0xdd; // Apps key key_map[0x5a] = 0xc8; // Up arrow key_map[0x5c] = 0xcb; // Left arrow key_map[0x5e] = 0xcd; // Right arrow key_map[0x60] = 0xd0; // Down arrow key_map[0x59] = 0xc7; // Home key_map[0x62] = 0xd2; // Insert key_map[0x63] = 0xd3; // Delete key_map[0x5f] = 0xcf; // End key_map[0x5b] = 0xc9; // Page up key_map[0x61] = 0xd1; // Page down key_map[0x67] = 0xb7; // SysRQ key_map[0x66] = 0xc5; // Pause key_map[0x64] = 0x9c; // Numpad enter key_map[0x68] = 0xb5; // Numpad divide memset(key_buf, 0, KEYBOARD_SIZE*sizeof(unsigned char)); return JNI_TRUE; } /* * Class: org_lwjgl_input_Keyboard * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nDestroy (JNIEnv * env, jclass clazz) { if (keyboard_grabbed) ungrabKeyboard(); } input_event *nextEventElement(void) { if (list_start == list_end) return NULL; input_event *result = &(saved_key_events[list_start]); list_start = (list_start + 1)%KEY_EVENT_BACKLOG; return result; } void putEventElement(unsigned char keycode, unsigned char state) { int next_index = (list_end + 1)%KEY_EVENT_BACKLOG; if (next_index == list_start) return; saved_key_events[list_end].keycode = keycode; saved_key_events[list_end].state = state; list_end = next_index; } unsigned char getKeycode(XEvent *event) { unsigned char keycode = (unsigned char)((event->xkey.keycode - 8) & 0xff); keycode = key_map[keycode]; return keycode; } /* * Class: org_lwjgl_input_Keyboard * Method: nPoll * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nPoll (JNIEnv * env, jclass clazz, jint buf) { XEvent event; int state; updateKeyboardGrab(); while (XCheckMaskEvent(disp, KeyPressMask | KeyReleaseMask, &event)) { unsigned char keycode = getKeycode(&event); if (event.type == KeyPress) { state = 1; } else if (event.type == KeyRelease) { state = 0; } else assert(0); key_buf[keycode] = state; putEventElement(keycode, state); } memcpy((unsigned char*)buf, key_buf, KEYBOARD_SIZE*sizeof(unsigned char)); } /* * Class: org_lwjgl_input_Keyboard * Method: nRead * Signature: (I)V */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Keyboard_nRead (JNIEnv * env, jclass clazz, jint keys) { XEvent event; int count = 0; int buf_count = 0; int state; input_event *input_ev; unsigned char *result_buf = (unsigned char *)keys; updateKeyboardGrab(); while ((input_ev = nextEventElement()) != NULL) { count++; // printf("Reading a key %d %d count %d\n", (int)input_ev->keycode, (int)input_ev->state, count); result_buf[buf_count++] = input_ev->keycode; result_buf[buf_count++] = input_ev->state; if (buf_count >= KEYBOARD_BUFFER_SIZE * 2) return count; } while (XCheckMaskEvent(disp, KeyPressMask | KeyReleaseMask, &event)) { count++; unsigned char keycode = getKeycode(&event); if (event.type == KeyPress) { state = 1; } else if (event.type == KeyRelease) { state = 0; } else assert(0); key_buf[keycode] = state; result_buf[buf_count++] = keycode; result_buf[buf_count++] = state; if (buf_count >= KEYBOARD_BUFFER_SIZE * 2) return count; } return count; } /* * Class: org_lwjgl_input_Keyboard * Method: nEnableBuffer * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Keyboard_nEnableBuffer (JNIEnv * env, jclass clazz) { jobject newBuffer = env->NewDirectByteBuffer(&readBuffer, KEYBOARD_BUFFER_SIZE * 2); env->SetStaticObjectField(clazz, fid_readBuffer, newBuffer); env->SetStaticIntField(clazz, fid_readBufferAddress, (jint) (&readBuffer)); return KEYBOARD_BUFFER_SIZE; } --- NEW FILE: org_lwjgl_input_Joystick.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Joystick.cpp /* * Copyright (c) 2002 Light Weight Java Game Library 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 'Light Weight Java Game Library' 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. */ /** * $Id: org_lwjgl_input_Joystick.cpp,v 1.1 2002/12/18 03:38:57 gregorypierce Exp $ * * OSX analogue joystick handling. * * @author Gregory Pierce <me...@gr...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_input_Joystick.h" /** * Initializes any field ids */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Joystick_initIDs(JNIEnv * env, jclass clazz) { } /** * Called when the Joystick instance is to be created */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Joystick_nCreate(JNIEnv *env, jclass clazz) { return JNI_FALSE; } /* * Class: org_lwjgl_input_Joystick * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Joystick_nDestroy(JNIEnv *env, jclass clazz) { } /* * Class: org_lwjgl_input_Joystick * Method: nPoll * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Joystick_nPoll(JNIEnv * env, jclass clazz) { } |
From: Gregory P. <gre...@us...> - 2002-12-18 03:20:39
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv11547 Added Files: org_lwjgl_input_GamePad.cpp Log Message: no message --- NEW FILE: org_lwjgl_input_GamePad.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_GamePad.cpp /* * Copyright (c) 2002 Light Weight Java Game Library 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 'Light Weight Java Game Library' 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. */ /** * $Id: org_lwjgl_input_GamePad.cpp,v 1.1 2002/12/18 03:20:35 gregorypierce Exp $ * * Win32 digital (Atari) joystick handling. These days it's a gamepad. * * @author gregorypierce <me...@gr...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_input_GamePad.h" /* * Class: org_lwjgl_input_GamePad * Method: initIDs * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_GamePad_initIDs (JNIEnv * env, jclass clazz) {} /* * Class: org_lwjgl_input_GamePad * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_GamePad_nCreate (JNIEnv * env, jclass clazz) { printf("GamePad not implemented yet!\n"); return JNI_FALSE; } /* * Class: org_lwjgl_input_GamePad * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_GamePad_nDestroy (JNIEnv * env, jclass clazz) { } /* * Class: org_lwjgl_input_GamePad * Method: nPoll * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_GamePad_nPoll (JNIEnv * env, jclass clazz, jint buf) { } /* * Class: org_lwjgl_input_GamePad * Method: nRead * Signature: (I)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_GamePad_nRead (JNIEnv * env, jclass clazz, jint buf) { return 0; } /* * Class: org_lwjgl_input_GamePad * Method: nEnableBuffer * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_GamePad_nEnableBuffer (JNIEnv * env, jclass clazz) { return 0; } /* * Class: org_lwjgl_input_GamePad * Method: nGetNumButtons * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_GamePad_nGetNumButtons (JNIEnv * env, jclass clazz) { return 0; } |
From: Caspian Rychlik-P. <ci...@us...> - 2002-12-17 19:08:19
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/callbacks In directory sc8-pr-cvs1:/tmp/cvs-serv25717/src/native/common/callbacks Added Files: .cvsignore Log Message: Changed quotes to angle brackets for alut.h inclusion --- NEW FILE: .cvsignore --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/callbacks/.cvsignore Debug Release |
From: Caspian Rychlik-P. <ci...@us...> - 2002-12-17 19:07:59
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv25541/src/native/common Modified Files: org_lwjgl_openal_ALUT.cpp Log Message: Changed quotes to angle brackets for alut.h inclusion Index: org_lwjgl_openal_ALUT.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALUT.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALUT.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_openal_ALUT.cpp 14 Dec 2002 13:37:46 -0000 1.6 +++ org_lwjgl_openal_ALUT.cpp 17 Dec 2002 19:07:55 -0000 1.7 @@ -48,7 +48,7 @@ /* OpenAL includes */ #include "checkALerror.h" -#include "AL/alut.h" +#include <AL/alut.h> /* * Class: org_lwjgl_openal_ALUT |
From: Brian M. <ma...@us...> - 2002-12-15 22:24:51
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1:/tmp/cvs-serv6259 Modified Files: Joystick.java Log Message: beautification Index: Joystick.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Joystick.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Joystick.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Joystick.java 18 Nov 2002 17:50:10 -0000 1.9 +++ Joystick.java 15 Dec 2002 22:24:48 -0000 1.10 @@ -29,7 +29,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + package org.lwjgl.input; import org.lwjgl.Sys; @@ -57,51 +57,51 @@ static { initialize(); } - + /** Has the joystick been created? */ private static boolean created; - + /** The joystick buttons status */ private static boolean[] buttons; - + /** X position, range -1000 to 1000 */ public static int x = -1; - + /** Y position, range -1000 to 1000 */ public static int y = -1; - + /** Z position, range -1000 to 1000 */ public static int z = -1; - - /** Position of Point of View from -1 to 27000 (360 degrees) */ - public static int pov; - - /** Constant specifying centered POV */ - public static final int POV_CENTER = -1; - /** Constant specifying nortward POV */ - public static final int POV_NORTH = 0; + /** Position of Point of View from -1 to 27000 (360 degrees) */ + public static int pov; - /** Constant specifying southward POV */ - public static final int POV_SOUTH = 18000; + /** Constant specifying centered POV */ + public static final int POV_CENTER = -1; - /** Constant specifying eastward POV */ - public static final int POV_EAST = 27000; + /** Constant specifying nortward POV */ + public static final int POV_NORTH = 0; + + /** Constant specifying southward POV */ + public static final int POV_SOUTH = 18000; + + /** Constant specifying eastward POV */ + public static final int POV_EAST = 27000; + + /** Constant specifying westward POV */ + public static final int POV_WEST = 9000; + + /* Joystick capabilities */ + public static int buttonCount = -1; + public static boolean hasZAxis = false; + public static boolean hasPOV = false; - /** Constant specifying westward POV */ - public static final int POV_WEST = 9000; - - /* Joystick capabilities */ - public static int buttonCount = -1; - public static boolean hasZAxis = false; - public static boolean hasPOV = false; - /** * Joystick cannot be constructed. */ private Joystick() { } - + /** * Static initialization */ @@ -109,7 +109,7 @@ System.loadLibrary(Sys.getLibraryName()); initIDs(); } - + /** * "Create" the joystick. The display must first have been created. * @throws Exception if the joystick could not be created for any reason @@ -117,22 +117,22 @@ public static void create() throws Exception { if (created) { return; - } - + } + if (!nCreate()) { throw new Exception("The joystick could not be created."); - } + } created = true; } - + /** * "Destroy" the joystick */ public static void destroy() { if (!created) { return; - } - + } + created = false; nDestroy(); } @@ -143,8 +143,8 @@ public static void poll() { assert created : "The joystick has not been created."; nPoll(); - } - + } + /** * See if a particular mouse button is down. * @@ -156,24 +156,24 @@ assert created : "The joystick has not been created."; return buttons[button]; } - + /** * Native method to poll the joystick */ - private static native void nPoll(); - + private static native void nPoll(); + /** * Native method to create the joystick * * @return true if the joystick was created */ - private static native boolean nCreate(); - - /** - * Native method the destroy the joystick - */ + private static native boolean nCreate(); + + /** + * Native method the destroy the joystick + */ private static native void nDestroy(); - + /** * Register fields with the native library */ |
From: Caspian Rychlik-P. <ci...@us...> - 2002-12-15 22:12:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1:/tmp/cvs-serv1559/src/java/org/lwjgl Modified Files: Sys.java Log Message: Added DEBUG constant 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.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Sys.java 18 Oct 2002 23:28:04 -0000 1.11 +++ Sys.java 15 Dec 2002 22:12:46 -0000 1.12 @@ -77,15 +77,25 @@ /** The native library name */ private static String LIBRARY_NAME; + /** + * 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; + + private static boolean _debug; static { try { assert false; LIBRARY_NAME = "lwjgl"; + _debug = false; } catch (AssertionError e) { // Assertions are enabled, so we'll use the debug version of the // library LIBRARY_NAME = "lwjgl_d"; + _debug = true; } finally { + DEBUG = _debug; initialize(); } } @@ -178,5 +188,24 @@ * HIGH_PRIORITY, NORMAL_PRIORITY, or LOW_PRIORITY. */ public static native void setProcessPriority(int priority); + + /** + * Attempt to display a modal alert to the user. This method should be used + * when a game fails to initialize properly or crashes out losing its display + * in the process. It is provided because AWT may not be available on the target + * platform. + * + * The alert should display the title and the message and then the current + * thread should block until the user dismisses the alert - typically with an + * OK button click. + * + * It may be that the user's system has no windowing system installed for some + * reason, in which case this method may do nothing at all, or attempt to provide + * some console output. + * + * @param title The title of the alert. We suggest using the title of your game. + * @param message The message text for the alert. + */ + public static native void alert(String title, String message); } |
From: Brian M. <ma...@us...> - 2002-12-15 22:09:13
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv32434 Modified Files: SourceLimitTest.java Log Message: fix: even more beautification! Index: SourceLimitTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/SourceLimitTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/SourceLimitTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- SourceLimitTest.java 15 Dec 2002 22:05:10 -0000 1.2 +++ SourceLimitTest.java 15 Dec 2002 22:09:09 -0000 1.3 @@ -102,7 +102,7 @@ //delete sources al.deleteSources(sourcesToCreate, Sys.getDirectBufferAddress(sources)); - System.out.println("successfully created " + sourcesToCreate + " sources!"); + System.out.println("created " + sourcesToCreate + " sources successfully!"); } /** @@ -138,7 +138,7 @@ if(sourcesCreated != sourcesToCreate) { System.out.println("created " + sourcesCreated + " sources before failing"); } else { - System.out.println("created " + sourcesCreated + " sources successfully"); + System.out.println("created " + sourcesCreated + " sources successfully!"); } } |
From: Brian M. <ma...@us...> - 2002-12-15 22:05:12
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv30927 Modified Files: SourceLimitTest.java Log Message: fix: small beautification Index: SourceLimitTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/SourceLimitTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/SourceLimitTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SourceLimitTest.java 15 Dec 2002 22:01:00 -0000 1.1 +++ SourceLimitTest.java 15 Dec 2002 22:05:10 -0000 1.2 @@ -102,7 +102,7 @@ //delete sources al.deleteSources(sourcesToCreate, Sys.getDirectBufferAddress(sources)); - System.out.println("successfully created " + sourcesToCreate + "sources!"); + System.out.println("successfully created " + sourcesToCreate + " sources!"); } /** |
From: Brian M. <ma...@us...> - 2002-12-15 22:01:08
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv29986 Added Files: SourceLimitTest.java Log Message: simple test for testing the number of available sources --- NEW FILE: SourceLimitTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/SourceLimitTest.java /* * Copyright (c) 2002 Light Weight Java Game Library 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 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.test.openal; import org.lwjgl.Sys; import org.lwjgl.openal.AL; import java.nio.IntBuffer; /** * $Id: SourceLimitTest.java,v 1.1 2002/12/15 22:01:00 matzon Exp $ * * Simple test for testing the number of available sources * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class SourceLimitTest extends BasicTest { /** Sources to create */ protected int sourcesToCreate = 64; /** * Creates an instance of SourceLimitTest */ public SourceLimitTest() { super(); } /** * Runs the actual test, using supplied arguments */ protected void execute(String[] args) { //parse 1st arg to sourcecount if (args.length > 0) { try { sourcesToCreate = Integer.parseInt(args[0]); } catch (NumberFormatException nfe) { System.out.println( "Unable to parse parameter to integer. Defaulting to 64 sources."); } } //initialize AL alInitialize(); System.out.print("Creating " + sourcesToCreate + " in one go..."); CreateAllSources(); System.out.print("Creating " + sourcesToCreate + " one at a time..."); CreateSourcesStep(); //shutdown alExit(); } /** * Tests the creation of n sources in on go */ protected void CreateAllSources() { int lastError; //make bytbuffer that can hold sourcesToCreate sources IntBuffer sources = createIntBuffer(sourcesToCreate); //Create sourcesToCreate sources in one fell swoop al.genSources(sourcesToCreate, Sys.getDirectBufferAddress(sources)); if ((lastError = al.getError()) != AL.NO_ERROR) { System.out.println("failed to create " + sourcesToCreate + " sources"); return; } //delete sources al.deleteSources(sourcesToCreate, Sys.getDirectBufferAddress(sources)); System.out.println("successfully created " + sourcesToCreate + "sources!"); } /** * Tests if n sources can be created one at a time */ protected void CreateSourcesStep() { int lastError; int sourcesCreated = 0; //make bytbuffer that can hold sourcesToCreate sources IntBuffer sources = createIntBuffer(sourcesToCreate); //create the sources for (int i = 0; i < sourcesToCreate; i++) { al.genSources(1, Sys.getDirectBufferAddress(sources) + (i * 4)); if ((lastError = al.getError()) != AL.NO_ERROR) { System.out.println("failed to create source: " + (i + 1)); break; } sourcesCreated++; } //delete allocated sources for (int i = 0; i < sourcesCreated; i++) { //delete buffers and sources al.deleteSources(1, Sys.getDirectBufferAddress(sources) + (i * 4)); if ((lastError = al.getError()) != AL.NO_ERROR) { System.out.println("failed to delete source: " + i); break; } } if(sourcesCreated != sourcesToCreate) { System.out.println("created " + sourcesCreated + " sources before failing"); } else { System.out.println("created " + sourcesCreated + " sources successfully"); } } /** * main entry point * * @param args String array containing arguments */ public static void main(String[] args) { SourceLimitTest sourceLimitTest = new SourceLimitTest(); sourceLimitTest.execute(args); } } |
From: Elias N. <eli...@us...> - 2002-12-14 15:23:56
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv13855/win32 Modified Files: org_lwjgl_Display.cpp Log Message: Added a standard system error output Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Display.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- org_lwjgl_Display.cpp 24 Nov 2002 17:12:36 -0000 1.7 +++ org_lwjgl_Display.cpp 14 Dec 2002 15:23:53 -0000 1.8 @@ -53,7 +53,24 @@ bool oneShotInitialised = false; HWND hwnd = NULL; // Handle to the window HDC hdc = NULL; // Device context -LPDIRECTINPUT lpdi = NULL; +LPDIRECTINPUT lpdi = NULL; + +void dumpLastError(void) { + LPVOID lpMsgBuf; + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + 0, // Default language + (LPTSTR) &lpMsgBuf, + 0, + NULL + ); + printf("System error: %s\n", lpMsgBuf); + LocalFree(lpMsgBuf); +} /* * A dummy WindowProc which does nothing. Used so we can have an invisible OpenGL window @@ -178,16 +195,14 @@ { #ifdef _DEBUG printf("Creating display: size %dx%d %dhz %dbpp...\n", width, height, freq, bpp); -#endif - +#endif if (fullscreen && SetDisplayMode(width, height, bpp, freq) != 1) return JNI_FALSE; /* Register a window. This window does nothing, it's just a requirement that we get a handle to it so we can do other things - */ - + */ if (!oneShotInitialised) { WNDCLASS windowClass; @@ -203,9 +218,10 @@ windowClass.lpszClassName = WINDOWCLASSNAME; if (RegisterClass(&windowClass) == 0) { + dumpLastError(); printf("Failed to register window class\n"); return JNI_FALSE; - } + } oneShotInitialised = true; } |
From: Elias N. <eli...@us...> - 2002-12-14 13:52:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv23384/common Modified Files: extal.h Log Message: Even more linux oal fixes Index: extal.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extal.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- extal.h 14 Dec 2002 13:44:55 -0000 1.11 +++ extal.h 14 Dec 2002 13:52:25 -0000 1.12 @@ -53,6 +53,9 @@ #define ALCAPI __declspec(dllimport) #endif + typedef struct ALCdevice_struct ALCdevice; + typedef struct ALCcontext_struct ALCcontext; + #define ALCAPIENTRY __cdecl #else #ifdef TARGET_OS_MAC @@ -62,6 +65,40 @@ #endif #define ALCAPI #define ALCAPIENTRY + +/** ALC boolean type. */ +typedef char ALCboolean; + +/** ALC 8bit signed byte. */ +typedef char ALCbyte; + +/** ALC 8bit unsigned byte. */ +typedef unsigned char ALCubyte; + +/** ALC 16bit signed short integer type. */ +typedef short ALCshort; + +/** ALC 16bit unsigned short integer type. */ +typedef unsigned short ALCushort; + +/** ALC 32bit unsigned integer type. */ +typedef unsigned ALCuint; + +/** ALC 32bit signed integer type. */ +typedef int ALCint; + +/** ALC 32bit floating point type. */ +typedef float ALCfloat; + +/** ALC 64bit double point type. */ +typedef double ALCdouble; + +/** ALC 32bit type. */ +typedef unsigned int ALCsizei; + +/** ALC void type */ +typedef void ALCvoid; + #endif #ifdef _WIN32 @@ -99,9 +136,6 @@ #define INITGUID #define OPENAL - - typedef struct ALCdevice_struct ALCdevice; - typedef struct ALCcontext_struct ALCcontext; int InitializeOpenAL(); void DeInitializeOpenAL(); |
From: Elias N. <eli...@us...> - 2002-12-14 13:44:57
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv21877/common Modified Files: extal.c extal.h Log Message: More oal linux fixes Index: extal.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extal.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- extal.c 14 Dec 2002 13:37:46 -0000 1.4 +++ extal.c 14 Dec 2002 13:44:55 -0000 1.5 @@ -33,6 +33,10 @@ #include <stdio.h> #include "extal.h" +#ifndef _WIN32 +#include <dlfcn.h> +#endif + /** * $Id$ * @@ -150,7 +154,7 @@ #ifdef _WIN32 return GetProcAddress(handleOAL, function); #else - return NULL; + return dlsym(handleOAL, function); #endif } @@ -161,7 +165,7 @@ #ifdef _WIN32 handleOAL = LoadLibrary("OpenAL32.dll"); #else - handleOAL = NULL; + handleOAL = dlopen("libopenal.so", RTLD_LAZY); #endif } Index: extal.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extal.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- extal.h 14 Dec 2002 13:37:46 -0000 1.10 +++ extal.h 14 Dec 2002 13:44:55 -0000 1.11 @@ -107,7 +107,7 @@ void DeInitializeOpenAL(); //alc -typedef ALCubyte* (/*ALCAPIENTRY*/ *alcGetStringPROC)(ALCdevice *device,ALCenum param); +typedef ALCubyte* (ALCAPIENTRY *alcGetStringPROC)(ALCdevice *device,ALCenum param); typedef ALCvoid (ALCAPIENTRY *alcGetIntegervPROC)(ALCdevice *device,ALCenum param,ALCsizei size,ALCint *data); typedef ALCdevice* (ALCAPIENTRY *alcOpenDevicePROC)(ALCubyte *deviceName); typedef ALCvoid (ALCAPIENTRY *alcCloseDevicePROC)(ALCdevice *device); |
From: Elias N. <eli...@us...> - 2002-12-14 13:37:50
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv20087/common Modified Files: extal.c extal.h org_lwjgl_openal_ALUT.cpp Log Message: Fixed oal dynamic loading on linux Index: extal.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extal.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- extal.c 14 Dec 2002 12:49:16 -0000 1.3 +++ extal.c 14 Dec 2002 13:37:46 -0000 1.4 @@ -30,6 +30,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <stdio.h> #include "extal.h" /** @@ -111,11 +112,11 @@ alcGetProcAddressPROC alcGetProcAddress = NULL; alcGetEnumValuePROC alcGetEnumValue = NULL; +#ifdef _WIN32 EAXSet eaxSet; // EAXSet function, ret$ EAXGet eaxGet; // EAXGet function, ret$ /* Handle to OpenAL Library */ -#ifdef WIN32 HMODULE handleOAL; #else void* handleOAL; @@ -383,4 +384,4 @@ */ int LoadALExtensions() { return 1; -} \ No newline at end of file +} Index: extal.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extal.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- extal.h 14 Dec 2002 12:49:16 -0000 1.9 +++ extal.h 14 Dec 2002 13:37:46 -0000 1.10 @@ -33,7 +33,9 @@ #ifndef _AL_TEST_H #define _AL_TEST_H +#ifdef _WIN32 #include <windows.h> +#endif #include <AL/altypes.h> #include <AL/alctypes.h> @@ -51,9 +53,6 @@ #define ALCAPI __declspec(dllimport) #endif - typedef struct ALCdevice_struct ALCdevice; - typedef struct ALCcontext_struct ALCcontext; - #define ALCAPIENTRY __cdecl #else #ifdef TARGET_OS_MAC @@ -62,7 +61,7 @@ #endif #endif #define ALCAPI - #define ALCAPIENTRY __cdecl + #define ALCAPIENTRY #endif #ifdef _WIN32 @@ -80,10 +79,11 @@ #endif #endif #define ALAPI - #define ALAPIENTRY __cdecl + #define ALAPIENTRY #define AL_CALLBACK #endif +#ifdef _WIN32 DEFINE_GUID(DSPROPSETID_EAX20_ListenerProperties, 0x306a6a8, 0xb224, @@ -95,15 +95,19 @@ 0xb224, 0x11d2, 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22); +#endif #define INITGUID #define OPENAL + typedef struct ALCdevice_struct ALCdevice; + typedef struct ALCcontext_struct ALCcontext; + int InitializeOpenAL(); void DeInitializeOpenAL(); //alc -typedef ALCubyte* (ALCAPIENTRY *alcGetStringPROC)(ALCdevice *device,ALCenum param); +typedef ALCubyte* (/*ALCAPIENTRY*/ *alcGetStringPROC)(ALCdevice *device,ALCenum param); typedef ALCvoid (ALCAPIENTRY *alcGetIntegervPROC)(ALCdevice *device,ALCenum param,ALCsizei size,ALCint *data); typedef ALCdevice* (ALCAPIENTRY *alcOpenDevicePROC)(ALCubyte *deviceName); typedef ALCvoid (ALCAPIENTRY *alcCloseDevicePROC)(ALCdevice *device); @@ -252,14 +256,16 @@ extern alDopplerFactorPROC alDopplerFactor; extern alDopplerVelocityPROC alDopplerVelocity; +#ifdef _WIN32 typedef ALenum (*EAXSet)(const GUID*, ALuint, ALuint, ALvoid*, ALuint); typedef ALenum (*EAXGet)(const GUID*, ALuint, ALuint, ALvoid*, ALuint); extern EAXSet eaxSet; extern EAXGet eaxGet; +#endif #ifdef __cplusplus } #endif -#endif \ No newline at end of file +#endif Index: org_lwjgl_openal_ALUT.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALUT.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALUT.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_openal_ALUT.cpp 14 Dec 2002 12:54:25 -0000 1.5 +++ org_lwjgl_openal_ALUT.cpp 14 Dec 2002 13:37:46 -0000 1.6 @@ -42,7 +42,9 @@ #include "org_lwjgl_openal_ALUT.h" #include <stdlib.h> +#ifdef _WIN32 #include <windows.h> +#endif /* OpenAL includes */ #include "checkALerror.h" @@ -175,4 +177,4 @@ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALUT_unloadWAV (JNIEnv *env, jobject obj, jint format, jint data, jint size, jint freq) { alutUnloadWAV(format, (void**) data, size, freq); CHECK_AL_ERROR -} \ No newline at end of file +} |
From: Brian M. <ma...@us...> - 2002-12-14 12:54:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv22620 Modified Files: org_lwjgl_openal_ALUT.cpp org_lwjgl_openal_ALUT.h Log Message: removed dynamic loading, since alut is statically linked (doh!) Index: org_lwjgl_openal_ALUT.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALUT.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALUT.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- org_lwjgl_openal_ALUT.cpp 14 Dec 2002 12:49:16 -0000 1.4 +++ org_lwjgl_openal_ALUT.cpp 14 Dec 2002 12:54:25 -0000 1.5 @@ -54,7 +54,7 @@ * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALUT_nCreate (JNIEnv *env, jobject obj) { - return InitializeOpenAL(); + return true; } /* Index: org_lwjgl_openal_ALUT.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALUT.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALUT.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- org_lwjgl_openal_ALUT.h 14 Dec 2002 12:49:16 -0000 1.7 +++ org_lwjgl_openal_ALUT.h 14 Dec 2002 12:54:25 -0000 1.8 @@ -40,7 +40,6 @@ extern "C" { #endif -extern int InitializeOpenAL(); /* * Class: org_lwjgl_openal_ALUT * Method: nCreate |