From: Brian M. <ma...@us...> - 2002-12-14 12:38:43
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1:/tmp/cvs-serv11791 Modified Files: ALUT.java Log Message: no message Index: ALUT.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALUT.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALUT.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ALUT.java 3 Sep 2002 18:54:40 -0000 1.7 +++ ALUT.java 14 Dec 2002 12:38:39 -0000 1.8 @@ -29,7 +29,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - package org.lwjgl.openal; +package org.lwjgl.openal; /** * $Id$ @@ -41,106 +41,106 @@ * @version $Revision$ */ public class ALUT { - + /** Has the ALUT object been created? */ - protected static boolean created; - + protected static boolean created; + static { initialize(); } - - /** Creates a new instance of ALUT */ - public ALUT() { - } - - /** - * Override to provide any initialization code after creation. - */ + + /** Creates a new instance of ALUT */ + public ALUT() { + } + + /** + * Override to provide any initialization code after creation. + */ protected void init() { } - + /** * Static initialization */ private static void initialize() { System.loadLibrary(org.lwjgl.Sys.getLibraryName()); } - - /** - * Creates the ALUT instance - * - * @throws Exception if a failiure occured in the ALUT creation process - */ + + /** + * Creates the ALUT instance + * + * @throws Exception if a failiure occured in the ALUT creation process + */ public void create() throws Exception { if (created) { return; - } - + } + if (!nCreate()) { throw new Exception("ALUT instance could not be created."); - } + } created = true; - init(); + init(); } - + /** * Native method to create ALUT instance * * @return true if the ALUT creation process succeeded */ protected native boolean nCreate(); - + /** * Calls whatever destruction rutines that are needed */ public void destroy() { if (!created) { return; - } - created = false; - nDestroy(); + } + created = false; + nDestroy(); } - + /** * Native method the destroy the ALUT */ - protected native void nDestroy(); - - /** - * Initializes the OpenAL engine - * - * @param args String array of arguments to engine - */ - public native void init(String[] args); - - /** - * Loads a wave file into memory - * - * @param file name of file to load (in current working directory) - * @return ALUTLoadWAVData object containing information regarding wave data loaded - */ - public native ALUTLoadWAVData loadWAVFile(String file); - - /** - * Loads a byte buffer into memory - * - * @param buffer buffer address containing file - * @return ALUTLoadWAVData object containing information regarding wave data loaded - */ - public native ALUTLoadWAVData loadWAVMemory(int buffer); - - /** - * Unloads the specified file from memory - * - * @param format OpenAL format specifier - * @param data address of data (pointer) - * @param size size of the data in bytes - * @param freq frequency of the data - */ - public native void unloadWAV(int format, int data, int size, int freq); - - /** - * Deinitializes the OpenAL engine - */ - public native void exit(); + protected native void nDestroy(); + + /** + * Initializes the OpenAL engine + * + * @param args String array of arguments to engine + */ + public native void init(String[] args); + + /** + * Loads a wave file into memory + * + * @param file name of file to load (in current working directory) + * @return ALUTLoadWAVData object containing information regarding wave data loaded + */ + public native ALUTLoadWAVData loadWAVFile(String file); + + /** + * Loads a byte buffer into memory + * + * @param buffer buffer address containing file + * @return ALUTLoadWAVData object containing information regarding wave data loaded + */ + public native ALUTLoadWAVData loadWAVMemory(int buffer); + + /** + * Unloads the specified file from memory + * + * @param format OpenAL format specifier + * @param data address of data (pointer) + * @param size size of the data in bytes + * @param freq frequency of the data + */ + public native void unloadWAV(int format, int data, int size, int freq); + + /** + * Deinitializes the OpenAL engine + */ + public native void exit(); } |