You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
|
2
|
3
|
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
|
11
|
12
|
13
|
14
|
15
(1) |
16
(21) |
17
(5) |
|
18
(5) |
19
(14) |
20
(5) |
21
|
22
|
23
(2) |
24
(18) |
|
25
(3) |
26
(22) |
27
(8) |
28
(10) |
29
(11) |
30
(9) |
31
|
|
From: Caspian Rychlik-P. <ci...@us...> - 2002-08-26 22:24:01
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory usw-pr-cvs1:/tmp/cvs-serv15124/src/java/org/lwjgl Modified Files: Math.java Log Message: Fixed more stuff Index: Math.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Math.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Math.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Math.java 26 Aug 2002 20:39:28 -0000 1.7 +++ Math.java 26 Aug 2002 22:23:59 -0000 1.8 @@ -81,7 +81,7 @@ protected MatrixOpClassification unsafe() { return this; } protected MatrixOpClassification safe() { return this; } protected MatrixOpClassification direct() { return this; } - protected MatrixOpClassification offset() { return this; } + boolean isSafe() { return false; } void execute( int leftSourceAddress, @@ -136,6 +136,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return MATRIXOP_SAFE; } protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; } + boolean isSafe() { return false; } }; /** @@ -146,6 +147,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return this; } protected MatrixOpClassification direct() { return this; } + boolean isSafe() { return false; } native void execute( int sourceAddress, int sourceStride, @@ -167,6 +169,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return MATRIXOP_SAFE; } protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; } + boolean isSafe() { return true; } native void execute( int sourceAddress, int sourceStride, @@ -200,6 +203,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return MATRIXOP_SAFE; } protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; } + boolean isSafe() { return false; } }; /** @@ -210,6 +214,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return this; } protected MatrixOpClassification direct() { return this; } + boolean isSafe() { return false; } native void execute( int sourceAddress, int sourceStride, @@ -231,6 +236,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return MATRIXOP_SAFE; } protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; } + boolean isSafe() { return true; } native void execute( int sourceAddress, int sourceStride, @@ -264,6 +270,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return MATRIXOP_SAFE; } protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; } + boolean isSafe() { return true; } }; /** @@ -274,6 +281,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return this; } protected MatrixOpClassification direct() { return this; } + boolean isSafe() { return false; } native void execute( int sourceAddress, int sourceStride, @@ -295,6 +303,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return MATRIXOP_SAFE; } protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; } + boolean isSafe() { return true; } native void execute( int sourceAddress, int sourceStride, @@ -328,6 +337,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return MATRIXOP_SAFE; } protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; } + boolean isSafe() { return false; } }; /** @@ -338,6 +348,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return this; } protected MatrixOpClassification direct() { return this; } + boolean isSafe() { return false; } native void execute( int sourceAddress, int sourceStride, @@ -359,6 +370,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return MATRIXOP_SAFE; } protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; } + boolean isSafe() { return true; } native void execute( int sourceAddress, int sourceStride, @@ -448,6 +460,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return MATRIXOP_SAFE; } protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; } + boolean isSafe() { return false; } }; /** @@ -458,6 +471,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return this; } protected MatrixOpClassification direct() { return this; } + boolean isSafe() { return false; } native void execute( int leftSourceAddress, int leftSourceStride, @@ -486,6 +500,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return MATRIXOP_SAFE; } protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; } + boolean isSafe() { return true; } native void execute( int leftSourceAddress, int leftSourceStride, @@ -546,6 +561,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return MATRIXOP_SAFE; } protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; } + boolean isSafe() { return false; } }; /** @@ -556,6 +572,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return this; } protected MatrixOpClassification direct() { return this; } + boolean isSafe() { return false; } native void execute( int leftSourceAddress, int leftSourceStride, @@ -584,6 +601,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return MATRIXOP_SAFE; } protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; } + boolean isSafe() { return true; } native void execute( int leftSourceAddress, int leftSourceStride, @@ -643,6 +661,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return MATRIXOP_SAFE; } protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; } + boolean isSafe() { return false; } }; /** @@ -653,6 +672,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return this; } protected MatrixOpClassification direct() { return this; } + boolean isSafe() { return false; } native void execute( int leftSourceAddress, int leftSourceStride, @@ -681,6 +701,7 @@ protected MatrixOpClassification unsafe() { return MATRIXOP_UNSAFE; } protected MatrixOpClassification safe() { return MATRIXOP_SAFE; } protected MatrixOpClassification direct() { return MATRIXOP_DIRECT; } + boolean isSafe() { return true; } native void execute( int leftSourceAddress, int leftSourceStride, @@ -830,14 +851,42 @@ * be safe; otherwise if is direct, then the side where n > 1 must be * the destination. */ - abstract MatrixOpClassification checkBinaryOp( + MatrixOpClassification checkBinaryOp( int leftSourceElements, int rightSourceElements, int leftSourceAddress, int rightSourceAddress, int destinationAddress - ); + ) { + + if (leftSourceElements > 1 && rightSourceElements > 1) { + if (isSafe()) + return this; + else + return MATRIXOP_UNSAFE; + } else if (leftSourceElements == 1 && rightSourceElements > 1) { + if (isSafe()) + return this; + else if (destinationAddress == rightSourceAddress) + return this; + else + return MATRIXOP_UNSAFE; + } else if (rightSourceElements == 1 && leftSourceElements > 1) { + if (isSafe()) + return this; + else if (destinationAddress == leftSourceAddress) + return this; + else + return MATRIXOP_UNSAFE; + } else { + return MATRIXOP_UNSAFE; + } + } + /** + * @return true if this is a safe classification + */ + abstract boolean isSafe(); public final MatrixOpClassification check( int sourceAddress, |
|
From: Brian M. <ma...@us...> - 2002-08-26 22:16:30
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv12880 Modified Files: org_lwjgl_openal_ALC.cpp Log Message: fix: NULL check in getString fix: wrong object being used when retrieving fields Index: org_lwjgl_openal_ALC.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALC.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/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 26 Aug 2002 21:28:30 -0000 1.5 +++ org_lwjgl_openal_ALC.cpp 26 Aug 2002 22:16:25 -0000 1.6 @@ -53,9 +53,14 @@ JNIEXPORT jstring JNICALL Java_org_lwjgl_openal_ALC_getString (JNIEnv *env, jobject obj, jobject device, jint token) { jclass class_device = env->GetObjectClass(device); jfieldID field_device = env->GetFieldID(class_device, "device", "I"); - jint deviceaddress = env->GetIntField(obj, field_device); + jint deviceaddress = env->GetIntField(device, field_device); - jstring string = env->NewStringUTF((const char*) alcGetString((ALCdevice*) deviceaddress, (ALenum) token)); + const char* alcString = (const char*) alcGetString((ALCdevice*) deviceaddress, (ALenum) token); + if(alcString == NULL) { + return NULL; + } + + jstring string = env->NewStringUTF(alcString); CHECK_ALC_ERROR return string; @@ -70,7 +75,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_getIntegerv (JNIEnv *env, jobject obj, jobject device, jint token, jint size, jint dest) { jclass device_class = env->GetObjectClass(device); jfieldID device_field = env->GetFieldID(device_class, "device", "I"); - jint deviceaddress = env->GetIntField(obj, device_field); + jint deviceaddress = env->GetIntField(device, device_field); alcGetIntegerv((ALCdevice*) deviceaddress, (ALenum) token, (ALsizei) size, (ALint*) dest); CHECK_ALC_ERROR |
|
From: Brian M. <ma...@us...> - 2002-08-26 21:28:37
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv29317 Modified Files: org_lwjgl_openal_ALC.cpp Log Message: fix: allow null to be passed to openDevice Index: org_lwjgl_openal_ALC.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALC.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALC.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- org_lwjgl_openal_ALC.cpp 26 Aug 2002 18:23:10 -0000 1.4 +++ org_lwjgl_openal_ALC.cpp 26 Aug 2002 21:28:30 -0000 1.5 @@ -83,14 +83,22 @@ * ALCdevice *alcOpenDevice( const ALubyte *tokstr ); */ JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALC_openDevice (JNIEnv *env, jobject obj, jstring tokstr) { - ALubyte* tokenstring = (ALubyte*) (env->GetStringUTFChars(tokstr, 0)); + ALubyte* tokenstring; + + if(tokstr != NULL) { + tokenstring = (ALubyte*) (env->GetStringUTFChars(tokstr, 0)); + } else { + tokenstring = NULL; + } /* get device */ ALCdevice* device = alcOpenDevice(tokenstring); /* if error - cleanup and get out */ if(device == NULL) { - env->ReleaseStringUTFChars((jstring)tokenstring, 0); + if(tokenstring != NULL) { + env->ReleaseStringUTFChars((jstring)tokenstring, 0); + } return NULL; } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2002-08-26 21:17:57
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory usw-pr-cvs1:/tmp/cvs-serv25836/src/java/org/lwjgl/opengl Modified Files: GL.java GLUConstants.java Log Message: *** keyword substitution change *** 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.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 Index: GLUConstants.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLUConstants.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLUConstants.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 |
|
From: Brian M. <ma...@us...> - 2002-08-26 21:10:12
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv23306/org/lwjgl/openal/test Modified Files: PlayTest.java Added Files: BasicTest.java Log Message: add: new basic test class to make testing easier mod: PlayTest now inherits from BasicTest --- NEW FILE: BasicTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/BasicTest.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.openal.test; import org.lwjgl.openal.AL; import org.lwjgl.openal.ALC; import org.lwjgl.openal.ALCcontext; import org.lwjgl.openal.ALCdevice; import org.lwjgl.openal.ALUT; /** * $Id: BasicTest.java,v 1.1 2002/08/26 21:10:08 matzon Exp $ * * This is a basic test, which contains the most used stuff * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public abstract class BasicTest { /** OpenAL instance */ protected AL al; /** OpenAL Context instance */ protected ALC alc; /** OpenAL Util library instance */ protected ALUT alut; /** OpenAL context */ protected ALCcontext context; /** OpenAL device */ protected ALCdevice device; /** * Creates an instance of PlayTest */ public BasicTest() { al = new AL(); alc = new ALC(); alut = new ALUT(); } /** * Initializes OpenAL */ protected void alInitialize() { //get default device device = alc.openDevice(""); if(device == null) { throw new RuntimeException("Error creating device"); } //create context (no attributes specified) context = alc.createContext(device, 0); if(context == null) { throw new RuntimeException("Error creating context"); } //make context current alc.makeContextCurrent(context); if(alc.getError(device) != ALC.NO_ERROR) { throw new RuntimeException("An error occurred while making context current"); } } /** * Exits the test NOW, printing errorcode to stdout * * @param error Error code causing exit */ protected void exit(int error) { System.out.println("OpenAL Error: " + al.getString(error)); alut.exit(); System.exit(-1); } } Index: PlayTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/PlayTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/PlayTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- PlayTest.java 26 Aug 2002 20:17:55 -0000 1.2 +++ PlayTest.java 26 Aug 2002 21:10:08 -0000 1.3 @@ -49,30 +49,13 @@ * @author Brian Matzon <br...@ma...> * @version $Revision$ */ -public class PlayTest { - - /** OpenAL instance */ - protected AL al; - - /** OpenAL Context instance */ - protected ALC alc; - - /** OpenAL Util library instance */ - protected ALUT alut; - - /** OpenAL context */ - protected ALCcontext context; - - /** OpenAL device */ - protected ALCdevice device; +public class PlayTest extends BasicTest { /** * Creates an instance of PlayTest */ public PlayTest() { - al = new AL(); - alc = new ALC(); - alut = new ALUT(); + super(); } protected void execute(String[] args) { @@ -166,36 +149,6 @@ //shutdown alc.destroyContext(context); alc.closeDevice(device); - } - - /** - * Initializes OpenAL - */ - protected void alInitialize() { - - //get default device - device = alc.openDevice(""); - if(device == null) { - throw new RuntimeException("Error creating device"); - } - - //create context (no attributes specified) - context = alc.createContext(device, 0); - if(context == null) { - throw new RuntimeException("Error creating context"); - } - - //make context current - alc.makeContextCurrent(context); - if(alc.getError(device) != ALC.NO_ERROR) { - throw new RuntimeException("An error occurred while making context current"); - } - } - - protected void exit(int error) { - System.out.println("OpenAL Error: " + al.getString(error)); - alut.exit(); - System.exit(-1); } /** |
|
From: Caspian Rychlik-P. <ci...@us...> - 2002-08-26 21:05:23
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory usw-pr-cvs1:/tmp/cvs-serv20858/src/java/org/lwjgl/input Modified Files: GamePad.java Joystick.java Mouse.java Keyboard.java Log Message: *** keyword substitution change *** Index: GamePad.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/GamePad.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/GamePad.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 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.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 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.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 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.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 |
|
From: Brian M. <ma...@us...> - 2002-08-26 20:57:21
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory usw-pr-cvs1:/tmp/cvs-serv17475 Modified Files: GLUConstants.java Log Message: fix: removed double ; Index: GLUConstants.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLUConstants.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLUConstants.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- GLUConstants.java 15 Aug 2002 16:18:12 -0000 1.5 +++ GLUConstants.java 26 Aug 2002 20:57:18 -0000 1.6 @@ -74,7 +74,7 @@ public static final int INSIDE = 100021; /* Callback types: */ - /* ERROR = 100103 */; + /* ERROR = 100103 */ /**** Tesselation constants ****/ @@ -158,12 +158,12 @@ public static final int MAP1_TRIM_3 = 100211; /* NurbsDisplay */ - /* FILL = 100012 */; + /* FILL = 100012 */ public static final int OUTLINE_POLYGON = 100240; public static final int OUTLINE_PATCH = 100241; /* NurbsCallback */ - /* ERROR = 100103 */; + /* ERROR = 100103 */ /* NurbsErrors */ public static final int NURBS_ERROR1 = 100251; |
|
From: Brian M. <ma...@us...> - 2002-08-26 20:56:47
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory usw-pr-cvs1:/tmp/cvs-serv17297 Modified Files: GL.java Log Message: fix: removed double ; 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.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- GL.java 24 Aug 2002 21:15:03 -0000 1.7 +++ GL.java 26 Aug 2002 20:56:42 -0000 1.8 @@ -1490,7 +1490,7 @@ public boolean ATI_fragment_shader; public boolean ATI_pn_triangles; public boolean ATI_texture_mirror_once; - public boolean ATI_vertex_array_object;; + public boolean ATI_vertex_array_object; public boolean ATI_vertex_streams; public boolean ATIX_point_sprites; public boolean ATIX_texture_env_route; |
|
From: Caspian Rychlik-P. <ci...@us...> - 2002-08-26 20:39:31
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory usw-pr-cvs1:/tmp/cvs-serv11804/src/java/org/lwjgl Modified Files: Math.java Log Message: This n that Index: Math.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Math.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Math.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Math.java 23 Aug 2002 16:14:21 -0000 1.6 +++ Math.java 26 Aug 2002 20:39:28 -0000 1.7 @@ -405,6 +405,8 @@ boolean transposeRightSource, boolean transposeDest); + + abstract MatrixOpClassification classify(); } @@ -822,6 +824,21 @@ boolean transposeDest) { } + /** + * Check a binary operation to make sure that when dealing with n x n + * result sets that when both n's are greater than 1 the operation must + * be safe; otherwise if is direct, then the side where n > 1 must be + * the destination. + */ + abstract MatrixOpClassification checkBinaryOp( + int leftSourceElements, + int rightSourceElements, + int leftSourceAddress, + int rightSourceAddress, + int destinationAddress + ); + + public final MatrixOpClassification check( int sourceAddress, int sourceStride, @@ -1014,6 +1031,7 @@ // Check unary matrix operation type MatrixOpClassification op = operation.classify().check(leftSourceAddress, leftSourceStride, leftElements, destAddress, destStride); op = op.check(rightSourceAddress, rightSourceStride, rightElements, destAddress, destStride); + op = op.checkBinaryOp(leftElements, rightElements, leftSourceAddress, rightSourceAddress, destAddress); op.execute( leftSourceAddress, leftSourceStride, |
|
From: Caspian Rychlik-P. <ci...@us...> - 2002-08-26 20:24:32
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory usw-pr-cvs1:/tmp/cvs-serv6851/src/java/org/lwjgl/vector Modified Files: Vector3f.java Matrix2f.java Matrix4f.java Vector2f.java Vector.java Vector4f.java Matrix3f.java Matrix.java Log Message: *** keyword substitution change *** Index: Vector3f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector3f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector3f.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 Index: Matrix2f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix2f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix2f.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 Index: Matrix4f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix4f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix4f.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 Index: Vector2f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector2f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector2f.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 Index: Vector.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Index: Vector4f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector4f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector4f.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 Index: Matrix3f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix3f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix3f.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 Index: Matrix.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 |
|
From: Brian M. <ma...@us...> - 2002-08-26 20:18:00
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv4563/org/lwjgl/openal/test Modified Files: PlayTest.java Log Message: add: javadoc comment on getError Index: PlayTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/PlayTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/PlayTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- PlayTest.java 26 Aug 2002 19:53:21 -0000 1.1 +++ PlayTest.java 26 Aug 2002 20:17:55 -0000 1.2 @@ -44,6 +44,7 @@ * $Id$ * * This is a basic play test + * Yes, over zealous use of getError ;) * * @author Brian Matzon <br...@ma...> * @version $Revision$ |
|
From: Brian M. <ma...@us...> - 2002-08-26 19:53:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv27549 Added Files: PlayTest.java Log Message: initial import of first basic test (wee) --- NEW FILE: PlayTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/PlayTest.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.openal.test; import org.lwjgl.openal.AL; import org.lwjgl.openal.ALC; import org.lwjgl.openal.ALCcontext; import org.lwjgl.openal.ALCdevice; import org.lwjgl.openal.ALUT; import org.lwjgl.openal.ALUTLoadWAVData; import java.io.*; import java.net.*; /** * $Id: PlayTest.java,v 1.1 2002/08/26 19:53:21 matzon Exp $ * * This is a basic play test * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class PlayTest { /** OpenAL instance */ protected AL al; /** OpenAL Context instance */ protected ALC alc; /** OpenAL Util library instance */ protected ALUT alut; /** OpenAL context */ protected ALCcontext context; /** OpenAL device */ protected ALCdevice device; /** * Creates an instance of PlayTest */ public PlayTest() { al = new AL(); alc = new ALC(); alut = new ALUT(); } protected void execute(String[] args) { if(args.length < 1) { System.out.println("please specify filename to play"); return; } int lastError; //initialize AL, using ALC alInitialize(); //create 1 buffer and 1 source int[] buffers = new int[1]; int[] sources = new int[1]; // al generate buffers and sources al.genBuffers(1, buffers); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } al.genSources(1, sources); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //load wave data ALUTLoadWAVData file = alut.loadWAVFile(args[0]); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //copy to buffers al.bufferData(buffers[0], file.format, file.data, file.size, file.freq); 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); } //set up source input al.sourcei(sources[0], AL.BUFFER, buffers[0]); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //lets loop the sound al.sourcei(sources[0], AL.LOOPING, AL.TRUE); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //play source 0 al.sourcePlay(sources[0]); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //wait 5 secs try { System.out.println("Waiting 5 seconds for sound to complete"); Thread.sleep(5000); } catch (InterruptedException inte) { } //stop source 0 al.sourceStop(sources[0]); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //delete buffers and sources al.deleteSources(1, sources); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } al.deleteBuffers(1, buffers); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //no errorchecking from now on, since our context is gone. //shutdown alc.destroyContext(context); alc.closeDevice(device); } /** * Initializes OpenAL */ protected void alInitialize() { //get default device device = alc.openDevice(""); if(device == null) { throw new RuntimeException("Error creating device"); } //create context (no attributes specified) context = alc.createContext(device, 0); if(context == null) { throw new RuntimeException("Error creating context"); } //make context current alc.makeContextCurrent(context); if(alc.getError(device) != ALC.NO_ERROR) { throw new RuntimeException("An error occurred while making context current"); } } protected void exit(int error) { System.out.println("OpenAL Error: " + al.getString(error)); alut.exit(); System.exit(-1); } /** * main entry point * * @param args String array containing arguments */ public static void main(String[] args) { PlayTest playTest = new PlayTest(); playTest.execute(args); } } |
|
From: Brian M. <ma...@us...> - 2002-08-26 18:29:11
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv32479/test Log Message: Directory /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test added to the repository |
|
From: Brian M. <ma...@us...> - 2002-08-26 18:23:14
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv30337 Modified Files: org_lwjgl_openal_ALC.cpp org_lwjgl_openal_ALUT.cpp org_lwjgl_openal_CoreAL.cpp Log Message: add: macro AL error checking Index: org_lwjgl_openal_ALC.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALC.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALC.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_openal_ALC.cpp 26 Aug 2002 15:07:31 -0000 1.3 +++ org_lwjgl_openal_ALC.cpp 26 Aug 2002 18:23:10 -0000 1.4 @@ -39,6 +39,7 @@ * @version $Revision$ */ #include "org_lwjgl_openal_ALC.h" +#include "checkALerror.h" /* OpenAL includes */ #include <alc.h> @@ -54,7 +55,10 @@ jfieldID field_device = env->GetFieldID(class_device, "device", "I"); jint deviceaddress = env->GetIntField(obj, field_device); - return env->NewStringUTF((const char*) alcGetString((ALCdevice*) deviceaddress, (ALenum) token)); + jstring string = env->NewStringUTF((const char*) alcGetString((ALCdevice*) deviceaddress, (ALenum) token)); + + CHECK_ALC_ERROR + return string; } /** @@ -69,6 +73,7 @@ jint deviceaddress = env->GetIntField(obj, device_field); alcGetIntegerv((ALCdevice*) deviceaddress, (ALenum) token, (ALsizei) size, (ALint*) dest); + CHECK_ALC_ERROR } /** @@ -119,6 +124,7 @@ jint deviceaddress = env->GetIntField(device, device_field); alcCloseDevice((ALCdevice*) deviceaddress); + CHECK_ALC_ERROR } /** @@ -152,6 +158,7 @@ /* create instance */ alcContext_object = env->NewObject(alcContext_class, alcContext_method, (int) context); + CHECK_ALC_ERROR return alcContext_object; } @@ -288,7 +295,9 @@ jfieldID device_field = env->GetFieldID(device_class, "device", "I"); jint deviceaddress = env->GetIntField(device, device_field); - return (jint) alcGetError((ALCdevice*) deviceaddress); + jint result = alcGetError((ALCdevice*) deviceaddress); + CHECK_ALC_ERROR + return result; } /** @@ -310,6 +319,7 @@ env->ReleaseStringUTFChars((jstring)functionname, 0); + CHECK_ALC_ERROR return result; } @@ -332,6 +342,7 @@ env->ReleaseStringUTFChars((jstring)functionname, 0); + CHECK_ALC_ERROR return result; } @@ -354,5 +365,6 @@ env->ReleaseStringUTFChars((jstring)enumerationname, 0); + CHECK_ALC_ERROR return result; } Index: org_lwjgl_openal_ALUT.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALUT.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/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 18 Aug 2002 13:56:29 -0000 1.4 +++ org_lwjgl_openal_ALUT.cpp 26 Aug 2002 18:23:11 -0000 1.5 @@ -40,6 +40,7 @@ * @version $Revision$ */ #include "org_lwjgl_openal_ALUT.h" +#include "checkALerror.h" /* OpenAL includes */ #include <alut.h> @@ -79,6 +80,7 @@ /* call the actual implementation */ alutInit((ALint*) &argc,(char**) argv); + CHECK_AL_ERROR } /* * This function loads a WAV file into memory from a file. @@ -128,6 +130,7 @@ /* release chars */ env->ReleaseStringUTFChars((jstring)filename, 0); + CHECK_AL_ERROR return alutLoadWAVFile_object; } @@ -179,6 +182,7 @@ /* release bytearray again */ env->ReleaseByteArrayElements(buffer, (jbyte*) bufferlocation, 0); + CHECK_AL_ERROR return alutLoadWAVFile_object; } @@ -191,6 +195,7 @@ */ 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 } /** @@ -201,4 +206,5 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALUT_exit (JNIEnv *env, jobject obj) { alutExit(); + CHECK_AL_ERROR } Index: org_lwjgl_openal_CoreAL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_CoreAL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_CoreAL.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_openal_CoreAL.cpp 19 Aug 2002 13:54:34 -0000 1.2 +++ org_lwjgl_openal_CoreAL.cpp 26 Aug 2002 18:23:11 -0000 1.3 @@ -40,6 +40,7 @@ * @version $Revision$ */ #include "org_lwjgl_openal_CoreAL.h" +#include "checkALerror.h" /* OpenAL includes */ #include <al.h> @@ -52,6 +53,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_enable (JNIEnv *env, jobject obj, jint capability) { alEnable((ALenum) capability); + CHECK_AL_ERROR } /** @@ -62,6 +64,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_disable (JNIEnv *env, jobject obj, jint capability) { alDisable((ALenum) capability); + CHECK_AL_ERROR } /** @@ -71,7 +74,10 @@ * Alboolean alIsEnabled(ALenum capability); */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_CoreAL_isEnabled (JNIEnv *env, jobject obj, jint capability) { - return (jboolean) alIsEnabled((ALenum) capability); + jboolean result = (jboolean) alIsEnabled((ALenum) capability); + + CHECK_AL_ERROR + return result; } /** @@ -94,7 +100,10 @@ * Alboolean alGetBoolean(ALenum pname); */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_CoreAL_getBoolean (JNIEnv *env, jobject obj, jint pname) { - return (jboolean) alGetBoolean((ALenum) pname); + jboolean result = (jboolean) alGetBoolean((ALenum) pname); + + CHECK_AL_ERROR + return result; } /** @@ -104,7 +113,10 @@ * Alint alGetInteger(ALenum pname); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_CoreAL_getInteger (JNIEnv *env, jobject obj, jint pname) { - return (jint) alGetInteger((ALenum) pname); + jint result = (jint) alGetInteger((ALenum) pname); + + CHECK_AL_ERROR + return result; } /** @@ -114,7 +126,10 @@ * ALfloat alGetFloat(ALenum pname); */ JNIEXPORT jfloat JNICALL Java_org_lwjgl_openal_CoreAL_getFloat (JNIEnv *env, jobject obj, jint pname) { - return (jfloat) alGetFloat((ALenum) pname); + jfloat result = (jfloat) alGetFloat((ALenum) pname); + + CHECK_AL_ERROR + return result; } /** @@ -124,7 +139,10 @@ * Aldouble alGetDouble(ALenum pname); */ JNIEXPORT jdouble JNICALL Java_org_lwjgl_openal_CoreAL_getDouble (JNIEnv *env, jobject obj, jint pname) { - return (jdouble) alGetDouble((ALenum) pname); + jdouble result = (jdouble) alGetDouble((ALenum) pname); + + CHECK_AL_ERROR + return result; } /** @@ -135,6 +153,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getBooleanv (JNIEnv *env, jobject obj, jint pname, jint data) { alGetBooleanv((ALenum) pname, (ALboolean*) data); + CHECK_AL_ERROR } /** @@ -145,6 +164,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getIntegerv (JNIEnv *env, jobject obj, jint pname, jint data) { alGetIntegerv((ALenum) pname, (ALint*) data); + CHECK_AL_ERROR } /** @@ -155,6 +175,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getFloatv (JNIEnv *env, jobject obj, jint pname, jint data) { alGetFloatv((ALenum) pname, (ALfloat*) data); + CHECK_AL_ERROR } /** @@ -165,6 +186,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getDoublev (JNIEnv *env, jobject obj, jint pname, jint data) { alGetDoublev((ALenum) pname, (ALdouble*) data); + CHECK_AL_ERROR } /** @@ -174,7 +196,10 @@ * ALubyte * alGetString(ALenum pname); */ JNIEXPORT jstring JNICALL Java_org_lwjgl_openal_CoreAL_getString (JNIEnv *env, jobject obj, jint param) { - return env->NewStringUTF((const char*) alGetString((ALenum)param)); + jstring string = (jstring) env->NewStringUTF((const char*) alGetString((ALenum)param)); + + CHECK_AL_ERROR + return string; } /** @@ -184,7 +209,10 @@ * ALenum alGetError(ALvoid); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_CoreAL_getError (JNIEnv *env, jobject obj) { - return (jint) alGetError(); + jint result = (jint) alGetError(); + + CHECK_AL_ERROR + return result; } /** @@ -198,6 +226,7 @@ jboolean result = (jboolean) alIsExtensionPresent(functionname); env->ReleaseStringUTFChars((jstring)functionname, 0); + CHECK_AL_ERROR return result; } @@ -212,6 +241,7 @@ jint result = (jint) alGetProcAddress(functionname); env->ReleaseStringUTFChars((jstring)functionname, 0); + CHECK_AL_ERROR return result; } @@ -226,6 +256,7 @@ jint result = (jint) alGetEnumValue(functionname); env->ReleaseStringUTFChars((jstring)functionname, 0); + CHECK_AL_ERROR return result; } @@ -237,6 +268,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_listeneri (JNIEnv *env, jobject obj, jint pname, jint value) { alListeneri((ALenum) pname, (ALint) value); + CHECK_AL_ERROR } /** @@ -247,6 +279,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_listenerf (JNIEnv *env, jobject obj, jint pname, jfloat value) { alListenerf((ALenum) pname, (ALfloat) value); + CHECK_AL_ERROR } /** @@ -257,6 +290,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_listener3f (JNIEnv *env, jobject obj, jint pname, jfloat v1, jfloat v2, jfloat v3) { alListener3f((ALenum) pname, (ALfloat) v1, (ALfloat) v2, (ALfloat) v3); + CHECK_AL_ERROR } /** @@ -267,6 +301,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_listenerfv (JNIEnv *env, jobject obj, jint pname, jint values) { alListenerfv((ALenum) pname, (ALfloat*) values); + CHECK_AL_ERROR } /** @@ -277,6 +312,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getListeneri (JNIEnv *env, jobject obj, jint pname, jint value) { alGetListeneri((ALenum) pname, (ALint*) value); + CHECK_AL_ERROR } /** @@ -287,6 +323,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getListenerf (JNIEnv *env, jobject obj, jint pname, jint value) { alGetListenerf((ALenum) pname, (ALfloat*) value); + CHECK_AL_ERROR } /** @@ -297,6 +334,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getListener3f (JNIEnv *env, jobject obj, jint pname, jint v1, jint v2, jint v3) { alGetListener3f((ALenum) pname, (ALfloat*) v1, (ALfloat*) v2, (ALfloat*) v3); + CHECK_AL_ERROR } /** @@ -307,6 +345,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getListenerfv (JNIEnv *env, jobject obj, jint pname, jint values) { alGetListenerfv((ALenum) pname, (ALfloat*) values); + CHECK_AL_ERROR } /** @@ -319,6 +358,7 @@ int* array = (int*) env->GetIntArrayElements(sources, 0); alGenSources(n, (ALuint*) array); env->ReleaseIntArrayElements(sources, (jint*) array, 0); + CHECK_AL_ERROR } /** @@ -331,6 +371,7 @@ int* array = (int*) env->GetIntArrayElements(source, 0); alDeleteSources(n, (ALuint*) array); env->ReleaseIntArrayElements(source, (jint*) array, 0); + CHECK_AL_ERROR } /** @@ -340,7 +381,10 @@ * Alboolean alIsSource(ALuint source); */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_CoreAL_isSource (JNIEnv *env, jobject obj, jint source) { - return (jboolean) alIsSource((ALuint) source); + jboolean result = (jboolean) alIsSource((ALuint) source); + + CHECK_AL_ERROR + return result; } /** @@ -351,6 +395,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcei (JNIEnv *env, jobject obj, jint source, jint pname, jint value) { alSourcei((ALuint) source, (ALenum) pname, (ALint) value); + CHECK_AL_ERROR } /** @@ -361,6 +406,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcef (JNIEnv *env, jobject obj, jint source, jint pname, jfloat value) { alSourcef((ALuint) source, (ALenum) pname, (ALfloat) value); + CHECK_AL_ERROR } /** @@ -370,6 +416,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_source3f (JNIEnv *env, jobject obj, jint source, jint pname, jfloat v1, jfloat v2, jfloat v3) { alSource3f((ALuint) source, (ALenum) pname, (ALfloat) v1, (ALfloat) v2, (ALfloat) v3); + CHECK_AL_ERROR } /** @@ -380,6 +427,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcefv (JNIEnv *env, jobject obj, jint source, jint pname, jint values) { alSourcefv((ALuint) source, (ALenum) pname, (ALfloat*) values); + CHECK_AL_ERROR } /** @@ -389,6 +437,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getSourcei (JNIEnv *env, jobject obj, jint source, jint pname, jint value) { alGetSourcei((ALuint) source, (ALenum) pname, (ALint*) value); + CHECK_AL_ERROR } /** @@ -399,6 +448,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getSourcef (JNIEnv *env, jobject obj, jint source, jint pname, jint value) { alGetSourcef((ALuint) source, (ALenum) pname, (ALfloat*) value); + CHECK_AL_ERROR } /* @@ -409,6 +459,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getSource3f (JNIEnv *env, jobject obj, jint source, jint pname, jint v1, jint v2, jint v3) { alGetSource3f((ALuint) source, (ALenum) pname, (ALfloat*) v1, (ALfloat*) v2, (ALfloat*) v3); + CHECK_AL_ERROR } /** @@ -419,6 +470,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getSourcefv (JNIEnv *env, jobject obj, jint source, jint pname, jint values) { alGetSourcefv((ALuint) source, (ALenum) pname, (ALfloat*) values); + CHECK_AL_ERROR } /** @@ -431,6 +483,7 @@ int* array = (int*) env->GetIntArrayElements(sources, 0); alSourcePlayv(n, (ALuint*) array); env->ReleaseIntArrayElements(sources, (jint*) array, 0); + CHECK_AL_ERROR } /** @@ -443,6 +496,7 @@ int* array = (int*) env->GetIntArrayElements(sources, 0); alSourcePausev(n, (ALuint*) array); env->ReleaseIntArrayElements(sources, (jint*) array, 0); + CHECK_AL_ERROR } /** @@ -455,6 +509,7 @@ int* array = (int*) env->GetIntArrayElements(sources, 0); alSourceStopv(n, (ALuint*) array); env->ReleaseIntArrayElements(sources, (jint*) array, 0); + CHECK_AL_ERROR } /** @@ -467,6 +522,7 @@ int* array = (int*) env->GetIntArrayElements(sources, 0); alSourceRewindv(n, (ALuint*) array); env->ReleaseIntArrayElements(sources, (jint*) array, 0); + CHECK_AL_ERROR } /** @@ -477,6 +533,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcePlay (JNIEnv *env, jobject obj, jint source) { alSourcePlay((ALuint) source); + CHECK_AL_ERROR } /* @@ -487,6 +544,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcePause (JNIEnv *env, jobject obj, jint source) { alSourcePause((ALuint) source); + CHECK_AL_ERROR } /** @@ -497,6 +555,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceStop (JNIEnv *env, jobject obj, jint source) { alSourceStop((ALuint) source); + CHECK_AL_ERROR } /** @@ -507,6 +566,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceRewind (JNIEnv *env, jobject obj, jint source) { alSourceRewind((ALuint) source); + CHECK_AL_ERROR } /** @@ -519,6 +579,7 @@ int* array = (int*) env->GetIntArrayElements(buffers, 0); alGenBuffers(n, (ALuint*) array); env->ReleaseIntArrayElements(buffers, (jint*) array, 0); + CHECK_AL_ERROR } /** @@ -531,6 +592,7 @@ int* array = (int*) env->GetIntArrayElements(buffer, 0); alDeleteBuffers(n, (ALuint*) array); env->ReleaseIntArrayElements(buffer, (jint*) array, 0); + CHECK_AL_ERROR } /** @@ -540,7 +602,10 @@ * Alboolean alIsBuffer(ALuint buffer); */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_CoreAL_isBuffer (JNIEnv *env, jobject obj, jint buffer) { - return (jboolean) alIsBuffer((ALuint) buffer); + jboolean result = (jboolean) alIsBuffer((ALuint) buffer); + + CHECK_AL_ERROR + return result; } /** @@ -551,6 +616,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_bufferData (JNIEnv *env, jobject obj, jint buffer, jint format, jint data, jint size, jint freq) { alBufferData(buffer, format, (void**) data, size, freq); + CHECK_AL_ERROR } /** @@ -561,6 +627,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getBufferi (JNIEnv *env, jobject obj, jint buffer, jint pname, jint value) { alGetBufferi((ALuint) buffer, (ALenum) pname, (ALint*) value); + CHECK_AL_ERROR } /** @@ -571,6 +638,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getBufferf (JNIEnv *env, jobject obj, jint buffer, jint pname, jint value) { alGetBufferf((ALuint) buffer, (ALenum) pname, (ALfloat*) value); + CHECK_AL_ERROR } /** @@ -583,6 +651,7 @@ int* array = (int*) env->GetIntArrayElements(buffers, 0); alSourceQueueBuffers((ALuint) source, (ALsizei) n, (ALuint*) array); env->ReleaseIntArrayElements(buffers, (jint*) array, 0); + CHECK_AL_ERROR } /** @@ -595,6 +664,7 @@ int* array = (int*) env->GetIntArrayElements(buffers, 0); alSourceUnqueueBuffers((ALuint) source, (ALsizei) n, (ALuint*) array); env->ReleaseIntArrayElements(buffers, (jint*) array, 0); + CHECK_AL_ERROR } /** @@ -606,6 +676,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_distanceModel (JNIEnv *env, jobject obj, jint value) { alDistanceModel((ALenum) value); + CHECK_AL_ERROR } /** @@ -616,6 +687,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_dopplerFactor (JNIEnv *env, jobject obj, jfloat value) { alDopplerFactor((ALfloat) value); + CHECK_AL_ERROR } /** @@ -626,8 +698,5 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_dopplerVelocity (JNIEnv *env, jobject obj, jfloat value) { alDopplerVelocity((ALfloat) value); -} - - - - + CHECK_AL_ERROR +} \ No newline at end of file |
|
From: Brian M. <ma...@us...> - 2002-08-26 18:22:54
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory usw-pr-cvs1:/tmp/cvs-serv30229 Added Files: checkALerror.h Log Message: add: macro AL error checking --- NEW FILE: checkALerror.h --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/checkALerror.h /* checkGLerror.h Author: C. Prince Created: 8 November 2001 Error checking for OpenGL bindings */ #ifndef _CHECKGLERROR_H_INCLUDED_ #define _CHECKGLERROR_H_INCLUDED_ #ifdef _DEBUG #include <jni.h> #include <al.h> #define CHECK_AL_ERROR \ { \ int err = alGetError(); \ if (err != AL_NO_ERROR) { \ jclass cls = env->FindClass("org/lwjgl/openal/OpenALException"); \ env->ThrowNew(cls, (const char*) alGetString(err)); \ env->DeleteLocalRef(cls); \ } \ } /* only available if deviceaddress is specified in method */ #define CHECK_ALC_ERROR \ { \ int err = alcGetError((ALCdevice*) deviceaddress); \ if (err != AL_NO_ERROR) { \ jclass cls = env->FindClass("org/lwjgl/openal/OpenALException"); \ env->ThrowNew(cls, (const char*) alcGetString((ALCdevice*) deviceaddress, err)); \ env->DeleteLocalRef(cls); \ } \ } #else #define CHECK_GL_ERROR #endif /* _DEBUG */ #endif /* _CHECKGLERROR_H_INCLUDED_ */ |
|
From: Brian M. <ma...@us...> - 2002-08-26 18:14:25
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv27345 Modified Files: org_lwjgl_Display.cpp Log Message: fix: dx version defined, so that compile errors are removed 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.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_Display.cpp 24 Aug 2002 21:16:53 -0000 1.5 +++ org_lwjgl_Display.cpp 26 Aug 2002 18:14:22 -0000 1.6 @@ -42,7 +42,8 @@ #include <windows.h> #include "org_lwjgl_Display.h" -//#define DIRECTINPUT_VERSION 0x0700 +#undef DIRECTINPUT_VERSION +#define DIRECTINPUT_VERSION 0x0300 #include <dinput.h> |
|
From: Brian M. <ma...@us...> - 2002-08-26 18:12:25
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv26635 Modified Files: org_lwjgl_Math.cpp Log Message: rem: don't include math file, which isn't there Index: org_lwjgl_Math.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_Math.cpp 24 Aug 2002 21:16:53 -0000 1.3 +++ org_lwjgl_Math.cpp 26 Aug 2002 18:12:22 -0000 1.4 @@ -40,6 +40,6 @@ */ #include <windows.h> -#include "org_lwjgl_Math.h" +//#include "org_lwjgl_Math.h" #include "math.h" |
|
From: Caspian Rychlik-P. <ci...@us...> - 2002-08-26 15:53:39
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory usw-pr-cvs1:/tmp/cvs-serv3892/src/java/org/lwjgl/vector Modified Files: Matrix2f.java Matrix4f.java Matrix3f.java Matrix.java Log Message: Fixes Index: Matrix2f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix2f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix2f.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Matrix2f.java 26 Aug 2002 15:46:39 -0000 1.5 +++ Matrix2f.java 26 Aug 2002 15:53:36 -0000 1.6 @@ -332,7 +332,7 @@ * Set this matrix to be the identity matrix. * @return this */ - public Matrix identity() { + public Matrix setIdentity() { m00 = 1.0f; m01 = 0.0f; m10 = 0.0f; @@ -344,7 +344,7 @@ * Set this matrix to 0. * @return this */ - public Matrix zero() { + public Matrix setZero() { m00 = 0.0f; m01 = 0.0f; m10 = 0.0f; Index: Matrix4f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix4f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix4f.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Matrix4f.java 26 Aug 2002 15:46:39 -0000 1.6 +++ Matrix4f.java 26 Aug 2002 15:53:36 -0000 1.7 @@ -43,7 +43,7 @@ * Set this matrix to be the identity matrix. * @return this */ - public Matrix4f setIdentity() { + public Matrix setIdentity() { m00 = 1.0f; m01 = 0.0f; m02 = 0.0f; @@ -69,7 +69,7 @@ * Set this matrix to 0. * @return this */ - public Matrix4f setZero() { + public Matrix setZero() { m00 = 0.0f; m01 = 0.0f; m02 = 0.0f; @@ -134,7 +134,7 @@ * @param buf A float buffer to read from * @return this */ - public Matrix4f load(FloatBuffer buf) { + public Matrix load(FloatBuffer buf) { m00 = buf.get(); m10 = buf.get(); @@ -163,7 +163,7 @@ * @param buf A float buffer to read from * @return this */ - public Matrix4f loadTranspose(FloatBuffer buf) { + public Matrix loadTranspose(FloatBuffer buf) { m00 = buf.get(); m01 = buf.get(); @@ -190,7 +190,7 @@ * major (openGL) order. * @param buf The buffer to store this matrix in */ - public void store(FloatBuffer buf) { + public Matrix store(FloatBuffer buf) { buf.put(m00); buf.put(m10); buf.put(m20); @@ -207,6 +207,7 @@ buf.put(m13); buf.put(m23); buf.put(m33); + return this; } /** @@ -214,7 +215,7 @@ * major (maths) order. * @param buf The buffer to store this matrix in */ - public void storeTranspose(FloatBuffer buf) { + public Matrix storeTranspose(FloatBuffer buf) { buf.put(m00); buf.put(m01); buf.put(m02); @@ -231,6 +232,7 @@ buf.put(m31); buf.put(m32); buf.put(m33); + return this; } @@ -398,7 +400,7 @@ * Transpose this matrix * @return this */ - public Matrix4f transpose() { + public Matrix transpose() { float f = m10; m10 = m01; @@ -485,7 +487,7 @@ * Invert this matrix * @return this */ - public Matrix4f invert() { + public Matrix invert() { return this; } @@ -493,7 +495,7 @@ * Negate this matrix * @return this */ - public Matrix4f negate() { + public Matrix negate() { m00 = -m00; m01 = -m01; m02 = -m02; Index: Matrix3f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix3f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix3f.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Matrix3f.java 26 Aug 2002 15:46:39 -0000 1.6 +++ Matrix3f.java 26 Aug 2002 15:53:36 -0000 1.7 @@ -411,7 +411,7 @@ * Set this matrix to be the identity matrix. * @return this */ - public Matrix3f setIdentity() { + public Matrix setIdentity() { m00 = 1.0f; m01 = 0.0f; m02 = 0.0f; @@ -428,7 +428,7 @@ * Set this matrix to 0. * @return this */ - public Matrix3f setZero() { + public Matrix setZero() { m00 = 0.0f; m01 = 0.0f; m02 = 0.0f; Index: Matrix.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Matrix.java 26 Aug 2002 15:46:39 -0000 1.1 +++ Matrix.java 26 Aug 2002 15:53:36 -0000 1.2 @@ -54,7 +54,7 @@ * Set this matrix to be the identity matrix. * @return this */ - public abstract Matrix identity(); + public abstract Matrix setIdentity(); /** @@ -120,7 +120,7 @@ * Set this matrix to 0. * @return this */ - public abstract Matrix zero(); + public abstract Matrix setZero(); /** |
|
From: Caspian Rychlik-P. <ci...@us...> - 2002-08-26 15:46:46
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory usw-pr-cvs1:/tmp/cvs-serv1733/src/java/org/lwjgl/vector Modified Files: Matrix2f.java Vector3f.java Matrix4f.java Vector2f.java Vector4f.java Matrix3f.java Added Files: Vector.java Matrix.java Log Message: New base classes Vector and Matrix --- NEW FILE: Vector.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector.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.vector; import java.nio.FloatBuffer; import org.lwjgl.Math; /** * $Id$ * * Base class for vectors. * * @author cix_foo <ci...@us...> * @version $Revision$ */ public abstract class Vector { /** * Constructor for Vector. */ public Vector() { super(); } /** * @return the length of the vector */ public final float length() { return Math.sqrt(lengthSquared()); } /** * @return the length squared of the vector */ public abstract float lengthSquared(); /** * Load this vector from a FloatBuffer * @param buf The buffer to load it from, at the current position * @return this */ public abstract Vector load(FloatBuffer buf); /** * Negate a vector * @return this */ public abstract Vector negate(); /** * Normalise this vector * @return this */ public final Vector normalise() { float l = 1.0f / length(); return scale(l); } /** * Store this vector in a FloatBuffer * @param buf The buffer to store it in, at the current position * @return this */ public abstract Vector store(FloatBuffer buf); /** * Scale this vector * @param scale The scale factor * @return this */ public abstract Vector scale(float scale); } --- NEW FILE: Matrix.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix.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.vector; import java.nio.FloatBuffer; /** * $Id$ * * Base class for matrices. * * @author cix_foo <ci...@us...> * @version $Revision$ */ public abstract class Matrix { /** * Constructor for Matrix. */ public Matrix() { super(); } /** * Set this matrix to be the identity matrix. * @return this */ public abstract Matrix identity(); /** * Invert this matrix * @return this */ public abstract Matrix invert(); /** * Load from a float buffer. The buffer stores the matrix in column major * (OpenGL) order. * * @param buf A float buffer to read from * @return this */ public abstract Matrix load(FloatBuffer buf); /** * Load from a float buffer. The buffer stores the matrix in row major * (mathematical) order. * * @param buf A float buffer to read from * @return this */ public abstract Matrix loadTranspose(FloatBuffer buf); /** * Negate this matrix * @return this */ public abstract Matrix negate(); /** * Store this matrix in a float buffer. The matrix is stored in column * major (openGL) order. * @param buf The buffer to store this matrix in * @return this */ public abstract Matrix store(FloatBuffer buf); /** * Store this matrix in a float buffer. The matrix is stored in row * major (maths) order. * @param buf The buffer to store this matrix in * @return this */ public abstract Matrix storeTranspose(FloatBuffer buf); /** * Transpose this matrix * @return this */ public abstract Matrix transpose(); /** * Set this matrix to 0. * @return this */ public abstract Matrix zero(); /** * @return the determinant of the matrix */ public abstract float determinant(); } Index: Matrix2f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix2f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix2f.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Matrix2f.java 24 Aug 2002 21:26:47 -0000 1.4 +++ Matrix2f.java 26 Aug 2002 15:46:39 -0000 1.5 @@ -42,7 +42,7 @@ * @version $Revision$ */ -public class Matrix2f { +public class Matrix2f extends Matrix { public float m00 = 1.0f, m01, m10, m11 = 1.0f; @@ -81,7 +81,7 @@ * @param buf A float buffer to read from * @return this */ - public Matrix2f load(FloatBuffer buf) { + public Matrix load(FloatBuffer buf) { m00 = buf.get(); m10 = buf.get(); @@ -92,17 +92,48 @@ } /** + * Load from a float buffer. The buffer stores the matrix in row major + * (mathematical) order. + * + * @param buf A float buffer to read from + * @return this + */ + public Matrix loadTranspose(FloatBuffer buf) { + + m00 = buf.get(); + m01 = buf.get(); + m10 = buf.get(); + m11 = buf.get(); + + return this; + } + + /** * Store this matrix in a float buffer. The matrix is stored in column * major (openGL) order. * @param buf The buffer to store this matrix in */ - public void store(FloatBuffer buf) { + public Matrix store(FloatBuffer buf) { buf.put(m00); buf.put(m10); buf.put(m01); buf.put(m11); + return this; } + /** + * Store this matrix in a float buffer. The matrix is stored in row + * major (maths) order. + * @param buf The buffer to store this matrix in + */ + public Matrix storeTranspose(FloatBuffer buf) { + buf.put(m00); + buf.put(m01); + buf.put(m10); + buf.put(m11); + return this; + } + /** @@ -228,7 +259,7 @@ * Transpose this matrix * @return this */ - public Matrix2f transpose() { + public Matrix transpose() { float temp; temp = m01; @@ -261,7 +292,7 @@ * Invert this matrix * @return this */ - public Matrix2f invert() { + public Matrix invert() { return this; } @@ -269,7 +300,7 @@ * Negate this matrix * @return this */ - public Matrix2f negate() { + public Matrix negate() { m00 = -m00; m01 = -m01; @@ -301,7 +332,7 @@ * Set this matrix to be the identity matrix. * @return this */ - public Matrix2f identity() { + public Matrix identity() { m00 = 1.0f; m01 = 0.0f; m10 = 0.0f; @@ -313,7 +344,7 @@ * Set this matrix to 0. * @return this */ - public Matrix2f zero() { + public Matrix zero() { m00 = 0.0f; m01 = 0.0f; m10 = 0.0f; @@ -321,4 +352,11 @@ return this; } + /* (non-Javadoc) + * @see org.lwjgl.vector.Matrix#determinant() + */ + public float determinant() { + return 0; + } + } Index: Vector3f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector3f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector3f.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Vector3f.java 24 Aug 2002 21:12:31 -0000 1.3 +++ Vector3f.java 26 Aug 2002 15:46:39 -0000 1.4 @@ -31,6 +31,8 @@ */ package org.lwjgl.vector; +import java.nio.FloatBuffer; + import org.lwjgl.Math; /** @@ -42,7 +44,7 @@ * @version $Revision$ */ -public class Vector3f { +public class Vector3f extends Vector { public float x, y, z; @@ -91,13 +93,6 @@ } /** - * @return the length of the vector - */ - public float length() { - return Math.sqrt(lengthSquared()); - } - - /** * @return the length squared of the vector */ public float lengthSquared() { @@ -117,11 +112,45 @@ return this; } + /** + * Add a vector to another vector and place the result in a destination + * vector. + * @param left The LHS vector + * @param right The RHS vector + * @param dest The destination vector, or null if a new vector is to be created + * @return the sum of left and right in dest + */ + public static Vector3f add(Vector3f left, Vector3f right, Vector3f dest) { + if (dest == null) + return new Vector3f(left.x + right.x, left.y + right.y, left.z + right.z); + else { + return dest.set(left.x + right.x, left.y + right.y, left.z + right.z); + } + } + + /** + * Subtract a vector from another vector and place the result in a destination + * vector. + * @param left The LHS vector + * @param right The RHS vector + * @param dest The destination vector, or null if a new vector is to be created + * @return left minus right in dest + */ + public static Vector3f sub(Vector3f left, Vector3f right, Vector3f dest) { + if (dest == null) + return new Vector3f(left.x - right.x, left.y - right.y, left.z - right.z); + else { + return dest.set(left.x - right.x, left.y - right.y, left.z - right.z); + } + } + + + /** * Negate a vector * @return this */ - public Vector3f negate() { + public Vector negate() { x = -x; y = -y; z = -z; @@ -129,17 +158,20 @@ } /** - * Normalise this vector - * @return this + * Negate a vector and place the result in a destination vector. + * @param dest The destination vector or null if a new vector is to be created + * @return the negated vector */ - public Vector3f normalise() { - float l = 1.0f / length(); - x *= l; - y *= l; - z *= l; - return this; + public Vector3f negate(Vector3f dest) { + if (dest == null) + dest = new Vector3f(); + dest.x = -x; + dest.y = -y; + dest.z = -z; + return dest; } + /** * Normalise this vector and place the result in another vector. * @param dest The destination vector, or null if a new vector is to be created @@ -182,4 +214,36 @@ return Math.acos(dls); } + /* (non-Javadoc) + * @see org.lwjgl.vector.Vector#load(FloatBuffer) + */ + public Vector load(FloatBuffer buf) { + return null; + } + + /* (non-Javadoc) + * @see org.lwjgl.vector.Vector#scale(float) + */ + public Vector scale(float scale) { + + x *= scale; + y *= scale; + z *= scale; + + return this; + + } + + /* (non-Javadoc) + * @see org.lwjgl.vector.Vector#store(FloatBuffer) + */ + public Vector store(FloatBuffer buf) { + + buf.put(x); + buf.put(y); + buf.put(z); + + return this; + } + } Index: Matrix4f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix4f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix4f.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Matrix4f.java 24 Aug 2002 21:35:20 -0000 1.5 +++ Matrix4f.java 26 Aug 2002 15:46:39 -0000 1.6 @@ -38,7 +38,7 @@ * * @author foo */ -public class Matrix4f { +public class Matrix4f extends Matrix { /** * Set this matrix to be the identity matrix. * @return this @@ -157,6 +157,35 @@ } /** + * Load from a float buffer. The buffer stores the matrix in row major + * (maths) order. + * + * @param buf A float buffer to read from + * @return this + */ + public Matrix4f loadTranspose(FloatBuffer buf) { + + m00 = buf.get(); + m01 = buf.get(); + m02 = buf.get(); + m03 = buf.get(); + m10 = buf.get(); + m11 = buf.get(); + m12 = buf.get(); + m13 = buf.get(); + m20 = buf.get(); + m21 = buf.get(); + m22 = buf.get(); + m23 = buf.get(); + m30 = buf.get(); + m31 = buf.get(); + m32 = buf.get(); + m33 = buf.get(); + + return this; + } + + /** * Store this matrix in a float buffer. The matrix is stored in column * major (openGL) order. * @param buf The buffer to store this matrix in @@ -179,6 +208,30 @@ buf.put(m23); buf.put(m33); } + + /** + * Store this matrix in a float buffer. The matrix is stored in row + * major (maths) order. + * @param buf The buffer to store this matrix in + */ + public void storeTranspose(FloatBuffer buf) { + buf.put(m00); + buf.put(m01); + buf.put(m02); + buf.put(m03); + buf.put(m10); + buf.put(m11); + buf.put(m12); + buf.put(m13); + buf.put(m20); + buf.put(m21); + buf.put(m22); + buf.put(m23); + buf.put(m30); + buf.put(m31); + buf.put(m32); + buf.put(m33); + } /** Index: Vector2f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector2f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector2f.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Vector2f.java 24 Aug 2002 21:12:31 -0000 1.3 +++ Vector2f.java 26 Aug 2002 15:46:39 -0000 1.4 @@ -31,6 +31,8 @@ */ package org.lwjgl.vector; +import java.nio.FloatBuffer; + import org.lwjgl.Math; /** @@ -42,7 +44,7 @@ * @version $Revision$ */ -public class Vector2f { +public class Vector2f extends Vector { public float x, y; @@ -89,13 +91,6 @@ } /** - * @return the length of the vector - */ - public float length() { - return Math.sqrt(lengthSquared()); - } - - /** * @return the length squared of the vector */ public float lengthSquared() { @@ -118,23 +113,26 @@ * Negate a vector * @return this */ - public Vector2f negate() { + public Vector negate() { x = -x; y = -y; return this; } /** - * Normalise this vector - * @return this + * Negate a vector and place the result in a destination vector. + * @param dest The destination vector or null if a new vector is to be created + * @return the negated vector */ - public Vector2f normalise() { - float l = 1.0f / length(); - x *= l; - y *= l; - return this; + public Vector2f negate(Vector2f dest) { + if (dest == null) + dest = new Vector2f(); + dest.x = -x; + dest.y = -y; + return dest; } + /** * Normalise this vector and place the result in another vector. * @param dest The destination vector, or null if a new vector is to be created @@ -176,5 +174,70 @@ dls = 1.0f; return Math.acos(dls); } + + /** + * Add a vector to another vector and place the result in a destination + * vector. + * @param left The LHS vector + * @param right The RHS vector + * @param dest The destination vector, or null if a new vector is to be created + * @return the sum of left and right in dest + */ + public static Vector2f add(Vector2f left, Vector2f right, Vector2f dest) { + if (dest == null) + return new Vector2f(left.x + right.x, left.y + right.y); + else { + return dest.set(left.x + right.x, left.y + right.y); + } + } + + /** + * Subtract a vector from another vector and place the result in a destination + * vector. + * @param left The LHS vector + * @param right The RHS vector + * @param dest The destination vector, or null if a new vector is to be created + * @return left minus right in dest + */ + public static Vector2f sub(Vector2f left, Vector2f right, Vector2f dest) { + if (dest == null) + return new Vector2f(left.x - right.x, left.y - right.y); + else { + return dest.set(left.x - right.x, left.y - right.y); + } + } + + /** + * Store this vector in a FloatBuffer + * @param buf The buffer to store it in, at the current position + * @return this + */ + public Vector store(FloatBuffer buf) { + buf.put(x); + buf.put(y); + return this; + } + + /** + * Load this vector from a FloatBuffer + * @param buf The buffer to load it from, at the current position + * @return this + */ + public Vector load(FloatBuffer buf) { + x = buf.get(); + y = buf.get(); + return this; + } + /* (non-Javadoc) + * @see org.lwjgl.vector.Vector#scale(float) + */ + public Vector scale(float scale) { + + x *= scale; + y *= scale; + + return this; + } + } Index: Vector4f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector4f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector4f.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Vector4f.java 24 Aug 2002 21:12:31 -0000 1.3 +++ Vector4f.java 26 Aug 2002 15:46:39 -0000 1.4 @@ -31,6 +31,8 @@ */ package org.lwjgl.vector; +import java.nio.FloatBuffer; + import org.lwjgl.Math; /** @@ -42,7 +44,7 @@ * @version $Revision$ */ -public class Vector4f { +public class Vector4f extends Vector { public float x, y, z, w; @@ -93,13 +95,6 @@ } /** - * @return the length of the vector - */ - public float length() { - return Math.sqrt(lengthSquared()); - } - - /** * @return the length squared of the vector */ public float lengthSquared() { @@ -120,11 +115,44 @@ return this; } + /** + * Add a vector to another vector and place the result in a destination + * vector. + * @param left The LHS vector + * @param right The RHS vector + * @param dest The destination vector, or null if a new vector is to be created + * @return the sum of left and right in dest + */ + public static Vector4f add(Vector4f left, Vector4f right, Vector4f dest) { + if (dest == null) + return new Vector4f(left.x + right.x, left.y + right.y, left.z + right.z, left.w + right.w); + else { + return dest.set(left.x + right.x, left.y + right.y, left.z + right.z, left.w + right.w); + } + } + + /** + * Subtract a vector from another vector and place the result in a destination + * vector. + * @param left The LHS vector + * @param right The RHS vector + * @param dest The destination vector, or null if a new vector is to be created + * @return left minus right in dest + */ + public static Vector4f sub(Vector4f left, Vector4f right, Vector4f dest) { + if (dest == null) + return new Vector4f(left.x - right.x, left.y - right.y, left.z - right.z, left.w - right.w); + else { + return dest.set(left.x - right.x, left.y - right.y, left.z - right.z, left.w - right.w); + } + } + + /** * Negate a vector * @return this */ - public Vector4f negate() { + public Vector negate() { x = -x; y = -y; z = -z; @@ -133,18 +161,21 @@ } /** - * Normalise this vector - * @return this + * Negate a vector and place the result in a destination vector. + * @param dest The destination vector or null if a new vector is to be created + * @return the negated vector */ - public Vector4f normalise() { - float l = 1.0f / length(); - x *= l; - y *= l; - z *= l; - w *= l; - return this; + public Vector4f negate(Vector4f dest) { + if (dest == null) + dest = new Vector4f(); + dest.x = -x; + dest.y = -y; + dest.z = -z; + dest.w = -w; + return dest; } + /** * Normalise this vector and place the result in another vector. * @param dest The destination vector, or null if a new vector is to be created @@ -187,4 +218,35 @@ return Math.acos(dls); } + /* (non-Javadoc) + * @see org.lwjgl.vector.Vector#load(FloatBuffer) + */ + public Vector load(FloatBuffer buf) { + return null; + } + + /* (non-Javadoc) + * @see org.lwjgl.vector.Vector#scale(float) + */ + public Vector scale(float scale) { + x *= scale; + y *= scale; + z *= scale; + w *= scale; + return this; + } + + /* (non-Javadoc) + * @see org.lwjgl.vector.Vector#store(FloatBuffer) + */ + public Vector store(FloatBuffer buf) { + + buf.put(x); + buf.put(y); + buf.put(z); + buf.put(w); + + return this; + } + } Index: Matrix3f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix3f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix3f.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Matrix3f.java 24 Aug 2002 21:35:20 -0000 1.5 +++ Matrix3f.java 26 Aug 2002 15:46:39 -0000 1.6 @@ -42,7 +42,7 @@ * @version $Revision$ */ -public class Matrix3f { +public class Matrix3f extends Matrix { public float m00 = 1.0f, m01, @@ -87,7 +87,7 @@ * @param buf A float buffer to read from * @return this */ - public Matrix3f load(FloatBuffer buf) { + public Matrix load(FloatBuffer buf) { m00 = buf.get(); m10 = buf.get(); @@ -103,11 +103,33 @@ } /** + * Load from a float buffer. The buffer stores the matrix in row major + * (maths) order. + * + * @param buf A float buffer to read from + * @return this + */ + public Matrix loadTranspose(FloatBuffer buf) { + + m00 = buf.get(); + m01 = buf.get(); + m02 = buf.get(); + m10 = buf.get(); + m11 = buf.get(); + m12 = buf.get(); + m20 = buf.get(); + m21 = buf.get(); + m22 = buf.get(); + + return this; + } + + /** * Store this matrix in a float buffer. The matrix is stored in column * major (openGL) order. * @param buf The buffer to store this matrix in */ - public void store(FloatBuffer buf) { + public Matrix store(FloatBuffer buf) { buf.put(m00); buf.put(m10); buf.put(m20); @@ -117,8 +139,27 @@ buf.put(m02); buf.put(m12); buf.put(m22); + return this; } + /** + * Store this matrix in a float buffer. The matrix is stored in row + * major (maths) order. + * @param buf The buffer to store this matrix in + */ + public Matrix storeTranspose(FloatBuffer buf) { + buf.put(m00); + buf.put(m01); + buf.put(m02); + buf.put(m10); + buf.put(m11); + buf.put(m12); + buf.put(m20); + buf.put(m21); + buf.put(m22); + return this; + } + /** @@ -269,7 +310,7 @@ * Transpose this matrix * @return this */ - public Matrix3f transpose() { + public Matrix transpose() { float f = m10; m10 = m01; m01 = f; @@ -324,7 +365,7 @@ * Invert this matrix * @return this */ - public Matrix3f invert() { + public Matrix invert() { return this; } @@ -332,7 +373,7 @@ * Negate this matrix * @return this */ - public Matrix3f negate() { + public Matrix negate() { m00 = -m00; m01 = -m02; m02 = -m01; |
|
From: Brian M. <ma...@us...> - 2002-08-26 15:30:24
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory usw-pr-cvs1:/tmp/cvs-serv27706/org/lwjgl/openal Modified Files: ALC.java Log Message: rem: removed debug fix: cleanup Index: ALC.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALC.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALC.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ALC.java 26 Aug 2002 15:28:01 -0000 1.2 +++ ALC.java 26 Aug 2002 15:30:19 -0000 1.3 @@ -94,7 +94,6 @@ static { try { - System.out.println("using " + org.lwjgl.Sys.getLibraryName()); System.loadLibrary(org.lwjgl.Sys.getLibraryName()); } catch (UnsatisfiedLinkError ule) { System.out.println("Failed to load OpenAL library: " + org.lwjgl.Sys.getLibraryName()); @@ -105,6 +104,7 @@ /** Creates a new instance of ALC */ public ALC() { } + /** * Returns strings related to the context. * |
|
From: Brian M. <ma...@us...> - 2002-08-26 15:28:08
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory usw-pr-cvs1:/tmp/cvs-serv26742/org/lwjgl/openal Modified Files: ALC.java Log Message: add: ALC constants added Index: ALC.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALC.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALC.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ALC.java 20 Aug 2002 14:44:35 -0000 1.1 +++ ALC.java 26 Aug 2002 15:28:01 -0000 1.2 @@ -1,35 +1,35 @@ -/* +/* * 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 + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * 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 + * * 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 + * 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 + * 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.openal; +package org.lwjgl.openal; /** * $Id$ @@ -42,8 +42,59 @@ */ public class ALC { + /** Bad value */ + public static final int INVALID = -1; + + /** Boolean False */ + public static final int FALSE = 0; + + /** Boolean True */ + public static final int TRUE = 1; + + /** Errors: No Error */ + public static final int NO_ERROR = FALSE; + + public static final int MAJOR_VERSION = 0x1000; + public static final int MINOR_VERSION = 0x1001; + public static final int ATTRIBUTES_SIZE = 0x1002; + public static final int ALL_ATTRIBUTES = 0x1003; + + public static final int DEFAULT_DEVICE_SPECIFIER = 0x1004; + public static final int DEVICE_SPECIFIER = 0x1005; + public static final int EXTENSIONS = 0x1006; + + public static final int FREQUENCY = 0x1007; + public static final int REFRESH = 0x1008; + public static final int SYNC = 0x1009; + + /** The device argument does not name a valid device */ + public static final int INVALID_DEVICE = 0xA001; + + /** The context argument does not name a valid context */ + public static final int INVALID_CONTEXT = 0xA002; + + /** + * A function was called at inappropriate time, or in an inappropriate way, + * causing an illegal state. This can be an incompatible ALenum, object ID, + * and/or function. + */ + public static final int INVALID_ENUM = 0xA003; + + /** + * Illegal value passed as an argument to an AL call. + * Applies to parameter values, but not to enumerations. + */ + public static final int INVALID_VALUE = 0xA004; + + /** + * A function could not be completed, because there is not enough + * memory available. + */ + public static final int OUT_OF_MEMORY = 0xA005; + static { try { + System.out.println("using " + org.lwjgl.Sys.getLibraryName()); System.loadLibrary(org.lwjgl.Sys.getLibraryName()); } catch (UnsatisfiedLinkError ule) { System.out.println("Failed to load OpenAL library: " + org.lwjgl.Sys.getLibraryName()); @@ -62,7 +113,7 @@ * @return String property from device */ public native String getString(ALCdevice device, int pname); - + /** * Returns integers related to the context. * @@ -74,7 +125,7 @@ public native void getIntegerv(ALCdevice device, int pname, int size, int integerdata); /** - * Opens the named device. If null is specied, the implementation will + * Opens the named device. If null is specied, the implementation will * provide an implementation specic default. * * @param devicename name of device to open @@ -103,9 +154,9 @@ * * @param context ALCcontext to make current * @return true if successfull, false if not - */ + */ public native boolean makeContextCurrent(ALCcontext context); - + /** * Tells a context to begin processing. * @@ -119,7 +170,7 @@ * @return Current ALCcontext */ public native ALCcontext getCurrentContext(); - + /** * Retrives the device associated with the supplied context * @@ -127,7 +178,7 @@ * @param ALCdevice associated with context */ public native ALCdevice getContextsDevice(ALCcontext context); - + /** * Suspends processing on supplied context * @@ -141,7 +192,7 @@ * @param context ALCcontext to Destroy */ public native void destroyContext(ALCcontext context); - + /** * Retrieves the current context error state. * @@ -170,10 +221,10 @@ /** * retrieves the enum value for a specified enumeration name. - * + * * @param device Device to query * @param enumName name of enum to find * @return value of enumeration */ - public native int getEnumValue(ALCdevice device, String enumName); + public native int getEnumValue(ALCdevice device, String enumName); } |
|
From: Brian M. <ma...@us...> - 2002-08-26 15:07:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv18691 Modified Files: org_lwjgl_openal_ALC.cpp Log Message: fix: wrong header file being included (DOH!) fix: using wrong object to retrieve field values from Index: org_lwjgl_openal_ALC.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALC.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALC.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_openal_ALC.cpp 25 Aug 2002 11:02:21 -0000 1.2 +++ org_lwjgl_openal_ALC.cpp 26 Aug 2002 15:07:31 -0000 1.3 @@ -38,7 +38,7 @@ * @author Brian Matzon <br...@ma...> * @version $Revision$ */ -#include "org_lwjgl_openal_ALUT.h" +#include "org_lwjgl_openal_ALC.h" /* OpenAL includes */ #include <alc.h> @@ -116,7 +116,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_closeDevice (JNIEnv *env, jobject obj, jobject device) { jclass device_class = env->GetObjectClass(device); jfieldID device_field = env->GetFieldID(device_class, "device", "I"); - jint deviceaddress = env->GetIntField(obj, device_field); + jint deviceaddress = env->GetIntField(device, device_field); alcCloseDevice((ALCdevice*) deviceaddress); } @@ -131,9 +131,10 @@ /* get device address */ jclass device_class = env->GetObjectClass(device); jfieldID device_field = env->GetFieldID(device_class, "device", "I"); - jint deviceaddress = env->GetIntField(obj, device_field); + jint deviceaddress = env->GetIntField(device, device_field); ALCcontext* context = alcCreateContext((ALCdevice*) deviceaddress, (ALint*) attrlist); + /* if error - get out */ if(context == NULL) { return NULL; @@ -164,7 +165,7 @@ /* get context address */ jclass context_class = env->GetObjectClass(context); jfieldID context_field = env->GetFieldID(context_class, "context", "I"); - jint contextaddress = env->GetIntField(obj, context_field); + jint contextaddress = env->GetIntField(context, context_field); return alcMakeContextCurrent((ALCcontext*) contextaddress); } @@ -179,7 +180,7 @@ /* get context address */ jclass context_class = env->GetObjectClass(context); jfieldID context_field = env->GetFieldID(context_class, "context", "I"); - jint contextaddress = env->GetIntField(obj, context_field); + jint contextaddress = env->GetIntField(context, context_field); alcProcessContext((ALCcontext*) contextaddress); } @@ -223,7 +224,7 @@ /* get context address */ jclass context_class = env->GetObjectClass(context); jfieldID context_field = env->GetFieldID(context_class, "context", "I"); - jint contextaddress = env->GetIntField(obj, context_field); + jint contextaddress = env->GetIntField(context, context_field); ALCdevice* device = alcGetContextsDevice((ALCcontext*) contextaddress); if(device == NULL) { @@ -255,7 +256,7 @@ /* get context address */ jclass context_class = env->GetObjectClass(context); jfieldID context_field = env->GetFieldID(context_class, "context", "I"); - jint contextaddress = env->GetIntField(obj, context_field); + jint contextaddress = env->GetIntField(context, context_field); alcSuspendContext((ALCcontext*) contextaddress); } @@ -270,7 +271,7 @@ /* get context address */ jclass context_class = env->GetObjectClass(context); jfieldID context_field = env->GetFieldID(context_class, "context", "I"); - jint contextaddress = env->GetIntField(obj, context_field); + jint contextaddress = env->GetIntField(context, context_field); alcDestroyContext((ALCcontext*) contextaddress); } @@ -285,7 +286,7 @@ /* get device address */ jclass device_class = env->GetObjectClass(device); jfieldID device_field = env->GetFieldID(device_class, "device", "I"); - jint deviceaddress = env->GetIntField(obj, device_field); + jint deviceaddress = env->GetIntField(device, device_field); return (jint) alcGetError((ALCdevice*) deviceaddress); } @@ -300,7 +301,7 @@ /* get device address */ jclass device_class = env->GetObjectClass(device); jfieldID device_field = env->GetFieldID(device_class, "device", "I"); - jint deviceaddress = env->GetIntField(obj, device_field); + jint deviceaddress = env->GetIntField(device, device_field); /* get extension */ ALubyte* functionname = (ALubyte*) (env->GetStringUTFChars(extName, 0)); @@ -322,7 +323,7 @@ /* get device address */ jclass device_class = env->GetObjectClass(device); jfieldID device_field = env->GetFieldID(device_class, "device", "I"); - jint deviceaddress = env->GetIntField(obj, device_field); + jint deviceaddress = env->GetIntField(device, device_field); /* get extension */ ALubyte* functionname = (ALubyte*) (env->GetStringUTFChars(funcName, 0)); @@ -344,7 +345,7 @@ /* get device address */ jclass device_class = env->GetObjectClass(device); jfieldID device_field = env->GetFieldID(device_class, "device", "I"); - jint deviceaddress = env->GetIntField(obj, device_field); + jint deviceaddress = env->GetIntField(device, device_field); /* get extension */ ALubyte* enumerationname = (ALubyte*) (env->GetStringUTFChars(enumName, 0)); |