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
(1) |
3
(3) |
4
(2) |
5
(18) |
6
|
7
|
8
|
|
9
|
10
(3) |
11
(1) |
12
|
13
|
14
(5) |
15
|
|
16
|
17
|
18
(4) |
19
(1) |
20
|
21
|
22
|
|
23
(31) |
24
|
25
(1) |
26
(2) |
27
|
28
|
29
|
|
30
|
31
(5) |
|
|
|
|
|
|
From: Brian M. <ma...@us...> - 2004-05-23 14:05:06
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/fmod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25435 Removed Files: org_lwjgl_fmod_FMOD.h org_lwjgl_fmod_FMusic.h org_lwjgl_fmod_FSound.h Log Message: nuke autogenerated headers --- org_lwjgl_fmod_FMusic.h DELETED --- --- org_lwjgl_fmod_FMOD.h DELETED --- --- org_lwjgl_fmod_FSound.h DELETED --- |
|
From: Brian M. <ma...@us...> - 2004-05-23 14:03:19
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/fmod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25022/native/common/fmod Added Files: extfmod.cpp extfmod.h org_lwjgl_fmod_FMOD.cpp org_lwjgl_fmod_FMOD.h org_lwjgl_fmod_FMusic.cpp org_lwjgl_fmod_FMusic.h org_lwjgl_fmod_FSound.cpp org_lwjgl_fmod_FSound.h Log Message: fmod support --- NEW FILE: extfmod.cpp --- /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <stdio.h> #include "extfmod.h" /** Instance of fmod */ FMOD_INSTANCE * fmod = NULL; /** Handle to dll */ HINSTANCE dll_handle; /** * DLL entry point for Windows. Called when Java loads the .dll */ BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { dll_handle = hinstDLL; return true; } /** * Creates and loads the FMOD instance * * @param path path to try to load dll */ void fmod_create(char* path) { fmod = FMOD_CreateInstance(path); } /** * Destroys the fmod instance */ void fmod_destroy() { if (fmod != NULL) { FMOD_FreeInstance(fmod); } } --- NEW FILE: org_lwjgl_fmod_FMOD.h --- /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class org_lwjgl_fmod_FMOD */ #ifndef _Included_org_lwjgl_fmod_FMOD #define _Included_org_lwjgl_fmod_FMOD #ifdef __cplusplus extern "C" { #endif /* Inaccessible static: callbacks */ /* Inaccessible static: fmodClearUnit */ /* Inaccessible static: fmodClipAndCopyUnit */ /* Inaccessible static: fmodMusicUnit */ /* Inaccessible static: fmodSFXUnit */ /* Inaccessible static: fmodFFTUnit */ /* Inaccessible static: fmodFFTBuffer */ #undef org_lwjgl_fmod_FMOD_FMUSIC_CALLBACK #define org_lwjgl_fmod_FMOD_FMUSIC_CALLBACK 0L #undef org_lwjgl_fmod_FMOD_FSOUND_DSPCALLBACK #define org_lwjgl_fmod_FMOD_FSOUND_DSPCALLBACK 1L #undef org_lwjgl_fmod_FMOD_FSOUND_STREAMCALLBACK #define org_lwjgl_fmod_FMOD_FSOUND_STREAMCALLBACK 2L #undef org_lwjgl_fmod_FMOD_FSOUND_ALLOCCALLBACK #define org_lwjgl_fmod_FMOD_FSOUND_ALLOCCALLBACK 3L #undef org_lwjgl_fmod_FMOD_FSOUND_REALLOCCALLBACK #define org_lwjgl_fmod_FMOD_FSOUND_REALLOCCALLBACK 4L #undef org_lwjgl_fmod_FMOD_FSOUND_FREECALLBACK #define org_lwjgl_fmod_FMOD_FSOUND_FREECALLBACK 5L #undef org_lwjgl_fmod_FMOD_FSOUND_OPENCALLBACK #define org_lwjgl_fmod_FMOD_FSOUND_OPENCALLBACK 6L #undef org_lwjgl_fmod_FMOD_FSOUND_CLOSECALLBACK #define org_lwjgl_fmod_FMOD_FSOUND_CLOSECALLBACK 7L #undef org_lwjgl_fmod_FMOD_FSOUND_METADATACALLBACK #define org_lwjgl_fmod_FMOD_FSOUND_METADATACALLBACK 8L #undef org_lwjgl_fmod_FMOD_FSOUND_READCALLBACK #define org_lwjgl_fmod_FMOD_FSOUND_READCALLBACK 9L #undef org_lwjgl_fmod_FMOD_FSOUND_SEEKCALLBACK #define org_lwjgl_fmod_FMOD_FSOUND_SEEKCALLBACK 10L #undef org_lwjgl_fmod_FMOD_FSOUND_TELLCALLBACK #define org_lwjgl_fmod_FMOD_FSOUND_TELLCALLBACK 11L #undef org_lwjgl_fmod_FMOD_FSOUND_ENDCALLBACK #define org_lwjgl_fmod_FMOD_FSOUND_ENDCALLBACK 12L #undef org_lwjgl_fmod_FMOD_FSOUND_SYNCCALLBACK #define org_lwjgl_fmod_FMOD_FSOUND_SYNCCALLBACK 13L /* Inaccessible static: created */ #undef org_lwjgl_fmod_FMOD_FMOD_ERR_NONE #define org_lwjgl_fmod_FMOD_FMOD_ERR_NONE 0L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_BUSY #define org_lwjgl_fmod_FMOD_FMOD_ERR_BUSY 1L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_UNINITIALIZED #define org_lwjgl_fmod_FMOD_FMOD_ERR_UNINITIALIZED 2L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_INIT #define org_lwjgl_fmod_FMOD_FMOD_ERR_INIT 3L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_ALLOCATED #define org_lwjgl_fmod_FMOD_FMOD_ERR_ALLOCATED 4L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_PLAY #define org_lwjgl_fmod_FMOD_FMOD_ERR_PLAY 5L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_OUTPUT_FORMAT #define org_lwjgl_fmod_FMOD_FMOD_ERR_OUTPUT_FORMAT 6L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_COOPERATIVELEVEL #define org_lwjgl_fmod_FMOD_FMOD_ERR_COOPERATIVELEVEL 7L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_CREATEBUFFER #define org_lwjgl_fmod_FMOD_FMOD_ERR_CREATEBUFFER 8L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_FILE_NOTFOUND #define org_lwjgl_fmod_FMOD_FMOD_ERR_FILE_NOTFOUND 9L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_FILE_FORMAT #define org_lwjgl_fmod_FMOD_FMOD_ERR_FILE_FORMAT 10L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_FILE_BAD #define org_lwjgl_fmod_FMOD_FMOD_ERR_FILE_BAD 11L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_MEMORY #define org_lwjgl_fmod_FMOD_FMOD_ERR_MEMORY 12L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_VERSION #define org_lwjgl_fmod_FMOD_FMOD_ERR_VERSION 13L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_INVALID_PARAM #define org_lwjgl_fmod_FMOD_FMOD_ERR_INVALID_PARAM 14L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_NO_EAX #define org_lwjgl_fmod_FMOD_FMOD_ERR_NO_EAX 15L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_CHANNEL_ALLOC #define org_lwjgl_fmod_FMOD_FMOD_ERR_CHANNEL_ALLOC 17L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_RECORD #define org_lwjgl_fmod_FMOD_FMOD_ERR_RECORD 18L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_MEDIAPLAYER #define org_lwjgl_fmod_FMOD_FMOD_ERR_MEDIAPLAYER 19L #undef org_lwjgl_fmod_FMOD_FMOD_ERR_CDDEVICE #define org_lwjgl_fmod_FMOD_FMOD_ERR_CDDEVICE 20L /* Inaccessible static: initialized */ /* Inaccessible static: JNI_LIBRARY_NAME */ /* Inaccessible static: FMOD_WIN32_LIBRARY_NAME */ /* Inaccessible static: FMOD_LINUX_LIBRARY_NAME */ /* Inaccessible static: FMOD_OSX_LIBRARY_NAME */ /* * Class: org_lwjgl_fmod_FMOD * Method: getNativeLibraryVersion * Signature: ()Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FMOD_getNativeLibraryVersion (JNIEnv *, jclass); /* * Class: org_lwjgl_fmod_FMOD * Method: nCreate * Signature: ([Ljava/lang/String;)V */ JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FMOD_nCreate (JNIEnv *, jclass, jobjectArray); /* * Class: org_lwjgl_fmod_FMOD * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FMOD_nDestroy (JNIEnv *, jclass); /* * Class: org_lwjgl_fmod_FMOD * Method: FMOD_ErrorString * Signature: (I)Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FMOD_FMOD_1ErrorString (JNIEnv *, jclass, jint); #ifdef __cplusplus } #endif #endif --- NEW FILE: org_lwjgl_fmod_FMusic.cpp --- /* * Copyright (c) 2002-2004 Lightweight 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 'Lightweight 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. */ #include "org_lwjgl_fmod_FMusic.h" #include "extfmod.h" /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_LoadSong * Signature: (Ljava/lang/String;)J */ JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1LoadSong(JNIEnv *env, jclass clazz, jstring name) { const char* filename = (const char*) (env->GetStringUTFChars(name, 0)); return (jlong) fmod->FMUSIC_LoadSong(filename); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_LoadSongEx * Signature: (Ljava/nio/ByteBuffer;IIILjava/nio/IntBuffer;I)J */ JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1LoadSongEx__Ljava_nio_ByteBuffer_2IIIILjava_nio_IntBuffer_2II (JNIEnv *env, jclass clazz, jobject data, jint dataOffset, jint offset, jint length, jint mode, jobject sampleList, jint sampleListOffset, jint samplelistnum){ int *sampleData = NULL; const char *songData = dataOffset + (char *) env->GetDirectBufferAddress(data); if(sampleList != NULL) { sampleData = sampleListOffset + (int *) env->GetDirectBufferAddress(sampleList); } return (jlong) fmod->FMUSIC_LoadSongEx(songData, offset, length, mode, sampleData, samplelistnum); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_LoadSongEx * Signature: (Ljava/nio/ByteBuffer;IIILjava/nio/IntBuffer;I)J */ JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1LoadSongEx__Ljava_lang_String_2IIILjava_nio_IntBuffer_2II (JNIEnv *env, jclass clazz, jstring name, jint offset, jint length, jint mode, jobject sampleList, jint sampleListOffset, jint samplelistnum){ int *sampleData = NULL; const char* filename = (const char*) (env->GetStringUTFChars(name, 0)); if(sampleList != NULL) { sampleData = sampleListOffset + (int *) env->GetDirectBufferAddress(sampleList); } return (jlong) fmod->FMUSIC_LoadSongEx(filename, offset, length, mode, sampleData, samplelistnum); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetOpenState * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetOpenState (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_GetOpenState((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_FreeSong * Signature: (J)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1FreeSong (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_FreeSong((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_PlaySong * Signature: (J)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1PlaySong (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_PlaySong((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_StopSong * Signature: (J)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1StopSong (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_StopSong((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: FMUSIC_StopAllSongs * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FMusic_FMUSIC_1StopAllSongs (JNIEnv *env, jclass clazz){ return fmod->FMUSIC_StopAllSongs(); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetZxxCallback * Signature: (JLorg/lwjgl/fmod/FMusicCallback;)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetZxxCallback (JNIEnv *env, jclass clazz, jlong, jobject){ throwFMODException(env, "missing implementation"); return false; } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetRowCallback * Signature: (JLorg/lwjgl/fmod/FMusicCallback;I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetRowCallback (JNIEnv *env, jclass clazz, jlong, jobject, jint){ throwFMODException(env, "missing implementation"); return false; } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetOrderCallback * Signature: (JLorg/lwjgl/fmod/FMusicCallback;I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetOrderCallback (JNIEnv *env, jclass clazz, jlong, jobject, jint){ throwFMODException(env, "missing implementation"); return false; } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetInstCallback * Signature: (JLorg/lwjgl/fmod/FMusicCallback;I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetInstCallback (JNIEnv *env, jclass clazz, jlong, jobject, jint){ throwFMODException(env, "missing implementation"); return false; } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetSample * Signature: (JIJ)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetSample (JNIEnv *env, jclass clazz, jlong module, jint sampno, jlong sample){ return fmod->FMUSIC_SetSample((FMUSIC_MODULE *) module, sampno, (FSOUND_SAMPLE *) sample); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetUserData * Signature: (JLjava/nio/ByteBuffer;I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetUserData (JNIEnv *env, jclass clazz, jlong module, jobject data, jint offset){ throwFMODException(env, "missing implementation"); return false; } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_OptimizeChannels * Signature: (JII)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1OptimizeChannels (JNIEnv *env, jclass clazz, jlong module, jint max, jint min){ return fmod->FMUSIC_OptimizeChannels((FMUSIC_MODULE *) module, max, min); } /* * Class: org_lwjgl_fmod_FMusic * Method: FMUSIC_SetReverb * Signature: (Z)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_FMUSIC_1SetReverb (JNIEnv *env, jclass clazz, jboolean reverb){ return fmod->FMUSIC_SetReverb(reverb); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetLooping * Signature: (JZ)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetLooping (JNIEnv *env, jclass clazz, jlong module, jboolean looping){ return fmod->FMUSIC_SetLooping((FMUSIC_MODULE *) module, looping); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetOrder * Signature: (JI)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetOrder (JNIEnv *env, jclass clazz, jlong module, jint order){ return fmod->FMUSIC_SetOrder((FMUSIC_MODULE *) module, order); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetPaused * Signature: (JZ)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetPaused (JNIEnv *env, jclass clazz, jlong module, jboolean paused){ return fmod->FMUSIC_SetPaused((FMUSIC_MODULE *) module, paused); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetMasterVolume * Signature: (JI)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetMasterVolume (JNIEnv *env, jclass clazz, jlong module, jint volume){ return fmod->FMUSIC_SetMasterVolume((FMUSIC_MODULE *) module, volume); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetMasterSpeed * Signature: (JF)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetMasterSpeed (JNIEnv *env, jclass clazz, jlong module, jfloat speed){ return fmod->FMUSIC_SetMasterSpeed((FMUSIC_MODULE *) module, speed); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetPanSeperation * Signature: (JF)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetPanSeperation (JNIEnv *env, jclass clazz, jlong module, jfloat pan){ return fmod->FMUSIC_SetPanSeperation((FMUSIC_MODULE *) module, pan); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetName * Signature: (J)Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetName (JNIEnv *env, jclass clazz, jlong module) { const char * name = fmod->FMUSIC_GetName((FMUSIC_MODULE *) module); return env->NewStringUTF(name); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetType * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetType (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_GetType((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetNumOrders * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumOrders (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_GetNumOrders((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetNumPatterns * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumPatterns (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_GetNumPatterns((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetNumInstruments * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumInstruments (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_GetNumInstruments((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetNumSamples * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumSamples (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_GetNumSamples((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetNumChannels * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumChannels (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_GetNumChannels((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetSample * Signature: (JI)J */ JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetSample (JNIEnv *env, jclass clazz, jlong module, jint sampleno){ return (jlong) fmod->FMUSIC_GetSample((FMUSIC_MODULE *) module, sampleno); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetPatternLength * Signature: (JI)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetPatternLength (JNIEnv *env, jclass clazz, jlong module, jint orderno){ return fmod->FMUSIC_GetPatternLength((FMUSIC_MODULE *) module, orderno); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_IsFinished * Signature: (J)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1IsFinished (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_IsFinished((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_IsPlaying * Signature: (J)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1IsPlaying (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_IsPlaying((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetMasterVolume * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetMasterVolume (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_GetMasterVolume((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetGlobalVolume * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetGlobalVolume (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_GetGlobalVolume((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetOrder * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetOrder (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_GetOrder((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetPattern * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetPattern (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_GetPattern((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetSpeed * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetSpeed (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_GetSpeed((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetBPM * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetBPM (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_GetBPM((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetRow * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetRow (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_GetRow((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetPaused * Signature: (J)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetPaused (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_GetPaused((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetTime * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetTime (JNIEnv *env, jclass clazz, jlong module){ return fmod->FMUSIC_GetTime((FMUSIC_MODULE *) module); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetRealChannel * Signature: (JI)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetRealChannel (JNIEnv *env, jclass clazz, jlong module, jint modchannel){ return fmod->FMUSIC_GetRealChannel((FMUSIC_MODULE *) module, modchannel); } /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetUserData * Signature: (J)Ljava/nio/ByteBuffer; */ JNIEXPORT jobject JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetUserData (JNIEnv *env, jclass clazz, jlong module) { throwFMODException(env, "missing implementation"); return NULL; } --- NEW FILE: org_lwjgl_fmod_FSound.h --- /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class org_lwjgl_fmod_FSound */ #ifndef _Included_org_lwjgl_fmod_FSound #define _Included_org_lwjgl_fmod_FSound #ifdef __cplusplus extern "C" { #endif #undef org_lwjgl_fmod_FSound_FSOUND_MIXER_AUTODETECT #define org_lwjgl_fmod_FSound_FSOUND_MIXER_AUTODETECT 0L #undef org_lwjgl_fmod_FSound_FSOUND_MIXER_BLENDMODE #define org_lwjgl_fmod_FSound_FSOUND_MIXER_BLENDMODE 1L #undef org_lwjgl_fmod_FSound_FSOUND_MIXER_MMXP5 #define org_lwjgl_fmod_FSound_FSOUND_MIXER_MMXP5 2L #undef org_lwjgl_fmod_FSound_FSOUND_MIXER_MMXP6 #define org_lwjgl_fmod_FSound_FSOUND_MIXER_MMXP6 3L #undef org_lwjgl_fmod_FSound_FSOUND_MIXER_QUALITY_AUTODETECT #define org_lwjgl_fmod_FSound_FSOUND_MIXER_QUALITY_AUTODETECT 4L [...1604 lines suppressed...] /* * Class: org_lwjgl_fmod_FSound * Method: nFSOUND_Reverb_SetChannelProperties * Signature: (IJ)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Reverb_1SetChannelProperties (JNIEnv *, jclass, jint, jlong); /* * Class: org_lwjgl_fmod_FSound * Method: nFSOUND_Reverb_GetChannelProperties * Signature: (IJ)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Reverb_1GetChannelProperties (JNIEnv *, jclass, jint, jlong); #ifdef __cplusplus } #endif #endif --- NEW FILE: extfmod.h --- /* * 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. */ #ifndef _EXT_FMOD_H #define _EXT_FMOD_H #include <jni.h> #include "../common_tools.h" #include "fmoddyn.h" #include "fmod_errors.h" extern FMOD_INSTANCE * fmod; void fmod_create(char*); void fmod_destroy(); #endif --- NEW FILE: org_lwjgl_fmod_FSound.cpp --- /* * Copyright (c) 2002-2004 Lightweight 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 'Lightweight 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. * [...1718 lines suppressed...] return fmod->FSOUND_Reverb_GetProperties((FSOUND_REVERB_PROPERTIES*) prop); } /* * Class: org_lwjgl_fmod_FSound * Method: nFSOUND_Reverb_SetChannelProperties * Signature: (IJ)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Reverb_1SetChannelProperties(JNIEnv * env, jclass clazz, jint channel, jlong prop) { return fmod->FSOUND_Reverb_SetChannelProperties(channel, (FSOUND_REVERB_CHANNELPROPERTIES*) prop); } /* * Class: org_lwjgl_fmod_FSound * Method: nFSOUND_Reverb_GetChannelProperties * Signature: (IJ)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FSound_nFSOUND_1Reverb_1GetChannelProperties(JNIEnv * env, jclass clazz, jint channel, jlong prop) { return fmod->FSOUND_Reverb_GetChannelProperties(channel, (FSOUND_REVERB_CHANNELPROPERTIES*) prop); } --- NEW FILE: org_lwjgl_fmod_FMusic.h --- /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class org_lwjgl_fmod_FMusic */ #ifndef _Included_org_lwjgl_fmod_FMusic #define _Included_org_lwjgl_fmod_FMusic #ifdef __cplusplus extern "C" { #endif #undef org_lwjgl_fmod_FMusic_FMUSIC_TYPE_NONE #define org_lwjgl_fmod_FMusic_FMUSIC_TYPE_NONE 0L #undef org_lwjgl_fmod_FMusic_FMUSIC_TYPE_MOD #define org_lwjgl_fmod_FMusic_FMUSIC_TYPE_MOD 1L #undef org_lwjgl_fmod_FMusic_FMUSIC_TYPE_S3M #define org_lwjgl_fmod_FMusic_FMUSIC_TYPE_S3M 2L #undef org_lwjgl_fmod_FMusic_FMUSIC_TYPE_XM #define org_lwjgl_fmod_FMusic_FMUSIC_TYPE_XM 3L #undef org_lwjgl_fmod_FMusic_FMUSIC_TYPE_IT #define org_lwjgl_fmod_FMusic_FMUSIC_TYPE_IT 4L #undef org_lwjgl_fmod_FMusic_FMUSIC_TYPE_MIDI #define org_lwjgl_fmod_FMusic_FMUSIC_TYPE_MIDI 5L #undef org_lwjgl_fmod_FMusic_FMUSIC_TYPE_FSB #define org_lwjgl_fmod_FMusic_FMUSIC_TYPE_FSB 6L /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_LoadSong * Signature: (Ljava/lang/String;)J */ JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1LoadSong (JNIEnv *, jclass, jstring); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_LoadSongEx * Signature: (Ljava/nio/ByteBuffer;IIIILjava/nio/IntBuffer;II)J */ JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1LoadSongEx__Ljava_nio_ByteBuffer_2IIIILjava_nio_IntBuffer_2II (JNIEnv *, jclass, jobject, jint, jint, jint, jint, jobject, jint, jint); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_LoadSongEx * Signature: (Ljava/lang/String;IIILjava/nio/IntBuffer;II)J */ JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1LoadSongEx__Ljava_lang_String_2IIILjava_nio_IntBuffer_2II (JNIEnv *, jclass, jstring, jint, jint, jint, jobject, jint, jint); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetOpenState * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetOpenState (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_FreeSong * Signature: (J)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1FreeSong (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_PlaySong * Signature: (J)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1PlaySong (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_StopSong * Signature: (J)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1StopSong (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: FMUSIC_StopAllSongs * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FMusic_FMUSIC_1StopAllSongs (JNIEnv *, jclass); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetZxxCallback * Signature: (JLorg/lwjgl/fmod/callbacks/FMusicCallback;)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetZxxCallback (JNIEnv *, jclass, jlong, jobject); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetRowCallback * Signature: (JLorg/lwjgl/fmod/callbacks/FMusicCallback;I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetRowCallback (JNIEnv *, jclass, jlong, jobject, jint); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetOrderCallback * Signature: (JLorg/lwjgl/fmod/callbacks/FMusicCallback;I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetOrderCallback (JNIEnv *, jclass, jlong, jobject, jint); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetInstCallback * Signature: (JLorg/lwjgl/fmod/callbacks/FMusicCallback;I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetInstCallback (JNIEnv *, jclass, jlong, jobject, jint); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetSample * Signature: (JIJ)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetSample (JNIEnv *, jclass, jlong, jint, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetUserData * Signature: (JLjava/nio/ByteBuffer;I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetUserData (JNIEnv *, jclass, jlong, jobject, jint); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_OptimizeChannels * Signature: (JII)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1OptimizeChannels (JNIEnv *, jclass, jlong, jint, jint); /* * Class: org_lwjgl_fmod_FMusic * Method: FMUSIC_SetReverb * Signature: (Z)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_FMUSIC_1SetReverb (JNIEnv *, jclass, jboolean); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetLooping * Signature: (JZ)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetLooping (JNIEnv *, jclass, jlong, jboolean); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetOrder * Signature: (JI)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetOrder (JNIEnv *, jclass, jlong, jint); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetPaused * Signature: (JZ)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetPaused (JNIEnv *, jclass, jlong, jboolean); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetMasterVolume * Signature: (JI)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetMasterVolume (JNIEnv *, jclass, jlong, jint); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetMasterSpeed * Signature: (JF)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetMasterSpeed (JNIEnv *, jclass, jlong, jfloat); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_SetPanSeperation * Signature: (JF)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1SetPanSeperation (JNIEnv *, jclass, jlong, jfloat); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetName * Signature: (J)Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetName (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetType * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetType (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetNumOrders * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumOrders (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetNumPatterns * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumPatterns (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetNumInstruments * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumInstruments (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetNumSamples * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumSamples (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetNumChannels * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetNumChannels (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetSample * Signature: (JI)J */ JNIEXPORT jlong JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetSample (JNIEnv *, jclass, jlong, jint); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetPatternLength * Signature: (JI)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetPatternLength (JNIEnv *, jclass, jlong, jint); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_IsFinished * Signature: (J)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1IsFinished (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_IsPlaying * Signature: (J)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1IsPlaying (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetMasterVolume * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetMasterVolume (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetGlobalVolume * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetGlobalVolume (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetOrder * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetOrder (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetPattern * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetPattern (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetSpeed * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetSpeed (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetBPM * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetBPM (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetRow * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetRow (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetPaused * Signature: (J)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetPaused (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetTime * Signature: (J)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetTime (JNIEnv *, jclass, jlong); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetRealChannel * Signature: (JI)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetRealChannel (JNIEnv *, jclass, jlong, jint); /* * Class: org_lwjgl_fmod_FMusic * Method: nFMUSIC_GetUserData * Signature: (J)Ljava/nio/ByteBuffer; */ JNIEXPORT jobject JNICALL Java_org_lwjgl_fmod_FMusic_nFMUSIC_1GetUserData (JNIEnv *, jclass, jlong); #ifdef __cplusplus } #endif #endif --- NEW FILE: org_lwjgl_fmod_FMOD.cpp --- /* * Copyright (c) 2002-2004 Lightweight 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 'Lightweight 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. */ #include "org_lwjgl_fmod_FMOD.h" #include "extfmod.h" static const char* VERSION = "0.9a"; /* * Class: org_lwjgl_fmod_FMOD * Method: getNativeLibraryVersion * Signature: ()Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FMOD_getNativeLibraryVersion(JNIEnv * env, jclass clazz) { return env->NewStringUTF(VERSION); } /* * Class: org_lwjgl_fmod_FMOD * Method: nCreate * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FMOD_nCreate(JNIEnv *env, jclass clazz, jobjectArray paths) { jsize pathcount = env->GetArrayLength(paths); for(int i=0;i<pathcount;i++) { jstring path = (jstring) env->GetObjectArrayElement(paths, i); char *path_str = (char *) env->GetStringUTFChars(path, NULL); printfDebug("Trying to load fmod from %s\n", path_str); fmod_create(path_str); env->ReleaseStringUTFChars(path, path_str); if(fmod != NULL) { return; } } throwFMODException(env, "Unable to load fmod library"); } /* * Class: org_lwjgl_fmod_FMOD * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_fmod_FMOD_nDestroy(JNIEnv *env, jclass clazz) { fmod_destroy(); } /* * Class: org_lwjgl_fmod_FMOD * Method: FMOD_ErrorString * Signature: (I)Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_org_lwjgl_fmod_FMOD_FMOD_1ErrorString(JNIEnv *env, jclass clazz, jint errorcode) { return env->NewStringUTF(FMOD_ErrorString(errorcode)); } |
|
From: Brian M. <ma...@us...> - 2004-05-23 14:03:18
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25022/java/org/lwjgl/fmod Added Files: FMOD.java FMODException.java FMusic.java FMusicModule.java FSound.java FSoundDSPUnit.java FSoundReverbChannelProperties.java FSoundReverbProperties.java FSoundSample.java FSoundSampleLock.java FSoundStream.java FSoundSyncPoint.java FSoundTagField.java Log Message: fmod support --- NEW FILE: FMOD.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.fmod; import java.io.File; import java.nio.FloatBuffer; import java.util.HashMap; import java.util.StringTokenizer; /** * $Id: FMOD.java,v 1.1 2004/05/23 14:03:05 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class FMOD { /** Array of hashmaps for callbacks */ private static HashMap[] callbacks = new HashMap[14]; /** FMOD System level clear dsp unit */ static FSoundDSPUnit fmodClearUnit; /** FMOD System level clip and copy dsp unit */ static FSoundDSPUnit fmodClipAndCopyUnit; /** FMOD System level music dsp unit */ static FSoundDSPUnit fmodMusicUnit; /** FMOD System level sound effects dsp unit */ static FSoundDSPUnit fmodSFXUnit; /** FMOD System level FFT dsp unit */ static FSoundDSPUnit fmodFFTUnit; /** FMOD System level FFT buffer */ static FloatBuffer fmodFFTBuffer; /** Type defining the music callback entries in callback hashmap array */ public static final int FMUSIC_CALLBACK = 0; /** Type defining the dsp callback entries in callback hashmap array */ public static final int FSOUND_DSPCALLBACK = 1; /** Type defining the stream callback entries in callback hashmap array */ public static final int FSOUND_STREAMCALLBACK = 2; /** Type defining the alloc callback entries in callback hashmap array */ public static final int FSOUND_ALLOCCALLBACK = 3; /** Type defining the realloc callback entries in callback hashmap array */ public static final int FSOUND_REALLOCCALLBACK = 4; /** Type defining the free callback entries in callback hashmap array */ public static final int FSOUND_FREECALLBACK = 5; /** Type defining the open callback entries in callback hashmap array */ public static final int FSOUND_OPENCALLBACK = 6; /** Type defining the close callback entries in callback hashmap array */ public static final int FSOUND_CLOSECALLBACK = 7; /** Type defining the metadata callback entries in callback hashmap array */ public static final int FSOUND_METADATACALLBACK = 8; /** Type defining the read callback entries in callback hashmap array */ public static final int FSOUND_READCALLBACK = 9; /** Type defining the seek callback entries in callback hashmap array */ public static final int FSOUND_SEEKCALLBACK = 10; /** Type defining the tell callback entries in callback hashmap array */ public static final int FSOUND_TELLCALLBACK = 11; /** Type defining the "end" callback entries in callback hashmap array */ public static final int FSOUND_ENDCALLBACK = 12; /** Type defining the "sync" callback entries in callback hashmap array */ public static final int FSOUND_SYNCCALLBACK = 13; /** Have we been created? */ protected static boolean created; /** No errors */ public static final int FMOD_ERR_NONE = 0; /** Cannot call this command after FSOUND_Init. Call FSOUND_Close first. */ public static final int FMOD_ERR_BUSY = 1; /** This command failed because FSOUND_Init was not called */ public static final int FMOD_ERR_UNINITIALIZED = 2; /** Error initializing output device. */ public static final int FMOD_ERR_INIT = 3; /** Error initializing output device, but more specifically, the output device is already in use and cannot be reused. */ public static final int FMOD_ERR_ALLOCATED = 4; /** Playing the sound failed. */ public static final int FMOD_ERR_PLAY = 5; /** Soundcard does not support the features needed for this soundsystem (16bit stereo output) */ public static final int FMOD_ERR_OUTPUT_FORMAT = 6; /** Error setting cooperative level for hardware. */ public static final int FMOD_ERR_COOPERATIVELEVEL = 7; /** Error creating hardware sound buffer. */ public static final int FMOD_ERR_CREATEBUFFER = 8; /** File not found */ public static final int FMOD_ERR_FILE_NOTFOUND = 9; /** Unknown file format */ public static final int FMOD_ERR_FILE_FORMAT = 10; /** Error loading file */ public static final int FMOD_ERR_FILE_BAD = 11; /** Not enough memory */ public static final int FMOD_ERR_MEMORY = 12; /** The version number of this file format is not supported */ public static final int FMOD_ERR_VERSION = 13; /** An invalid parameter was passed to this function */ public static final int FMOD_ERR_INVALID_PARAM = 14; /** Tried to use an EAX command on a non EAX enabled channel or output. */ public static final int FMOD_ERR_NO_EAX = 15; /** Failed to allocate a new channel */ public static final int FMOD_ERR_CHANNEL_ALLOC = 17; /** Recording is not supported on this machine */ public static final int FMOD_ERR_RECORD = 18; /** Required Mediaplayer codec is not installed */ public static final int FMOD_ERR_MEDIAPLAYER = 19; /** An error occured trying to open the specified CD device */ public static final int FMOD_ERR_CDDEVICE = 20; /** Whether we have been initialized */ private static boolean initialized; /** The native JNI library name */ private static String JNI_LIBRARY_NAME = "lwjgl-fmod"; /** The native library name on win32 */ private static String FMOD_WIN32_LIBRARY_NAME = "fmod.dll"; /** The native library name on win32 */ private static String FMOD_LINUX_LIBRARY_NAME = "libfmod.so.0"; /** The native library name on win32 */ private static String FMOD_OSX_LIBRARY_NAME = "fmod_cfm.shlb"; /** Version of FMOD */ public static final String VERSION = "0.9a"; static { initialize(); } /** * Initializes the FMOD binding */ public static void initialize() { if (initialized) { return; } initialized = true; System.loadLibrary(JNI_LIBRARY_NAME); // check for mismatch String nativeVersion = getNativeLibraryVersion(); if (!nativeVersion.equals(VERSION)) { throw new LinkageError( "Version mismatch: jar version is '" + VERSION + "', native libary version is '" + nativeVersion + "'"); } // Initialize callback hashmaps for(int i=0; i<callbacks.length; i++) { callbacks[i] = new HashMap(); } } /** * Return the version of the native library */ private static native String getNativeLibraryVersion(); /** * @return true if AL has been created */ public static boolean isCreated() { return created; } /** * Creates an FMOD instance. */ public static void create() throws FMODException { if (created) { return; } // create, passing potential locations for native fmod library nCreate(constructFMODSearchPaths()); created = true; } /** * Retrieves an array of strings, with potential locations for * the native fmod library * @return array of strings, with potential locations for the native fmod library */ private static String[] constructFMODSearchPaths() { // miscellaneous values String libpath = System.getProperty("java.library.path"); String seperator = System.getProperty("path.separator"); String osName = System.getProperty("os.name"); // determine os library name String dllName = FMOD_WIN32_LIBRARY_NAME; if (osName.startsWith("Mac OS")) { dllName = FMOD_OSX_LIBRARY_NAME; } else if (osName.startsWith("Linux")) { dllName = FMOD_LINUX_LIBRARY_NAME; } // split, and rebuild library path to path + dll StringTokenizer st = new StringTokenizer(libpath, seperator); String[] paths = new String[st.countTokens() + 1]; //build paths for (int i = 0; i < paths.length - 1; i++) { paths[i] = st.nextToken() + File.separator + dllName; } //add cwd path paths[paths.length - 1] = dllName; return paths; } /** * Native method to create FMOD instance * * @return true if the FMOD creation process succeeded */ protected static native void nCreate(String[] paths); /** * Exit cleanly by calling destroy. */ public static void destroy() { if(!created) { return; } created = false; nDestroy(); } /** * Native method the destroy the FMOD */ protected static native void nDestroy(); /** * Registers a callback by its handle * * @param handle Handle to native object being monitored * @param callbackHandler Object to register as the call back handler */ static void registerCallback(int type, long handle, Object handled, Object callbackHandler) { if(callbackHandler == null) { callbacks[type].remove(new Long(handle)); } else { callbacks[type].put(new Long(handle), new FMOD.WrappedCallback(handled, callbackHandler)); } } /** * Retrieves a call back handler by its native handle * @param handle Handle to native object being monitored * @return Call back handler, or null if no such handler */ static WrappedCallback getCallback(int type, long handle) { return (WrappedCallback) callbacks[type].get(new Long(handle)); } /** * Retrieves the errorcode desription for specified code * * @param errorcode errorcode to lookup * @return Description of errorcode */ public static native String FMOD_ErrorString(int errorcode); /** * Wrapper class for a callback handler, and the object associated */ static class WrappedCallback { Object handled; Object callback; WrappedCallback(Object handled, Object callback) { this.handled = handled; this.callback = callback; } } } --- NEW FILE: FSoundSyncPoint.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.fmod; /** * This class is a representation of a SyncPoint in FMod. * $Id: FSoundSyncPoint.java,v 1.1 2004/05/23 14:03:06 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class FSoundSyncPoint { /** Handle to syncpoint */ long syncpointHandle; /** * Creates a new FSoundSyncPoint * * @param syncpointHandle handle to syncpoint */ FSoundSyncPoint(long syncpointHandle) { this.syncpointHandle = syncpointHandle; } } --- NEW FILE: FMusic.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.fmod; import java.nio.ByteBuffer; import java.nio.IntBuffer; import org.lwjgl.fmod.callbacks.FMusicCallback; /** * $Id: FMusic.java,v 1.1 2004/05/23 14:03:05 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class FMusic { /** No song being played */ public static final int FMUSIC_TYPE_NONE = 0; /** Protracker / Fasttracker */ public static final int FMUSIC_TYPE_MOD = 1; /** ScreamTracker 3 */ public static final int FMUSIC_TYPE_S3M = 2; /** FastTracker 2 */ public static final int FMUSIC_TYPE_XM = 3; /** Impulse Tracker */ public static final int FMUSIC_TYPE_IT = 4; /** MIDI file */ public static final int FMUSIC_TYPE_MIDI = 5; /** FMOD Sample Bank file */ public static final int FMUSIC_TYPE_FSB = 6; /** * To load a module or bank with a given filename. FMUSIC Supports loading of * - .MOD (protracker/fasttracker modules) * - .S3M (screamtracker 3 modules) * - .XM (fasttracker 2 modules) * - .IT (impulse tracker modules) * - .MID (MIDI files) * - .RMI (MIDI files) * - .SGT (DirectMusic segment files) * - .FSB (FMOD Sample Bank files) * * @param name Filename of module to load * @return On success, a FMusicModule instance is returned. On failure, Null is returned */ public static FMusicModule FMUSIC_LoadSong(String name) { long result = nFMUSIC_LoadSong(name); if(result != FMUSIC_TYPE_NONE) { return new FMusicModule(result); } return null; } private static native long nFMUSIC_LoadSong(String name); /** * To load a module or bank with a given filename. FMUSIC Supports loading of * - .MOD (protracker/fasttracker modules) * - .S3M (screamtracker 3 modules) * - .XM (fasttracker 2 modules) * - .IT (impulse tracker modules) * - .MID (MIDI files) * - .RMI (MIDI files) * - .SGT (DirectMusic segment files) * - .FSB (FMOD Sample Bank files) * <p> * <i> * Loading a song from a memory handle is dangerous in one respect, if the data is corrupted or truncated, then FMUSIC could crash internally trying to load it. * On PlayStation 2 the data and length pointer must be 16 byte aligned for DMA purposes. * The samplelist and samplelistnum parameters are useful for limiting the amount of data fmod loads. This feature is for the FSB format only. It is especially useful if you have a bank of sounds and want to randomize the loading a bit by telling which sounds to load with random values, and consequently which not to load. * On PlayStation 2, samplelistnum has a limit of 1536 entries. * </i> * </p> * * @param name_or_data Name of song or data containing song to load (if loading from memory and not file). On PlayStation 2 data must be 16 byte aligned if loading from memory * @param offset Optional. 0 by default. If > 0, this value is used to specify an offset in a file, so fmod will seek before opening * @param length Optional. 0 by default. If > 0, this value is used to specify the length of a memory block when using FSOUND_LOADMEMORY, or it is the length of a file or file segment if the offset parameter is used. On PlayStation 2 this must be 16 byte aligned for memory loading * @param mode Mode for opening song. With module files, only FSOUND_LOADMEMORY, FSOUND_NONBLOCKING, FSOUND_LOOP_NORMAL, or FSOUND_LOOP_OFF are supported. For FSB files, FSOUND_2D, FSOUND_HW3D, FSOUND_FORCEMONO also work * @param sampleList Optional. Buffer of sample indicies to load. Leave as Null if you want all samples to be loaded (default behaviour). See Remarks for more on this * @return On success, a FMusicModule instance is returned. On failure, Null is returned */ public static FMusicModule FMUSIC_LoadSongEx(ByteBuffer name_or_data, int offset, int length, int mode, IntBuffer sampleList) { long result = 0; if((mode & FSound.FSOUND_LOADMEMORY) == FSound.FSOUND_LOADMEMORY) { result = nFMUSIC_LoadSongEx(name_or_data, name_or_data.position(), offset, length, mode, (sampleList != null) ? sampleList : null, (sampleList != null) ? sampleList.position() : 0, (sampleList != null) ? sampleList.remaining() : 0); } else { byte[] data = new byte[name_or_data.remaining()]; result = nFMUSIC_LoadSongEx(new String(data), offset, length, mode, (sampleList != null) ? sampleList : null, (sampleList != null) ? sampleList.position() : 0, (sampleList != null) ? sampleList.remaining() : 0); } if(result != FMUSIC_TYPE_NONE) { return new FMusicModule(result); } return null; } private static native long nFMUSIC_LoadSongEx(ByteBuffer data, int dataOffset, int offset, int length, int mode, IntBuffer sampleList, int bufferOffset, int remaining); private static native long nFMUSIC_LoadSongEx(String name, int offset, int length, int mode, IntBuffer sampleList, int bufferOffset, int remaining); /** * If a mod is opened with FSOUND_NONBLOCKING, this function returns the state of the opening mod. * @param module Module to get the open state from * @return 0 = mod is opened and ready. -1 = mod handle passed in is invalid. -2 = mod is still opening -3 = mod failed to open. (file not found, out of memory or other error). */ public static int FMUSIC_GetOpenState(FMusicModule module) { return nFMUSIC_GetOpenState(module.moduleHandle); } private static native int nFMUSIC_GetOpenState(long module); /** * Frees memory allocated for a song and removes it from the FMUSIC system * @param module Module to be freed * @return On success, true is returned. On failure, false is returned */ public static boolean FMUSIC_FreeSong(FMusicModule module) { // when freeing a song, we automatically deregister any callbacks FMOD.registerCallback(FMOD.FMUSIC_CALLBACK, module.moduleHandle, null, null); return nFMUSIC_FreeSong(module.moduleHandle); } private static native boolean nFMUSIC_FreeSong(long module); /** * Starts a song playing * @param module Module to be played * @return true if module succeeded playing. false if module failed playing */ public static boolean FMUSIC_PlaySong(FMusicModule module) { return nFMUSIC_PlaySong(module.moduleHandle); } private static native boolean nFMUSIC_PlaySong(long module); /** * Stops a song from playing. * @param module Module to be stopped * @return On success, true is returned. On failure, false is returned */ public static boolean FMUSIC_StopSong(FMusicModule module) { return nFMUSIC_StopSong(module.moduleHandle); } private static native boolean nFMUSIC_StopSong(long module); /** * Stops all songs from playing. This is useful if you have multiple songs playing at once and * want a quick way to stop them */ private static native void FMUSIC_StopAllSongs(); /** * Sets a user callback for any Zxx commands encountered in an S3M, XM or IT file. * <p> * <b>Remarks</b> * The value passed into the param parameter of the callback is the xx value specified in the Zxx * command by the musician * ------------ * It is important to note that this callback will be called from directly WITHIN the * mixer / music update thread, therefore it is imperative that whatever you do from this * callback be extremely efficient. If the routine takes too long then breakups in the sound * will occur, or it will basically stop mixing until you return from the function. * This sort of function is usually best for just setting a flag, or do some simple variable * manipulation, and then exiting, letting your main thread do what it needs to based on these * flags or variables. * ------------ * This callback is LATENCY adjusted, so that the callback happens when you HEAR the sound, not when it is mixed, for accurate synchronization. * Use FSOUND_INIT_DONTLATENCYADJUST if you want it to be called back at mix time, which is useful if you want to control the music interactively. * ------------ * Note : This function is not supported with the MIDI format. * @param module Module to set the callback for * @param callback The callback function you supply to get called upon execution of a Zxx command * @return On success, true is returned. On failure, false is returned */ public static boolean FMUSIC_SetZxxCallback(FMusicModule module, FMusicCallback callback) { FMOD.registerCallback(FMOD.FMUSIC_CALLBACK, module.moduleHandle, module, callback); return nFMUSIC_SetZxxCallback(module.moduleHandle, callback); } private static native boolean nFMUSIC_SetZxxCallback(long module, FMusicCallback callback); /** * Sets a user callback to occur on every row divisible by the rowstep parameter, played from a MOD, S3M, XM or IT file. * <p> * <b>Remarks</b> * It is important to note that this callback will be called from directly WITHIN the * mixer / music update thread, therefore it is imperative that whatever you do from this * callback be extremely efficient. If the routine takes too long then breakups in the sound * will occur, or it will basically stop mixing until you return from the function. * This sort of function is usually best for just setting a flag, or do some simple variable * manipulation, and then exiting, letting your main thread do what it needs to based on these * flags or variables. * ------------ * This callback is LATENCY adjusted, so that the callback happens when you HEAR the sound, not when it is mixed, for accurate synchronization. * Use FSOUND_INIT_DONTLATENCYADJUST if you want it to be called back at mix time, which is useful if you want to control the music interactively. * ------------ * Note : This function is not supported with the MIDI format. * @param module Module to set the callback for * @param callback The callback function you supply to get called * @param rowstep Call the callback every multiple of this number of rows * @return On success, true is returned. On failure, false is returned */ public static boolean FMUSIC_SetRowCallback(FMusicModule module, FMusicCallback callback, int rowstep) { FMOD.registerCallback(FMOD.FMUSIC_CALLBACK, module.moduleHandle, module, callback); return nFMUSIC_SetRowCallback(module.moduleHandle, callback, rowstep); } private static native boolean nFMUSIC_SetRowCallback(long module, FMusicCallback callback, int rowstep); /** * Sets a user callback to occur on every order divisible by the orderstep parameter, played from a MOD, S3M, XM or IT file * <p> * <b>Remarks</b> * It is important to note that this callback will be called from directly WITHIN the * mixer / music update thread, therefore it is imperative that whatever you do from this * callback be extremely efficient. If the routine takes too long then breakups in the sound * will occur, or it will basically stop mixing until you return from the function. * This sort of function is usually best for just setting a flag, or do some simple variable * manipulation, and then exiting, letting your main thread do what it needs to based on these * flags or variables. * ------------ * This callback is LATENCY adjusted, so that the callback happens when you HEAR the sound, not when it is mixed, for accurate synchronization. * Use FSOUND_INIT_DONTLATENCYADJUST if you want it to be called back at mix time, which is useful if you want to control the music interactively. * ------------ * Note : This function is not supported with the MIDI format. * @param module Module to set the callback for * @param callback The callback function you supply to get called * @param orderstep Call the callback every multiple of this number of orders * @return On success, true is returned. On failure, false is returned */ public static boolean FMUSIC_SetOrderCallback(FMusicModule module, FMusicCallback callback, int orderstep) { FMOD.registerCallback(FMOD.FMUSIC_CALLBACK, module.moduleHandle, module, callback); return nFMUSIC_SetOrderCallback(module.moduleHandle, callback, orderstep); } private static native boolean nFMUSIC_SetOrderCallback(long module, FMusicCallback callback, int orderstep); /** * Sets a user callback to occur every time a instrument is played, triggered from a MOD, S3M, XM or IT file. * <p> * <b>Remarks</b> * It is important to note that this callback will be called from directly WITHIN the * mixer / music update thread, therefore it is imperative that whatever you do from this * callback be extremely efficient. If the routine takes too long then breakups in the sound * will occur, or it will basically stop mixing until you return from the function. * This sort of function is usually best for just setting a flag, or do some simple variable * manipulation, and then exiting, letting your main thread do what it needs to based on these * flags or variables. * ------------ * This callback is LATENCY adjusted, so that the callback happens when you HEAR the sound, not when it is mixed, for accurate synchronization. * Use FSOUND_INIT_DONTLATENCYADJUST if you want it to be called back at mix time, which is useful if you want to control the music interactively. * ------------ * Note : This function is not supported with the MIDI format. * @param module Module set the callback for * @param callback The callback function you supply to get called * @param instrument Call the callback when this instrument number is triggered * @return On success, true is returned. On failure, false is returned */ public static boolean FMUSIC_SetInstCallback(FMusicModule module, FMusicCallback callback, int instrument) { FMOD.registerCallback(FMOD.FMUSIC_CALLBACK, module.moduleHandle, module, callback); return nFMUSIC_SetInstCallback(module.moduleHandle, callback, instrument); } private static native boolean nFMUSIC_SetInstCallback(long module, FMusicCallback callback, int instrument); /** * Replaces a mod's sample with a sample definition specified. * <p> * <b>Remarks</b> * Because of the instrument nature of some formats like XM, this function lists all the samples in order of instruments and their subsamples. * ie if instrument 1 has 2 samples and instrument 2 contains 3 samples, then sampno in this case would be 0 and 1 for instrument 1's samples, and 2,3 & 4 for instrument 2's samples. * ------------ * FMOD does not free the existing mod sample that you may be overwriting. If you do overwrite an existing handle, it may be lost, and you may incur a memory leak. It is a good idea to free the existing sample first before overwriting it. * ------------ * Important: For PlayStation 2, this function has to do a blocking query to the IOP, and can take significantly more time than a standard non blocking fmod function. This means it is best to cache the pointers for samples while loading, and not call this function in realtime. * ------------ * This function is not supported with the MIDI format. * </p> * @param module Module to set the sample for. * @param sampno index to sample inside module * @param sptr sample definition to replace mod sample * @return On success, true is returned. On failure, false is returned */ public static boolean FMUSIC_SetSample(FMusicModule module, int sampno, FSoundSample sptr) { return nFMUSIC_SetSample(module.moduleHandle, sampno, sptr.sampleHandle); } private static native boolean nFMUSIC_SetSample(long module, int sampno, long sptr); /** * Sets a user defined value to store with the music file to be retrieved later. * @param module Module to set user data for * @param userdata Value to store with music object * @return On success, true is returned. On failure, false is returned */ public static boolean FMUSIC_SetUserData(FMusicModule module, ByteBuffer userdata) { return nFMUSIC_SetUserData(module.moduleHandle, userdata, userdata.position()); } private static native boolean nFMUSIC_SetUserData(long module, ByteBuffer userdata, int offset); /** * This function helps with channel usage. If you are desperate for channels, and you are prepared to * let the music routines drop a few channels, then calling this function can help. * It basically doesnt try to play any new sounds if a certain channel limit is being played (including sound effects), * and the new sound is below a certain specified volume. * ie. * You set it to maxchannels = 16, and minvolume = 0x10. * In this case, the mod will play normally as long as the total number of channels being played inclusing sound effefcts is below 16 * (see FSOUND_GetChannelsPlaying). * If the number of channels playing exceeds 16 (through a change in the music, or extra sound effects * are spawned, then sounds with a musician specified volume of less than 0x10 will be ignored. * The volume is based on volume column/default volume/volume set commands in the mod. master volume, * envelope volumes etc are not taken into account (this gives more control over how it will work from the * tracker). * <p> * <b>Remarks</b> * maxchannels will default to the number of channels allocated by FSOUND, so this will never happen * by default. * minvolume will default to 0, so it will always succeed by default. * To see how many channels are currently being MIXED, use FSOUND_GetChannelsPlaying. * As a musician mentioned to me once, most of his default volumes are set fairly high, and any low end * volumes are usually echoes etc, and can afford to be dropped. * ------------ * Note : This function is not supported with the MIDI format. * </p> * @param module Module to set channel/volume optimization settings * @param maxchannels Channel count to be mixed before fmusic starts to drop channels from the song * @param minvolume If maxchannels is exceeded, then music channels with volumes below this value will not be played. Range is 0-64. This is the value the tracker displays. All trackers use 0-64 * @return On success, true is returned. On failure, false is returned */ public static boolean FMUSIC_OptimizeChannels(FMusicModule module, int maxchannels, int minvolume) { return nFMUSIC_OptimizeChannels(module.moduleHandle, maxchannels, minvolume); } private static native boolean nFMUSIC_OptimizeChannels(long module, int maxchannels, int minvolume); /** * Turns on reverb for MIDI/RMI files. * <p> * <b>Remarks</b> * Reverb may be enabled through software emulation in the future for MOD based formats. * </p> * @param reverb Set to true to turn MIDI reverb on, false to turn MIDI reverb off * @return On success, true is returned. On failure, false is returned */ public static native boolean FMUSIC_SetReverb(boolean reverb); /** * Sets looping mode for midi and mod files * <p> * <b>Remarks</b> * Defaults to TRUE. To disable looping you must call this function using FALSE as the parameter. * For midi files this only takes effect before FMUSIC_PlaySong is called. For mod files this * can be called at any time including during playback. * </p> * @param module Module to set looping for * @param looping Set to true to make it loop forever, or false to only have it play once * @return On success, true is returned. On failure, false is returned */ public static boolean FMUSIC_SetLooping(FMusicModule module, boolean looping) { return nFMUSIC_SetLooping(module.moduleHandle, looping); } private static native boolean nFMUSIC_SetLooping(long module, boolean looping); /** * Sets a songs order position / current playing position. * <p> * <b>Remarks</b> * Note : This function is not supported with the MIDI format. * </p> * @param module Module to have its order changed * @param order Order number to jump to * @return On success, true is returned. On failure, false is returned */ public static boolean FMUSIC_SetOrder(FMusicModule module, int order) { return nFMUSIC_SetOrder(module.moduleHandle, order); } private static native boolean nFMUSIC_SetOrder(long module, int order); /** * Pauses a song * @param module Module to be paused/unpaused * @param pause true - song should be PAUSED, false - song should be UNPAUSED * @return On success, true is returned. On failure, false is returned */ public static boolean FMUSIC_SetPaused(FMusicModule module, boolean pause) { return nFMUSIC_SetPaused(module.moduleHandle, pause); } private static native boolean nFMUSIC_SetPaused(long module, boolean pause); /** * Sets a songs master volume. * @param module Module to have its master volume set * @param volume value from 0-256. 0 = silence, 256 = full volume * @return On success, true is returned. On failure, false is returned */ public static boolean FMUSIC_SetMasterVolume(FMusicModule module, int volume) { return nFMUSIC_SetMasterVolume(module.moduleHandle, volume); } private static native boolean nFMUSIC_SetMasterVolume(long module, int volume); /** * Sets a songs master speed scale, so that the song can be sped up or slowed down. * @param module Module to have its speed scale set * @param speed Speed scale for song. 1.0 is default. Minimum is 0 (stopped), maximum is 10.0 * @return On success, true is returned. On failure, false is returned */ public static boolean FMUSIC_SetMasterSpeed(FMusicModule module, float speed) { return nFMUSIC_SetMasterSpeed(module.moduleHandle, speed); } private static native boolean nFMUSIC_SetMasterSpeed(long module, float speed); /** * Sets the master pan seperation for a module * @param module Module to set pan seperation for * @param pansep The pan scale. 1.0 means full pan seperation, 0 means mono * @return On success, true is returned. On failure, false is returned */ public static boolean FMUSIC_SetPanSeperation(FMusicModule module, float pansep) { return nFMUSIC_SetPanSeperation(module.moduleHandle, pansep); } private static native boolean nFMUSIC_SetPanSeperation(long module, float pansep); /** * Returns the name of the song set by the composer. With MIDI format, the filename is returned * @param module Module to retrieve name from * @return On success, the name of the song is returned. On failure, Null is returned */ public static String FMUSIC_GetName(FMusicModule module) { return nFMUSIC_GetName(module.moduleHandle); } private static native String nFMUSIC_GetName(long module); /** * Returns the format type a song * @param module Module to retrieve type from * @return FMusicType constant, FMUSIC_TYPE_NONE on failure */ public static int FMUSIC_GetType(FMusicModule module) { return nFMUSIC_GetType(module.moduleHandle); } private static native int nFMUSIC_GetType(long module); /** * Returns the number of orders in this song * @param module Module to retrieve number of orders from * @return On success, the number of orders in this song is returned. On failure, 0 is returned */ public static int FMUSIC_GetNumOrders(FMusicModule module) { return nFMUSIC_GetNumOrders(module.moduleHandle); } private static native int nFMUSIC_GetNumOrders(long module); /** * Returns the number of patterns contained in this song. * @param module Module to retrieve number of patterns from * @return On success, the number of patterns contained in this song is returned. On failure, 0 is returned */ public static int FMUSIC_GetNumPatterns(FMusicModule module) { return nFMUSIC_GetNumPatterns(module.moduleHandle); } private static native int nFMUSIC_GetNumPatterns(long module); /** * Returns the number of instruments contained in this song. * @param module Module to retrieve number of instruments from * @return On success, the number of instruments contained in this song is returned. On failure, 0 is returned. */ public static int FMUSIC_GetNumInstruments(FMusicModule module) { return nFMUSIC_GetNumInstruments(module.moduleHandle); } private static native int nFMUSIC_GetNumInstruments(long module); /** * Returns the number of samples contained in this song. * @param module Module to retrieve number of samples * @return Number of samples contained in this song. On failure, 0 is returned. */ public static int FMUSIC_GetNumSamples(FMusicModule module) { return nFMUSIC_GetNumSamples(module.moduleHandle); } private static native int nFMUSIC_GetNumSamples(long module); /** * Returns the number of channels within this songs pattern data * @param module Module to retrieve number of channels from * @return Number of channels within this songs pattern data. On failure, 0 is returned. */ public static int FMUSIC_GetNumChannels(FMusicModule module) { return nFMUSIC_GetNumChannels(module.moduleHandle); } private static native int nFMUSIC_GetNumChannels(long module); /** * Returns a reference to a sample inside a module. * Once you have access to the module's sample, you can do a lot of things * to it, including locking and modifying the data within; using the * FSOUND_Sample_ functionality * <p> * <b>Remarks</b> * Because of the instrument nature of some formats like XM, this * function lists all the samples in order of instruments and their subsamples. * ie if instrument 1 has 2 samples and instrument 2 contains 3 samples, then * sampno in this case would be 0 and 1 for instrument 1's samples, and 2,3 & 4 * for instrument 2's samples. * </p> * @param module Module to retrieve a sample handle from * @param sampno index to sample inside module * @return On success, a valid sample is returned. On failure, Null is returned. */ public static FSoundSample FMUSIC_GetSample(FMusicModule module, int sampno) { long result = nFMUSIC_GetSample(module.moduleHandle, sampno); if(result != 0) { return new FSoundSample(result); } return null; } private static native long nFMUSIC_GetSample(long module, int sampno); /** * Returns the the length in rows of the pattern for the specified order number * @param module Module to get pattern lenght from * @param orderno pattern at specified order * @return On success, the songs pattern length at the specified order is returned. On failure, 0 is returned */ public static int FMUSIC_GetPatternLength(FMusicModule module, int orderno) { return nFMUSIC_GetPatternLength(module.moduleHandle, orderno); } private static native int nFMUSIC_GetPatternLength(long module, int orderno); /** * Returns whether the song has completed playing, or when the last order has finished playing. * This stays set even if the song loops. * @param module Module that you want check if finished or not * @return true if module has finished playing. false if module has not finished playing. */ public static boolean FMUSIC_IsFinished(FMusicModule module) { return nFMUSIC_IsFinished(module.moduleHandle); } private static native boolean nFMUSIC_IsFinished(long module); /** * Returns whether the song is currently playing or not. * @param module Module to retrieve name from * @return true Song is playing. false Song is stopped. */ public static boolean FMUSIC_IsPlaying(FMusicModule module) { return nFMUSIC_IsPlaying(module.moduleHandle); } private static native boolean nFMUSIC_IsPlaying(long module); /** * Returns the song's current master volume * @param module Module to retrieve song master volume from * @return On success, the song's current master volume, from 0 (silence) to 256 (full volume) is returned. On failure, -1 is returned. */ public static int FMUSIC_GetMasterVolume(FMusicModule module) { return nFMUSIC_GetMasterVolume(module.moduleHandle); } private static native int nFMUSIC_GetMasterVolume(long module); /** * Returns the song's current global volume * <p> * <b>Remarks</b> * GLOBAL volume is not the same as MASTER volume. GLOBAL volume is an internal * overall volume which can be altered by the song itself (ie there might be commands * to fade in a particular part of the song by scaling all the volumes in the song * up slowly from nothing). * GLOBAL volume is different to MASTER volume in that the song can modify without * your permission, whereas MASTER volume is an overall scalar that you can control. * For general use, MASTER volume is more useful, but you may want to reset a song's * GLOBAL volume at certain times in the song. (for example the song might have faded * out by using GLOBAL volume and you want to reset it) * </p> * @param module Module to retrieve song global volume from * @return Songs current global volume, from 0 (silence) to the maximum value determined by the music format. Global volume * maximums are different in respect to each format, they range from 64 to 256. On failure, -1 is returned. */ public static int FMUSIC_GetGlobalVolume(FMusicModule module) { return nFMUSIC_GetGlobalVolume(module.moduleHandle); } private static native int nFMUSIC_GetGlobalVolume(long module); /** * Returns the song's current order number * @param module Module to retrieve current order number from * @return On success, the song's current order number is returned.On failure, -1 is returned */ public static int FMUSIC_GetOrder(FMusicModule module) { return nFMUSIC_GetOrder(module.moduleHandle); } private static native int nFMUSIC_GetOrder(long module); /** * Returns the song's current pattern number * @param module Module to retrieve current pattern number from * @return On success, The song's current pattern number is returned. On failure, -1 is returned */ public static int FMUSIC_GetPattern(FMusicModule module) { return nFMUSIC_GetPattern(module.moduleHandle); } private static native int nFMUSIC_GetPattern(long module); /** * Returns the song's current speed. * @param module Module to retrieve current song speed from * @return On success, The song's current speed is returned. On failure, -1 is returned */ public static int FMUSIC_GetSpeed(FMusicModule module) { return nFMUSIC_GetSpeed(module.moduleHandle); } private static native int nFMUSIC_GetSpeed(long module); /** * Returns the song's current BPM. * @param module Module to retrieve current song BPM from * @return On success, song's current BPM is returned. On failure, -1 is returned */ public static int FMUSIC_GetBPM(FMusicModule module) { return nFMUSIC_GetBPM(module.moduleHandle); } private static native int nFMUSIC_GetBPM(long module); /** * Returns the song's current row number * <p> * <b>Remarks</b> * This value is latency adjusted by default, and returns the number you are hearing, not the 'mix-time' value. * Use FSOUND_INIT_DONTLATENCYADJUST if you want the value at mix time, which is useful if you want to control the music interactively, or from a DSP callback. * </p> * @param module Module to retrieve current row from * @return On success, the song's current row number is returned. On failure, -1 is returned */ public static int FMUSIC_GetRow(FMusicModule module) { return nFMUSIC_GetRow(module.moduleHandle); } private static native int nFMUSIC_GetRow(long module); /** * Returns whether song is currently paused or not * @param module Module to get paused flag from * @return On success, true is returned to say the song is currently paused. On failure, false is returned to say the song is NOT currently paused */ public static boolean FMUSIC_GetPaused(FMusicModule module) { return nFMUSIC_GetPaused(module.moduleHandle); } private static native boolean nFMUSIC_GetPaused(long module); /** * Returns the time in milliseconds since the song was started. This is useful for * synchronizing purposes becuase it will be exactly the same every time, and it is * reliably retriggered upon starting the song. Trying to synchronize using other * windows timers can lead to varying results, and inexact performance. This fixes that * problem by actually using the number of samples sent to the soundcard as a reference * <p> * <b>Remarks</b> * This value is latency adjusted by default, and returns the number you are hearing, not the 'mix-time' value. * Use FSOUND_INIT_DONTLATENCYADJUST if you want the value at mix time, which is useful if you want to control the music interactively, or from a DSP callback * </p> * @param module Module to the song to get time from * @return On success, the time played in milliseconds is returned. On failure, -1 is returned */ public static int FMUSIC_GetTime(FMusicModule module) { return nFMUSIC_GetTime(module.moduleHandle); } private static native int nFMUSIC_GetTime(long module); /** * Returns the real FSOUND channel playing based on the mod's FMUSIC channel * <p> * <b>Remarks</b> * Note FMUSIC mod playback only allocates a real channel on a mod channel the first time an instrument is played. * NNA's will not register. This function only returns the primary real channel for the mod channel. * </p> * @param module Module to the song * @param modchannel channel index, to query the real channel from * @return On success, the channel index for the respective mod channel is returned. On failure, -1 is returned */ public static int FMUSIC_GetRealChannel(FMusicModule module, int modchannel) { return nFMUSIC_GetRealChannel(module.moduleHandle, modchannel); } private static native int nFMUSIC_GetRealChannel(long module, int modchannel); /** * Retrieves the data set by FMUSIC_SetUserData * @param module Module to get the open state from * @return On success, userdata set by FMUSIC_SetUserData is returned. On failure, Null is returned. */ public static ByteBuffer FMUSIC_GetUserData(FMusicModule module) { return nFMUSIC_GetUserData(module.moduleHandle); } private static native ByteBuffer nFMUSIC_GetUserData(long module); /** * This is the callback rutine called by the native implementation whenever a * register callback is notified. * * @param handle Handle to native object being monitored * @param param parameter passed to callback */ private static void music_callback(long modulehandle, int param) { // locate out callback and call it back FMOD.WrappedCallback wCallback = (FMOD.WrappedCallback) FMOD.getCallback(FMOD.FSOUND_DSPCALLBACK, modulehandle); FMusicCallback callback = (FMusicCallback) wCallback.callback; callback.FMUSIC_CALLBACK((FMusicModule) wCallback.handled, param); } } --- NEW FILE: FMusicModule.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.fmod; /** * This class is a representation of a Module in FMod. * $Id: FMusicModule.java,v 1.1 2004/05/23 14:03:05 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class FMusicModule { /** Handle to module */ long moduleHandle; /** * Creates a new FMusicModule * * @param moduleHandle */ FMusicModule(long moduleHandle) { this.moduleHandle = moduleHandle; } } --- NEW FILE: FSoundReverbChannelProperties.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.fmod; /** * This class is a representation of a Reverb channel property object in FMod. * $Id: FSoundReverbChannelProperties.java,v 1.1 2004/05/23 14:03:06 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class FSoundReverbChannelProperties { /** Handle to stream */ long reverbHandle; /** * Creates a new FSoundStream * * @param streamHandle handle to stream */ FSoundReverbChannelProperties(long reverbHandle) { this.reverbHandle = reverbHandle; } } --- NEW FILE: FSoundTagField.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.fmod; import java.nio.ByteBuffer; /** * This class defines attributes in a tag field * $Id: FSoundTagField.java,v 1.1 2004/05/23 14:03:06 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class FSoundTagField { /** Name of tagfield */ String name; /** * ByteBuffer that will point to the tagfield data */ ByteBuffer value; /** Length of tagfield data */ int length; /** Type of tagfield */ int type; /** * Creates a new FSoundTagField */ public FSoundTagField(int type, String name) { this.type = type; this.name = name; } /** * Sets the value and length * @param value value of tagfield * @param lenght length of data */ void set(ByteBuffer value, int lenght) { this.value = value; this.length = lenght; } /** * @return Returns the length. */ public int getLength() { return length; } /** * @return Returns the name. */ public String getName() { return name; } /** * @return Returns the type. */ public int getType() { return type; } /** * @return Returns the value. */ public ByteBuffer getValue() { return value; } } --- NEW FILE: FSoundReverbProperties.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.fmod; /** * This class is a representation of a Reverb property object in FMod. * $Id: FSoundReverbProperties.java,v 1.1 2004/05/23 14:03:06 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class FSoundReverbProperties { /** Handle to stream */ long reverbHandle; /** * Creates a new FSoundStream * * @param streamHandle handle to stream */ FSoundReverbProperties(long reverbHandle) { this.reverbHandle = reverbHandle; } } --- NEW FILE: FSoundDSPUnit.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS A... [truncated message content] |
|
From: Brian M. <ma...@us...> - 2004-05-23 14:03:18
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod/callbacks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25022/java/org/lwjgl/fmod/callbacks Added Files: FMusicCallback.java FSoundCloseCallback.java FSoundDSPCallback.java FSoundMetaDataCallback.java FSoundOpenCallback.java FSoundReadCallback.java FSoundSeekCallback.java FSoundStreamCallback.java FSoundTellCallback.java Log Message: fmod support --- NEW FILE: FSoundTellCallback.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.fmod.callbacks; /** * This interface describes a callback interface to Fmod music * $Id: FSoundTellCallback.java,v 1.1 2004/05/23 14:03:07 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public interface FSoundTellCallback { public int FSOUND_TELLCALLBACK(int handle); } --- NEW FILE: FSoundDSPCallback.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.fmod.callbacks; import java.nio.ByteBuffer; /** * This interface describes a callback interface to Fmod music * $Id: FSoundDSPCallback.java,v 1.1 2004/05/23 14:03:07 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public interface FSoundDSPCallback { public void FSOUND_DSPCALLBACK(ByteBuffer originalbuffer, ByteBuffer newbuffer, int length); } --- NEW FILE: FSoundCloseCallback.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.fmod.callbacks; /** * This interface describes a callback interface to Fmod music * $Id: FSoundCloseCallback.java,v 1.1 2004/05/23 14:03:07 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public interface FSoundCloseCallback { public void FSOUND_CLOSECALLBACK(int handle); } --- NEW FILE: FMusicCallback.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.fmod.callbacks; import org.lwjgl.fmod.FMusicModule; /** * This interface describes a callback interface to Fmod music * $Id: FMusicCallback.java,v 1.1 2004/05/23 14:03:07 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public interface FMusicCallback { public void FMUSIC_CALLBACK(FMusicModule module, int param); } --- NEW FILE: FSoundSeekCallback.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.fmod.callbacks; /** * This interface describes a callback interface to Fmod music * $Id: FSoundSeekCallback.java,v 1.1 2004/05/23 14:03:07 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public interface FSoundSeekCallback { public int FSOUND_SEEKCALLBACK(int handle, int pos, int mode); } --- NEW FILE: FSoundMetaDataCallback.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.fmod.callbacks; import java.nio.ByteBuffer; import org.lwjgl.fmod.FSoundStream; /** * This interface describes a callback interface to Fmod music * $Id: FSoundMetaDataCallback.java,v 1.1 2004/05/23 14:03:07 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public interface FSoundMetaDataCallback { public void FSOUND_STREAMCALLBACK(FSoundStream stream, ByteBuffer buff, int len); } --- NEW FILE: FSoundReadCallback.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.fmod.callbacks; import java.nio.ByteBuffer; /** * This interface describes a callback interface to Fmod music * $Id: FSoundReadCallback.java,v 1.1 2004/05/23 14:03:07 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public interface FSoundReadCallback { public int FSOUND_READCALLBACK(ByteBuffer buffer, int size, int handle); } --- NEW FILE: FSoundStreamCallback.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.fmod.callbacks; import java.nio.ByteBuffer; import org.lwjgl.fmod.FSoundStream; /** * This interface describes a callback interface to Fmod music * $Id: FSoundStreamCallback.java,v 1.1 2004/05/23 14:03:07 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public interface FSoundStreamCallback { public void FSOUND_STREAMCALLBACK(FSoundStream stream, ByteBuffer buff, int len); } --- NEW FILE: FSoundOpenCallback.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.fmod.callbacks; /** * This interface describes a callback interface to Fmod music * $Id: FSoundOpenCallback.java,v 1.1 2004/05/23 14:03:07 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public interface FSoundOpenCallback { public int FSOUND_OPENCALLBACK(String name); } |
|
From: Brian M. <ma...@us...> - 2004-05-23 14:03:17
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25022/java/org/lwjgl/test/fmod Added Files: CDDAPlayer.java CDPlayer.java MusicPlayer.java StreamPlayer.java Log Message: fmod support --- NEW FILE: CDDAPlayer.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.test.fmod; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; import org.lwjgl.fmod.FMOD; import org.lwjgl.fmod.FMODException; import org.lwjgl.fmod.FSound; import org.lwjgl.fmod.FSoundStream; /** * $Id: CDDAPlayer.java,v 1.1 2004/05/23 14:03:07 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class CDDAPlayer { public static void main(String[] args) { try { FMOD.create(); } catch (FMODException fmode) { fmode.printStackTrace(); return; } System.out.println("Initializing FMOD"); if (!FSound.FSOUND_Init(44100, 32, 0)) { System.out.println("Failed to initialize FMOD"); return; } boolean running = true; String token = null; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); FSoundStream stream = null; do { System.out.println(FMOD.FMOD_ErrorString(FSound.FSOUND_GetError())); System.out.println("FMOD CD Player test. Press a key corresponding to action"); System.out.println("1: FSOUND_Stream_Open \"<drive>:\""); System.out.println("2: FSOUND_Stream_Open \"<drive>:?\""); System.out.println("3: FSOUND_Stream_Open \"<drive>:!\""); System.out.println("4: FSOUND_Stream_SetSubStream <position>"); System.out.println("5: FSOUND_Stream_GetNumSubStreams"); System.out.println("6: Enumerate tag fields"); System.out.println("0: Exit"); try { StringTokenizer st = new StringTokenizer(br.readLine().trim()); token = st.nextToken(); switch (Integer.parseInt(token)) { case 0: running = false; break; case 1: stream = FSound.FSOUND_Stream_Open(st.nextToken() + ":", FSound.FSOUND_NORMAL, 0, 0); break; case 2: stream = FSound.FSOUND_Stream_Open(st.nextToken() + ":*?", 0, 0, 0); break; case 3: stream = FSound.FSOUND_Stream_Open(st.nextToken() + ":*!", 0, 0, 0); break; case 4: FSound.FSOUND_Stream_SetSubStream(stream, Integer.parseInt(st.nextToken())); break; case 5: System.out.println(FSound.FSOUND_Stream_GetNumSubStreams(stream)); break; case 6: // break; default: System.out.println("No entry"); } System.out.println("Stream: " + stream); } catch (Exception e) { } } while (running); if(stream != null) { FSound.FSOUND_Stream_Close(stream); } FSound.FSOUND_Close(); FMOD.destroy(); } } --- NEW FILE: StreamPlayer.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.test.fmod; import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import org.lwjgl.fmod.FMOD; import org.lwjgl.fmod.FMODException; import org.lwjgl.fmod.FSound; import org.lwjgl.fmod.FSoundStream; /** * $Id: StreamPlayer.java,v 1.1 2004/05/23 14:03:07 matzon Exp $ <br> * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class StreamPlayer { public static void main(String[] args) { if (args.length < 1) { System.out.println("Usage:\n StreamPlayer <file>"); return; } File file = new File(args[0]); if (!file.exists()) { System.out.println("No such file: " + args[0]); return; } try { FMOD.create(); } catch (FMODException fmode) { fmode.printStackTrace(); return; } System.out.println("Initializing FMOD"); if (!FSound.FSOUND_Init(44100, 32, 0)) { System.out.println("Failed to initialize FMOD"); System.out.println("Error: " + FMOD.FMOD_ErrorString(FSound.FSOUND_GetError())); return; } System.out.println("Loading " + args[0]); FSoundStream stream = FSound.FSOUND_Stream_Open(args[0], FSound.FSOUND_NORMAL, 0, 0); if (stream != null) { FSound.FSOUND_Stream_Play(0, stream); System.out.println("Press enter to stop playing"); try { System.in.read(); } catch (IOException ioe) { } System.out.println("Done playing. Cleaning up"); FSound.FSOUND_Stream_Stop(stream); FSound.FSOUND_Stream_Close(stream); } else { System.out.println("Unable to play: " + args[0]); System.out.println("Error: " + FMOD.FMOD_ErrorString(FSound.FSOUND_GetError())); } FSound.FSOUND_Close(); FMOD.destroy(); } /** * Reads the file into a ByteBuffer * * @param filename * Name of file to load * @return ByteBuffer containing file data */ static protected ByteBuffer getData(String filename) { ByteBuffer buffer = null; System.out.println("Attempting to load: " + filename); try { BufferedInputStream bis = new BufferedInputStream(StreamPlayer.class.getClassLoader().getResourceAsStream(filename)); ByteArrayOutputStream baos = new ByteArrayOutputStream(); int bufferLength = 4096; byte[] readBuffer = new byte[bufferLength]; int read = -1; while ((read = bis.read(readBuffer, 0, bufferLength)) != -1) { baos.write(readBuffer, 0, read); } //done reading, close bis.close(); // if ogg vorbis data, we need to pass it unmodified to alBufferData buffer = ByteBuffer.allocateDirect(baos.size()); buffer.order(ByteOrder.nativeOrder()); buffer.put(baos.toByteArray()); buffer.flip(); System.out.println("loaded " + buffer.remaining() + " bytes"); } catch (Exception ioe) { ioe.printStackTrace(); } return buffer; } /** * Creates a ByteBuffer buffer to hold specified bytes - strictly a utility * method * * @param size * how many bytes to contain * @return created ByteBuffer */ protected static ByteBuffer createByteBuffer(int size) { ByteBuffer temp = ByteBuffer.allocateDirect(4 * size); temp.order(ByteOrder.nativeOrder()); return temp; } } --- NEW FILE: MusicPlayer.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.test.fmod; import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import org.lwjgl.fmod.*; /** * $Id: MusicPlayer.java,v 1.1 2004/05/23 14:03:07 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class MusicPlayer { public static void main(String[] args) { if(args.length < 1) { System.out.println("Usage:\n MusicPlayer <file>"); return; } File file = new File(args[0]); if (!file.exists()) { System.out.println("No such file: " + args[0]); return; } try { FMOD.create(); } catch (FMODException fmode) { fmode.printStackTrace(); return; } System.out.println("Initializing FMOD"); if(!FSound.FSOUND_Init(44100, 32, 0)) { System.out.println("Failed to initialize FMOD"); return; } System.out.println("Loading " + args[0]); FMusicModule module = FMusic.FMUSIC_LoadSong(args[0]); //ByteBuffer buffer = ByteBuffer.allocateDirect(11).order(ByteOrder.nativeOrder()); //buffer.put("razorbck.it".getBytes()); //buffer.flip(); //FMusicModule module = FMusic.FMUSIC_LoadSongEx(getData(args[0]), 0, 0, 0, null); //FMusicModule module = FMusic.FMUSIC_LoadSongEx(buffer, 0, 0, 0, null); if(module != null) { System.out.println("Loaded. Playing module of type: " + FMusic.FMUSIC_GetType(module)); FMusic.FMUSIC_PlaySong(module); System.out.println("Press enter to stop playing"); try { System.in.read(); } catch (IOException ioe) { } FMusic.FMUSIC_StopSong(module); System.out.println("Done playing. Cleaning up"); FMusic.FMUSIC_FreeSong(module); } else { System.out.println("Unable to play: " + args[0]); } FSound.FSOUND_Close(); FMOD.destroy(); } /** * Reads the file into a ByteBuffer * * @param filename Name of file to load * @return ByteBuffer containing file data */ static protected ByteBuffer getData(String filename) { ByteBuffer buffer = null; System.out.println("Attempting to load: " + filename); try { BufferedInputStream bis = new BufferedInputStream(MusicPlayer.class.getClassLoader().getResourceAsStream(filename)); ByteArrayOutputStream baos = new ByteArrayOutputStream(); int bufferLength = 4096; byte[] readBuffer = new byte[bufferLength]; int read = -1; while((read = bis.read(readBuffer, 0, bufferLength)) != -1) { baos.write(readBuffer, 0, read); } //done reading, close bis.close(); // if ogg vorbis data, we need to pass it unmodified to alBufferData buffer = ByteBuffer.allocateDirect(baos.size()); buffer.order(ByteOrder.nativeOrder()); buffer.put(baos.toByteArray()); buffer.flip(); System.out.println("loaded " + buffer.remaining() + " bytes"); } catch (Exception ioe) { ioe.printStackTrace(); } return buffer; } } --- NEW FILE: CDPlayer.java --- /* * Copyright (c) 2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.test.fmod; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; import org.lwjgl.fmod.FMOD; import org.lwjgl.fmod.FMODException; import org.lwjgl.fmod.FSound; /** * $Id: CDPlayer.java,v 1.1 2004/05/23 14:03:07 matzon Exp $ * <br> * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class CDPlayer { public static void main(String[] args) { try { FMOD.create(); } catch (FMODException fmode) { fmode.printStackTrace(); return; } System.out.println("Initializing FMOD"); if (!FSound.FSOUND_Init(44100, 32, 0)) { System.out.println("Failed to initialize FMOD"); return; } boolean running = true; String token = null; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); do { System.out.println("FMOD CD Player test. Press a key corresponding to action"); System.out.println("1: FSOUND_CD_Eject <drive>"); System.out.println("2: FSOUND_CD_Play <drive> <track>"); System.out.println("3: FSOUND_CD_Stop <drive>"); System.out.println("4: FSOUND_CD_GetNumTracks <drive>"); System.out.println("5: FSOUND_CD_GetPaused <drive>"); System.out.println("6: FSOUND_CD_GetTrack <drive>"); System.out.println("7: FSOUND_CD_GetTrackLength <drive> <track>"); System.out.println("8: FSOUND_CD_GetTrackTime <drive>"); System.out.println("9: FSOUND_CD_SetPaused <drive>"); System.out.println("10: FSOUND_CD_SetPlayMode <drive> <mode>"); System.out.println("11: FSOUND_CD_SetTrackTime <drive> <milliseconds>"); System.out.println("12: FSOUND_CD_SetVolume <drive> <volume>"); System.out.println("0: Exit"); try { StringTokenizer st = new StringTokenizer(br.readLine().trim()); token = st.nextToken(); switch (Integer.parseInt(token)) { case 0: running = false; break; case 1: FSound.FSOUND_CD_Eject(st.nextToken().charAt(0)); break; case 2: FSound.FSOUND_CD_Play(st.nextToken().charAt(0), Integer.parseInt(st.nextToken())); break; case 3: FSound.FSOUND_CD_Stop(st.nextToken().charAt(0)); break; case 4: System.out.println(FSound.FSOUND_CD_GetNumTracks(st.nextToken().charAt(0))); break; case 5: System.out.println(FSound.FSOUND_CD_GetPaused(st.nextToken().charAt(0))); break; case 6: System.out.println(FSound.FSOUND_CD_GetTrack(st.nextToken().charAt(0))); break; case 7: System.out.println(FSound.FSOUND_CD_GetTrackLength(st.nextToken().charAt(0), Integer.parseInt(st.nextToken()))); break; case 8: System.out.println(FSound.FSOUND_CD_GetTrackTime(st.nextToken().charAt(0))); break; case 9: FSound.FSOUND_CD_SetPaused(st.nextToken().charAt(0), Boolean.valueOf(st.nextToken()).booleanValue()); break; case 10: FSound.FSOUND_CD_SetPlayMode(st.nextToken().charAt(0), Integer.parseInt(st.nextToken())); break; case 11: FSound.FSOUND_CD_SetTrackTime(st.nextToken().charAt(0), Integer.parseInt(st.nextToken())); break; case 12: FSound.FSOUND_CD_SetVolume(st.nextToken().charAt(0), Integer.parseInt(st.nextToken())); break; default: System.out.println("No entry"); } } catch (Exception e) { } } while (running); FSound.FSOUND_Close(); FMOD.destroy(); } } |
|
From: Brian M. <ma...@us...> - 2004-05-23 13:55:08
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23628 Modified Files: org_lwjgl_Display.cpp Log Message: only get driver once Index: org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Display.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- org_lwjgl_Display.cpp 10 May 2004 08:55:09 -0000 1.63 +++ org_lwjgl_Display.cpp 23 May 2004 13:54:55 -0000 1.64 @@ -47,10 +47,12 @@ static jobjectArray GetAvailableDisplayModesEx(JNIEnv * env); static jobjectArray GetAvailableDisplayModes(JNIEnv * env); +static char * getDriver(); bool modeSet = false; // Whether we've done a display mode change WORD* originalGamma = new WORD[256 * 3]; // Original gamma settings WORD* currentGamma = new WORD[256 * 3]; // Current gamma settings DEVMODE devmode; // Now we'll remember this value for the future +char * driver = getDriver(); /* * Class: org_lwjgl_Display @@ -485,7 +487,6 @@ { jstring ret = NULL; - char * driver = getDriver(); if (driver == NULL) { return NULL; } @@ -508,7 +509,6 @@ TCHAR driverDLL[256] = "\0"; - char * driver = getDriver(); if (driver == NULL) { return NULL; } |
|
From: Brian M. <ma...@us...> - 2004-05-23 13:52:57
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23189/fmod Log Message: Directory /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod added to the repository |
|
From: Brian M. <ma...@us...> - 2004-05-23 13:52:00
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod/callbacks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22998/callbacks Log Message: Directory /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod/callbacks added to the repository |
|
From: Brian M. <ma...@us...> - 2004-05-23 13:51:45
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22938/fmod Log Message: Directory /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod added to the repository |
|
From: Brian M. <ma...@us...> - 2004-05-23 13:51:11
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/fmod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22797/fmod Log Message: Directory /cvsroot/java-game-lib/LWJGL/src/native/common/fmod added to the repository |
|
From: Brian M. <ma...@us...> - 2004-05-23 13:50:21
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22662 Modified Files: common_tools.cpp common_tools.h Log Message: fmod support Index: common_tools.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- common_tools.cpp 9 Apr 2004 21:52:41 -0000 1.18 +++ common_tools.cpp 23 May 2004 13:50:08 -0000 1.19 @@ -117,6 +117,10 @@ throwGeneralException(env, "org/lwjgl/openal/OpenALException", err); } +void throwFMODException(JNIEnv * env, const char * err) { + throwGeneralException(env, "org/lwjgl/fmod/FMODException", err); +} + void throwException(JNIEnv * env, const char * err) { throwGeneralException(env, "org/lwjgl/LWJGLException", err); } Index: common_tools.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- common_tools.h 27 Mar 2004 14:09:54 -0000 1.14 +++ common_tools.h 23 May 2004 13:50:08 -0000 1.15 @@ -62,6 +62,7 @@ //extern int getEventBufferSize(event_queue_t *event_queue); extern void throwException(JNIEnv *env, const char *msg); extern void throwOpenALException(JNIEnv * env, const char * err); +extern void throwFMODException(JNIEnv * env, const char * err); extern void setDebugEnabled(bool enable); extern void printfDebug(const char *format, ...); extern bool getBooleanProperty(JNIEnv *env, const char* propertyName); |
|
From: Brian M. <ma...@us...> - 2004-05-23 13:49:38
|
Update of /cvsroot/java-game-lib/LWJGL/platform_build/win32_vs_net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22478 Modified Files: lwjgl.sln lwjgl.vcproj lwjgl.suo Added Files: lwjgl-fmod.vcproj Log Message: fmod included Index: lwjgl.vcproj =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/platform_build/win32_vs_net/lwjgl.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- lwjgl.vcproj 26 Feb 2004 22:12:25 -0000 1.3 +++ lwjgl.vcproj 23 May 2004 13:49:26 -0000 1.4 @@ -99,7 +99,8 @@ AdditionalDependencies="dinput.lib dxguid.lib OpenAL32.lib alut.lib eaxguid.lib OpenGL32.Lib Version.lib" OutputFile="..\..\libs\win32\lwjgl.dll" LinkIncremental="1" - AdditionalLibraryDirectories=""C:\Program Files\Creative Labs\OpenAL 1.0 SDK\libs";"C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\prerelease";"C:\Program Files\Creative Labs\EAX 2.0 Extensions SDK\Libs"" + AdditionalLibraryDirectories=""C:\Program Files\Creative Labs\OpenAL 1.0 SDK\libs";"C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\prerelease";"C:\Program Files\Creative Labs\EAX 2.0 Extensions SDK\Libs";"C:\Program Files\fmodapi372win\api\lib"" + IgnoreAllDefaultLibraries="FALSE" GenerateDebugInformation="FALSE" SubSystem="2" OptimizeReferences="2" @@ -208,6 +209,9 @@ RelativePath="..\..\src\native\win32\org_lwjgl_opengl_Pbuffer.cpp"> </File> <File + RelativePath="..\..\src\native\win32\org_lwjgl_opengl_SWTCanvas.cpp"> + </File> + <File RelativePath="..\..\src\native\win32\org_lwjgl_opengl_Window.cpp"> </File> <File @@ -221,6 +225,9 @@ Name="arb" Filter=""> <File + RelativePath="..\..\src\native\common\arb\org_lwjgl_opengl_ARBBufferObject.cpp"> + </File> + <File RelativePath="..\..\src\native\common\arb\org_lwjgl_opengl_ARBImaging.cpp"> </File> <File @@ -254,9 +261,6 @@ RelativePath="..\..\src\native\common\arb\org_lwjgl_opengl_ARBVertexBlend.cpp"> </File> <File - RelativePath="..\..\src\native\common\arb\org_lwjgl_opengl_ARBVertexBufferObject.cpp"> - </File> - <File RelativePath="..\..\src\native\common\arb\org_lwjgl_opengl_ARBVertexProgram.cpp"> </File> <File @@ -310,6 +314,9 @@ RelativePath="..\..\src\native\common\ext\org_lwjgl_opengl_EXTCompiledVertexArray.cpp"> </File> <File + RelativePath="..\..\src\native\common\ext\org_lwjgl_opengl_EXTDepthBoundsTest.cpp"> + </File> + <File RelativePath="..\..\src\native\common\ext\org_lwjgl_opengl_EXTDrawRangeElements.cpp"> </File> <File --- NEW FILE: lwjgl-fmod.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.10" Name="lwjgl-fmod" ProjectGUID="{E70435A1-9D52-4ECD-8839-C4FF5C23270E}" Keyword="Win32Proj"> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="Debug" IntermediateDirectory="Debug" ConfigurationType="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""C:\Program Files\fmodapi372win\api\inc";C:\Java\j2sdk1.5.0\include;C:\Java\j2sdk1.5.0\include\win32" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="5" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" OutputFile="$(OutDir)/lwjgl-fmod.exe" LinkIncremental="2" GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/lwjgl-fmod.pdb" SubSystem="1" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="Release" IntermediateDirectory="Release" ConfigurationType="2" CharacterSet="2"> <Tool Name="VCCLCompilerTool" GlobalOptimizations="TRUE" FavorSizeOrSpeed="1" AdditionalIncludeDirectories=""C:\Program Files\fmodapi372win\api\inc";C:\Java\j2sdk1.5.0\include;C:\Java\j2sdk1.5.0\include\win32" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" ExceptionHandling="FALSE" RuntimeLibrary="4" UsePrecompiledHeader="0" WarningLevel="0" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLinkerTool" IgnoreImportLibrary="TRUE" OutputFile="..\..\libs\win32\lwjgl-fmod.dll" LinkIncremental="1" GenerateDebugInformation="FALSE" OptimizeReferences="2" EnableCOMDATFolding="2" ImportLibrary="" TargetMachine="1"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCWebDeploymentTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> <File RelativePath="..\..\src\native\common\common_tools.cpp"> </File> <File RelativePath="..\..\src\native\common\fmod\extfmod.cpp"> </File> <File RelativePath="..\..\src\native\common\fmod\org_lwjgl_fmod_FMOD.cpp"> </File> <File RelativePath="..\..\src\native\common\fmod\org_lwjgl_fmod_FMusic.cpp"> </File> <File RelativePath="..\..\src\native\common\fmod\org_lwjgl_fmod_FSound.cpp"> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> </Filter> </Files> <Globals> </Globals> </VisualStudioProject> Index: lwjgl.sln =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/platform_build/win32_vs_net/lwjgl.sln,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- lwjgl.sln 31 Jan 2004 12:34:20 -0000 1.1 +++ lwjgl.sln 23 May 2004 13:49:26 -0000 1.2 @@ -3,6 +3,10 @@ ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lwjgl-fmod", "lwjgl-fmod.vcproj", "{E70435A1-9D52-4ECD-8839-C4FF5C23270E}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug @@ -13,6 +17,10 @@ {F94B1F23-4B6C-4AC6-9C90-E37CBA7F0E62}.Debug.Build.0 = Debug|Win32 {F94B1F23-4B6C-4AC6-9C90-E37CBA7F0E62}.Release.ActiveCfg = Release|Win32 {F94B1F23-4B6C-4AC6-9C90-E37CBA7F0E62}.Release.Build.0 = Release|Win32 + {E70435A1-9D52-4ECD-8839-C4FF5C23270E}.Debug.ActiveCfg = Debug|Win32 + {E70435A1-9D52-4ECD-8839-C4FF5C23270E}.Debug.Build.0 = Debug|Win32 + {E70435A1-9D52-4ECD-8839-C4FF5C23270E}.Release.ActiveCfg = Release|Win32 + {E70435A1-9D52-4ECD-8839-C4FF5C23270E}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection Index: lwjgl.suo =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/platform_build/win32_vs_net/lwjgl.suo,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvsA6FDoU and /tmp/cvsZSJTIA differ |
|
From: Brian M. <ma...@us...> - 2004-05-23 13:49:14
|
Update of /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22414 Added Files: build-fmod.bat build.bat Log Message: command line compilation --- NEW FILE: build-fmod.bat --- @echo off set JAVAHOME=C:\Java\j2sdk1.5.0 set FMODHOME="C:\Program Files\fmodapi372win\api\inc" set COPTIONS=/I%FMODHOME% /I%JAVAHOME%\include /I%JAVAHOME%\include\win32 /I..\..\src\native\common /O2 /nologo /c set LINKEROPTS=/link set LIBS=user32.lib Gdi32.lib Advapi32.lib for %%x in (..\..\src\native\common\fmod\*.cpp) do cl %COPTIONS% %%x for %%x in (..\..\src\native\common\*common*.cpp) do cl %COPTIONS% %%x cl /LD /Felwjgl-fmod.dll *.obj %LINKEROPTS% %LIBS% --- NEW FILE: build.bat --- @echo off set JAVAHOME=C:\Java\j2sdk1.5.0 set ALHOME="c:\Program Files\OpenAL 1.0 Software Development Kit" set EAXHOME="c:\Program Files\Creative Labs\EAX 2.0 Extensions SDK" set DXHOME=C:\DXSDK set COPTIONS=/I%DXHOME%\Include /I%JAVAHOME%\include /I%JAVAHOME%\include\win32 /I%ALHOME%\Include /I%EAXHOME%\Include /I..\..\src\native\common /O2 /nologo /c set LINKEROPTS=/link /LIBPATH:%ALHOME%\libs /LIBPATH:%EAXHOME%\Libs /LIBPATH:%DXHOME%\Lib set LIBS=dinput.lib dxguid.lib OpenAL32.lib alut.lib eaxguid.lib OpenGL32.Lib Version.lib user32.lib Gdi32.lib Advapi32.lib for %%x in (..\..\src\native\win32\*.cpp) do cl %COPTIONS% %%x for %%x in (..\..\src\native\common\*.cpp) do cl %COPTIONS% %%x for %%x in (..\..\src\native\common\arb\*.cpp) do cl %COPTIONS% %%x for %%x in (..\..\src\native\common\nv\*.cpp) do cl %COPTIONS% %%x for %%x in (..\..\src\native\common\ext\*.cpp) do cl %COPTIONS% %%x for %%x in (..\..\src\native\common\ati\*.cpp) do cl %COPTIONS% %%x cl /LD /Felwjgl.dll *.obj %LINKEROPTS% %LIBS% |
|
From: Brian M. <ma...@us...> - 2004-05-23 13:47:53
|
Update of /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22116/win32_ms_cmdline Log Message: Directory /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline added to the repository |
|
From: Ioannis T. <sp...@us...> - 2004-05-19 16:47:09
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12974 Modified Files: extgl.h Log Message: Cleanup Index: extgl.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.h,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- extgl.h 18 May 2004 20:55:57 -0000 1.37 +++ extgl.h 19 May 2004 16:46:59 -0000 1.38 @@ -394,1400 +394,8 @@ #endif /* _AGL */ -#define GL_VERSION_1_1 1 -#define GL_ACCUM 0x0100 -#define GL_LOAD 0x0101 -#define GL_RETURN 0x0102 -#define GL_MULT 0x0103 -#define GL_ADD 0x0104 -#define GL_NEVER 0x0200 -#define GL_LESS 0x0201 [...1467 lines suppressed...] - -#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 -#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 -#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 -#define WGL_NO_TEXTURE_ARB 0x2077 -#define WGL_DEPTH_COMPONENT_NV 0x20A7 - -/*-------------------------------------------------------------------*/ -/*------------WGL_NV_RENDER_TEXTURE_RECTANGLE-----------------------*/ -/*-------------------------------------------------------------------*/ - -#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 -#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 - -/*-------------------------------------------------------------------*/ /*------------END WGL EXTENSIONS-------------------------------------*/ /*-------------------------------------------------------------------*/ |
|
From: Ioannis T. <sp...@us...> - 2004-05-18 21:03:09
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9446 Modified Files: GL.java GLImpl.java IGL.java Log Message: Added some new extensions Index: GLImpl.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/GLImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- GLImpl.java 19 Apr 2004 23:01:32 -0000 1.1 +++ GLImpl.java 18 May 2004 21:02:55 -0000 1.2 @@ -32,31 +32,25 @@ package org.lwjgl.util; -import java.nio.Buffer; -import java.nio.ByteBuffer; -import java.nio.DoubleBuffer; -import java.nio.FloatBuffer; -import java.nio.IntBuffer; -import java.nio.ShortBuffer; +import java.nio.*; [...6394 lines suppressed...] * @param x * @param y @@ -5839,6 +6081,7 @@ public void glWindowPos3sARB(short x, short y, short z) { GL.glWindowPos3sARB(x, y, z); } + /** * @param res * @param in @@ -5847,8 +6090,7 @@ * @param outZ * @param outW */ - public void glWriteMaskEXT(int res, int in, int outX, int outY, - int outZ, int outW) { + public void glWriteMaskEXT(int res, int in, int outX, int outY, int outZ, int outW) { GL.glWriteMaskEXT(res, in, outX, outY, outZ, outW); } } Index: GL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/GL.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- GL.java 19 Apr 2004 22:24:30 -0000 1.2 +++ GL.java 18 May 2004 21:02:55 -0000 1.3 @@ -32,32 +32,26 @@ package org.lwjgl.util; -import java.nio.Buffer; -import java.nio.ByteBuffer; -import java.nio.DoubleBuffer; -import java.nio.FloatBuffer; -import java.nio.IntBuffer; -import java.nio.ShortBuffer; - import org.lwjgl.opengl.*; [...6435 lines suppressed...] - public static void glVertexWeightPointerEXT(int size, int stride, - FloatBuffer pPointer) { + public static void glVertexWeightPointerEXT(int size, int stride, FloatBuffer pPointer) { EXTVertexWeighting.glVertexWeightPointerEXT(size, stride, pPointer); } + /** * @param size * @param type * @param stride * @param buffer_offset */ - public static void glVertexWeightPointerEXT(int size, int type, int stride, - int buffer_offset) { - EXTVertexWeighting.glVertexWeightPointerEXT(size, type, stride, - buffer_offset); + public static void glVertexWeightPointerEXT(int size, int type, int stride, int buffer_offset) { + EXTVertexWeighting.glVertexWeightPointerEXT(size, type, stride, buffer_offset); } } Index: IGL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/IGL.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- IGL.java 19 Apr 2004 23:01:33 -0000 1.1 +++ IGL.java 18 May 2004 21:02:55 -0000 1.2 @@ -1,12 +1,12 @@ -/* +/* * Copyright (c) 2003 Shaven Puppy Ltd * 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: - * [...5545 lines suppressed...] */ - public void glVertexWeightPointerEXT(int size, int stride, - FloatBuffer pPointer); + void glVertexWeightPointerEXT(int size, int stride, FloatBuffer pPointer); /** * @param size @@ -5229,10 +4924,7 @@ * @param stride * @param buffer_offset */ - public void glVertexWeightPointerEXT(int size, int type, int stride, - int buffer_offset); - - + void glVertexWeightPointerEXT(int size, int type, int stride, int buffer_offset); } \ No newline at end of file |
|
From: Ioannis T. <sp...@us...> - 2004-05-18 21:00:45
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9252 Modified Files: GLContext.java Added Files: EXTBlendEquationSeparate.java EXTTextureMirrorClamp.java NVFragmentProgram2.java NVVertexProgram2Option.java NVVertexProgram3.java Log Message: Added some new extensions --- NEW FILE: EXTTextureMirrorClamp.java --- /* * Copyright (c) 2002 Lightweight 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. */ /* * Created by LWJGL. * User: spasi * Date: 18 Ìáú 2004 * Time: 10:22:39 ìì */ package org.lwjgl.opengl; public final class EXTTextureMirrorClamp { /* * Accepted by the <param> parameter of TexParameteri and TexParameterf, * and by the <params> parameter of TexParameteriv and TexParameterfv, * when their <pname> parameter is TEXTURE_WRAP_S, TEXTURE_WRAP_T, * or TEXTURE_WRAP_R: */ public static final int GL_MIRROR_CLAMP_EXT = 0x8742; public static final int GL_MIRROR_CLAMP_TO_EDGE_EXT = 0x8743; public static final int GL_MIRROR_CLAMP_TO_BORDER_EXT = 0x8912; } --- NEW FILE: EXTBlendEquationSeparate.java --- /* * Copyright (c) 2002 Lightweight 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. */ /* * Created by LWJGL. * User: spasi * Date: 04-05-18 * Time: 9:39:43 pm */ package org.lwjgl.opengl; public final class EXTBlendEquationSeparate { /* * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, * GetFloatv, and GetDoublev: */ public static final int GL_BLEND_EQUATION_RGB_EXT = 0x8009; public static final int GL_BLEND_EQUATION_ALPHA_EXT = 0x883D; public static native void glBlendEquationSeparateEXT(int modeRGB, int modeAlpha); } --- NEW FILE: NVVertexProgram3.java --- /* * Copyright (c) 2002 Lightweight 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. */ /* * Created by LWJGL. * User: spasi * Date: 18 Ìáú 2004 * Time: 10:29:43 ìì */ package org.lwjgl.opengl; public final class NVVertexProgram3 { /* * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv, * GetFloatv, and GetDoublev: */ public static final int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = 0x8B4C; } Index: GLContext.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLContext.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- GLContext.java 29 Mar 2004 16:44:36 -0000 1.9 +++ GLContext.java 18 May 2004 21:00:34 -0000 1.10 @@ -91,6 +91,7 @@ public static boolean GL_EXT_abgr; public static boolean GL_EXT_bgra; + public static boolean GL_EXT_blend_equation_separate; public static boolean GL_EXT_blend_func_separate; public static boolean GL_EXT_blend_subtract; public static boolean GL_EXT_Cg_shader; @@ -114,6 +115,7 @@ public static boolean GL_EXT_texture_env_dot3; public static boolean GL_EXT_texture_filter_anisotropic; public static boolean GL_EXT_texture_lod_bias; + public static boolean GL_EXT_texture_mirror_clamp; public static boolean GL_EXT_texture_rectangle; public static boolean GL_EXT_vertex_shader; public static boolean GL_EXT_vertex_weighting; @@ -139,6 +141,7 @@ public static boolean GL_NV_float_buffer; public static boolean GL_NV_fog_distance; public static boolean GL_NV_fragment_program; + public static boolean GL_NV_fragment_program2; public static boolean GL_NV_fragment_program_option; public static boolean GL_NV_half_float; public static boolean GL_NV_light_max_exponent; @@ -164,6 +167,7 @@ public static boolean GL_NV_vertex_program1_1; public static boolean GL_NV_vertex_program2; public static boolean GL_NV_vertex_program2_option; + public static boolean GL_NV_vertex_program3; public static boolean OpenGL11; public static boolean OpenGL12; --- NEW FILE: NVVertexProgram2Option.java --- /* * Copyright (c) 2002 Lightweight 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. */ /* * Created by LWJGL. * User: spasi * Date: 18 Ìáú 2004 * Time: 10:28:18 ìì */ package org.lwjgl.opengl; public final class NVVertexProgram2Option { /* * Accepted by the <pname> parameter of GetProgramivARB: */ public static final int GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV = 0x88F4; public static final int GL_MAX_PROGRAM_CALL_DEPTH_NV = 0x88F5; } --- NEW FILE: NVFragmentProgram2.java --- /* * Copyright (c) 2002 Lightweight 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. */ /* * Created by LWJGL. * User: spasi * Date: 18 Ìáú 2004 * Time: 10:25:56 ìì */ package org.lwjgl.opengl; public final class NVFragmentProgram2 { /* * Accepted by the <pname> parameter of GetProgramivARB: */ public static final int GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV = 0x88F4; public static final int GL_MAX_PROGRAM_CALL_DEPTH_NV = 0x88F5; public static final int GL_MAX_PROGRAM_IF_DEPTH_NV = 0x88F6; public static final int GL_MAX_PROGRAM_LOOP_DEPTH_NV = 0x88F7; public static final int GL_MAX_PROGRAM_LOOP_COUNT_NV = 0x88F8; } |
|
From: Ioannis T. <sp...@us...> - 2004-05-18 20:57:52
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/ext In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8550 Modified Files: Makefile.am Added Files: org_lwjgl_opengl_EXTBlendEquationSeparate.cpp Log Message: Added some new extensions --- NEW FILE: org_lwjgl_opengl_EXTBlendEquationSeparate.cpp --- /* * Copyright (c) 2002 Lightweight 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. */ // ---------------------------------- // IMPLEMENTATION OF NATIVE METHODS FOR CLASS: org.lwjgl.opengl.EXTBlendEquationSeparate // ---------------------------------- #include "extgl.h" typedef void (APIENTRY * glBlendEquationSeparateEXTPROC) (GLenum modeRGB, GLenum modeAlpha); static glBlendEquationSeparateEXTPROC glBlendEquationSeparateEXT; /* * Class: org.lwjgl.opengl.EXTBlendEquationSeparate * Method: glBlendEquationSeparateEXT */ static void JNICALL Java_org_lwjgl_opengl_EXTBlendEquationSeparate_glBlendEquationSeparateEXT (JNIEnv * env, jclass clazz, jint modeRGB, jint modeAlpha) { glBlendEquationSeparateEXT(modeRGB, modeAlpha); } void extgl_InitEXTBlendEquationSeparate(JNIEnv *env, jobject ext_set) { JavaMethodAndExtFunction functions[] = { {"glBlendEquationSeparateEXT", "(II)V", (void*)&Java_org_lwjgl_opengl_EXTBlendEquationSeparate_glBlendEquationSeparateEXT, "glBlendEquationSeparateEXT", (void**)&glBlendEquationSeparateEXT} }; int num_functions = NUMFUNCTIONS(functions); jclass clazz = ext_ResetClass(env, "org/lwjgl/opengl/EXTBlendEquationSeparate"); if (extgl_Extensions.GL_EXT_blend_equation_separate) extgl_InitializeClass(env, clazz, ext_set, "GL_EXT_blend_equation_separate", num_functions, functions); } Index: Makefile.am =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/ext/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 29 Mar 2004 16:55:26 -0000 1.3 +++ Makefile.am 18 May 2004 20:57:35 -0000 1.4 @@ -2,7 +2,8 @@ libext_la_SOURCES = $(SRC) INCLUDES=-I.. -SRC=org_lwjgl_opengl_EXTBlendFuncSeparate.cpp \ +SRC=org_lwjgl_opengl_EXTBlendEquationSeparate.cpp \ + org_lwjgl_opengl_EXTBlendFuncSeparate.cpp \ org_lwjgl_opengl_EXTCompiledVertexArray.cpp \ org_lwjgl_opengl_EXTDepthBoundsTest.cpp \ org_lwjgl_opengl_EXTDrawRangeElements.cpp \ |
|
From: Ioannis T. <sp...@us...> - 2004-05-18 20:56:25
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8052 Modified Files: extgl.cpp extgl.h Log Message: Added some new extensions Index: extgl.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- extgl.cpp 29 Mar 2004 16:47:53 -0000 1.35 +++ extgl.cpp 18 May 2004 20:55:56 -0000 1.36 @@ -578,6 +578,7 @@ extgl_Extensions.GL_EXT_abgr = GLQueryExtension(env, ext_set, "GL_EXT_abgr"); extgl_Extensions.GL_EXT_bgra = GLQueryExtension(env, ext_set, "GL_EXT_bgra"); + extgl_Extensions.GL_EXT_blend_equation_separate = GLQueryExtension(env, ext_set, "GL_EXT_blend_equation_separate"); extgl_Extensions.GL_EXT_blend_func_separate = GLQueryExtension(env, ext_set, "GL_EXT_blend_func_separate"); extgl_Extensions.GL_EXT_blend_subtract = GLQueryExtension(env, ext_set, "GL_EXT_blend_subtract"); extgl_Extensions.GL_EXT_Cg_shader = GLQueryExtension(env, ext_set, "GL_EXT_Cg_shader"); @@ -671,6 +672,7 @@ extern void extgl_InitARBVertexShader(JNIEnv *env, jobject ext_set); extern void extgl_InitARBWindowPos(JNIEnv *env, jobject ext_set); +extern void extgl_InitEXTBlendEquationSeparate(JNIEnv *env, jobject ext_set); extern void extgl_InitEXTBlendFuncSeparate(JNIEnv *env, jobject ext_set); extern void extgl_InitEXTCompiledVertexArray(JNIEnv *env, jobject ext_set); extern void extgl_InitEXTDepthBoundsTest(JNIEnv *env, jobject ext_set); @@ -742,6 +744,7 @@ extgl_InitARBVertexShader(env, ext_set); extgl_InitARBWindowPos(env, ext_set); + extgl_InitEXTBlendEquationSeparate(env, ext_set); extgl_InitEXTBlendFuncSeparate(env, ext_set); extgl_InitEXTCompiledVertexArray(env, ext_set); extgl_InitEXTDepthBoundsTest(env, ext_set); Index: extgl.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- extgl.h 29 Mar 2004 16:47:53 -0000 1.36 +++ extgl.h 18 May 2004 20:55:57 -0000 1.37 @@ -2086,6 +2086,7 @@ bool GL_EXT_abgr; bool GL_EXT_bgra; + bool GL_EXT_blend_equation_separate; bool GL_EXT_blend_func_separate; bool GL_EXT_blend_subtract; bool GL_EXT_Cg_shader; |
|
From: Brian M. <ma...@us...> - 2004-05-14 18:47:25
|
Update of /cvsroot/java-game-lib/LWJGL/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3709 Modified Files: download.php Log Message: new build Index: download.php =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/www/download.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- download.php 13 Apr 2004 20:07:06 -0000 1.3 +++ download.php 14 May 2004 18:47:14 -0000 1.4 @@ -14,7 +14,8 @@ </p> <p> Random Win32 CVS builds are provided here: <i>Please note that these builds may be more buggy than an official release, but will typically contain the newest features.</i><br> - <a href="http://matzon.dk/brian/lwjgl/builds/lwjgl-2004-03-31.rar" target="">lwjgl-2004-03-31.rar</a><br> + <a href="http://matzon.dk/brian/lwjgl/builds/lwjgl-2004-05-14.zip">lwjgl-2004-05-14.zip</a> <i>swt enabled!</i><br> + <a href="http://matzon.dk/brian/lwjgl/builds/lwjgl-2004-05-14-swt.zip">lwjgl-2004-05-14-swt.zip</a> <i>swt enabled! (includes swt support files)</i><br> </p> <p> Latest CVS tarball. Please download it here:<br> |
|
From: Brian M. <ma...@us...> - 2004-05-14 17:20:34
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15259/org/lwjgl/util Modified Files: Color.java Display.java Point.java Rectangle.java Timer.java WritableRectangle.java Log Message: javadoc fixes Index: Point.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/Point.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Point.java 21 Apr 2004 18:10:55 -0000 1.1 +++ Point.java 14 May 2004 17:20:17 -0000 1.2 @@ -87,7 +87,8 @@ /** * Translate a point. - * @param x, y The translation to apply + * @param dx The translation to apply + * @param dy The translation to apply */ public void translate(int dx, int dy) { this.x += dx; Index: Timer.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/Timer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Timer.java 21 Apr 2004 19:46:04 -0000 1.1 +++ Timer.java 14 May 2004 17:20:17 -0000 1.2 @@ -97,7 +97,7 @@ /** * Reset the timer. Equivalent to set(0.0f); - * @see #set() + * @see #set(float) */ public void reset() { set(0.0f); Index: Color.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/Color.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Color.java 30 Apr 2004 08:17:25 -0000 1.3 +++ Color.java 14 May 2004 17:20:17 -0000 1.4 @@ -447,8 +447,8 @@ * RGB to HSB conversion, pinched from java.awt.Color. * The HSB value is returned in dest[] if dest[] is supplied. * Values range from 0..1 - * @param dest[] Destination floats, or null - * @return dest[], or a new float[] + * @param dest Destination floats, or null + * @return dest, or a new float array */ public float[] toHSB(float dest[]) { int r = getRed(); Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/Display.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Display.java 21 Apr 2004 18:10:56 -0000 1.1 +++ Display.java 14 May 2004 17:20:17 -0000 1.2 @@ -122,14 +122,12 @@ * and an array with the order in which you would like them sorted in descending order. * This method attempts to create the topmost display mode; if that fails, it will try the next one, * and so on, until there are no modes left. If no mode is set at the end, an exception is thrown. - * @param dm[] a list of display modes to choose from - * @param param[] the names of the DisplayMode fields in the order in which you would like them sorted. - * @param fullscreen whether to go fullscreen - * @param title The app title + * @param dm a list of display modes to choose from + * @param param the names of the DisplayMode fields in the order in which you would like them sorted. * @return the chosen display mode * @throws NoSuchFieldException if one of the params is not a field in DisplayMode * @throws Exception if no display mode could be set - * @see org.lwjgj.DisplayMode + * @see org.lwjgl.DisplayMode */ public static DisplayMode setDisplayMode(DisplayMode[] dm, final String[] param) throws Exception { Index: Rectangle.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/Rectangle.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Rectangle.java 21 Apr 2004 18:11:00 -0000 1.1 +++ Rectangle.java 14 May 2004 17:20:17 -0000 1.2 @@ -145,7 +145,8 @@ /** * Translate the rectangle by an amount. - * @param x, y The translation amount + * @param x The translation amount on the x axis + * @param y The translation amount on the y axis */ public void translate(int x, int y) { this.x += x; @@ -187,7 +188,8 @@ * Checks whether or not this <code>Rectangle</code> contains the * point at the specified location * (<i>x</i>, <i>y</i>). - * @param X, Y the specified coordinates + * @param X the specified x coordinate + * @param Y the specified y coordinate * @return <code>true</code> if the point * (<i>x</i>, <i>y</i>) is inside this * <code>Rectangle</code>; @@ -229,7 +231,8 @@ * the <code>Rectangle</code> * at the specified location (<i>X</i>, <i>Y</i>) with the * specified dimensions (<i>W</i>, <i>H</i>). - * @param X, Y the specified coordinates + * @param X the specified x coordinate + * @param Y the specified y coordinate * @param W the width of the <code>Rectangle</code> * @param H the height of the <code>Rectangle</code> * @return <code>true</code> if the <code>Rectangle</code> specified by @@ -393,7 +396,8 @@ * falls on the right or bottom edge of the enlarged * <code>Rectangle</code>, <code>contains</code> returns * <code>false</code> for that point. - * @param newx, newy the coordinates of the new point + * @param newx the x coordinates of the new point + * @param newy the y coordinates of the new point */ public void add(int newx, int newy) { int x1 = Math.min(x, newx); Index: WritableRectangle.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/WritableRectangle.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- WritableRectangle.java 21 Apr 2004 18:11:00 -0000 1.1 +++ WritableRectangle.java 14 May 2004 17:20:17 -0000 1.2 @@ -41,7 +41,10 @@ /** * Sets the bounds of the rectangle - * @param x, y, width, height + * @param x Position of rectangle on x axis + * @param y Position of rectangle on y axis + * @param width Width of rectangle + * @param height Height of rectangle */ public void setBounds(int x, int y, int width, int height); |
|
From: Brian M. <ma...@us...> - 2004-05-14 17:20:34
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/vector In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15259/org/lwjgl/util/vector Modified Files: WritableVector2f.java WritableVector3f.java WritableVector4f.java Log Message: javadoc fixes Index: WritableVector2f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/vector/WritableVector2f.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- WritableVector2f.java 19 Apr 2004 21:54:58 -0000 1.1 +++ WritableVector2f.java 14 May 2004 17:20:17 -0000 1.2 @@ -54,7 +54,8 @@ /** * Set the X,Y values - * @param x, y + * @param x + * @param y */ public void set(float x, float y); Index: WritableVector3f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/vector/WritableVector3f.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- WritableVector3f.java 19 Apr 2004 21:54:58 -0000 1.1 +++ WritableVector3f.java 14 May 2004 17:20:17 -0000 1.2 @@ -48,7 +48,9 @@ /** * Set the X,Y,Z values - * @param x, y, z + * @param x + * @param y + * @param z */ public void set(float x, float y, float z); Index: WritableVector4f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/vector/WritableVector4f.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- WritableVector4f.java 19 Apr 2004 21:54:58 -0000 1.1 +++ WritableVector4f.java 14 May 2004 17:20:17 -0000 1.2 @@ -48,7 +48,10 @@ /** * Set the X,Y,Z,W values - * @param x, y, z, w + * @param x + * @param y + * @param z + * @param w */ public void set(float x, float y, float z, float w); |
|
From: Brian M. <ma...@us...> - 2004-05-14 17:20:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15259/org/lwjgl/input Modified Files: Controller.java Log Message: javadoc fixes Index: Controller.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Controller.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- Controller.java 29 Apr 2004 16:21:37 -0000 1.18 +++ Controller.java 14 May 2004 17:20:16 -0000 1.19 @@ -213,7 +213,7 @@ * * @param button The index of the button you wish to test (0..buttonCount-1) * @return true if the specified button is down - * @see #buttonCount + * @see #getButtonCount() */ public static boolean isButtonDown(int button) { if (!created) |
|
From: Elias N. <eli...@us...> - 2004-05-14 12:52:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20740/win32 Modified Files: org_lwjgl_opengl_Window.cpp Log Message: Potential fix for the titlebar issue on win2k Index: org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- org_lwjgl_opengl_Window.cpp 5 May 2004 14:28:37 -0000 1.31 +++ org_lwjgl_opengl_Window.cpp 14 May 2004 12:52:39 -0000 1.32 @@ -394,7 +394,7 @@ return false; } - hdc = GetWindowDC(hwnd); + hdc = GetDC(hwnd); return true; } |
|
From: Elias N. <eli...@us...> - 2004-05-11 20:35:01
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv796/linux Modified Files: Window.h org_lwjgl_opengl_Pbuffer.cpp org_lwjgl_opengl_Window.cpp Log Message: Linux: Implemented proper X async error handling Index: org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- org_lwjgl_opengl_Window.cpp 10 May 2004 21:50:54 -0000 1.44 +++ org_lwjgl_opengl_Window.cpp 11 May 2004 20:34:47 -0000 1.45 @@ -54,6 +54,7 @@ #include "org_lwjgl_opengl_Window.h" #define USEGLX13 extgl_Extensions.GLX13 +#define ERR_MSG_SIZE 1024 static GLXContext context = NULL; // OpenGL rendering context static GLXWindow glx_window; @@ -79,6 +80,28 @@ static Display *display_connection = NULL; static Atom warp_atom; static int display_connection_usage = 0; +static bool async_x_error; +static char error_message[ERR_MSG_SIZE]; + +bool checkXError(JNIEnv *env) { + XSync(getDisplay(), False); + if (async_x_error) { + async_x_error = false; + throwException(env, error_message); + return false; + } else + return true; +} + +static int errorHandler(Display *disp, XErrorEvent *error) { + char err_msg_buffer[ERR_MSG_SIZE]; + XGetErrorText(disp, error->error_code, err_msg_buffer, ERR_MSG_SIZE); + err_msg_buffer[ERR_MSG_SIZE - 1] = '\0'; + snprintf(error_message, ERR_MSG_SIZE, "X Error - serial: %d, error_code: %s, request_code: %d, minor_code: %d", (int)error->serial, err_msg_buffer, (int)error->request_code, (int)error->minor_code); + error_message[ERR_MSG_SIZE - 1] = '\0'; + async_x_error = true; + return 0; +} Display *getDisplay(void) { return display_connection; @@ -86,6 +109,8 @@ Display *incDisplay(JNIEnv *env) { if (display_connection_usage == 0) { + async_x_error = false; + XSetErrorHandler(errorHandler); display_connection = XOpenDisplay(NULL); if (display_connection == NULL) { throwException(env, "Could not open X display"); @@ -236,7 +261,12 @@ env->ReleaseStringUTFChars(title_obj, title); } -static void createWindow(JNIEnv* env, int screen, XVisualInfo *vis_info, jstring title, int x, int y, int width, int height, bool fullscreen, bool undecorated) { +static void destroyWindow() { + XDestroyWindow(getDisplay(), current_win); + XFreeColormap(getDisplay(), cmap); +} + +static bool createWindow(JNIEnv* env, int screen, XVisualInfo *vis_info, jstring title, int x, int y, int width, int height, bool fullscreen, bool undecorated) { dirty = true; focused = true; minimized = false; @@ -266,6 +296,10 @@ attribs.override_redirect = True; } win = XCreateWindow(getDisplay(), root_win, x, y, width, height, 0, vis_info->depth, InputOutput, vis_info->visual, attribmask, &attribs); + if (!checkXError(env)) { + XFreeColormap(getDisplay(), cmap); + return false; + } printfDebug("Created window\n"); current_win = win; Java_org_lwjgl_opengl_Window_nSetTitle(env, NULL, title); @@ -283,12 +317,11 @@ waitMapped(win); XClearWindow(getDisplay(), win); setRepeatMode(AutoRepeatModeOff); - XSync(getDisplay(), True); -} - -static void destroyWindow() { - XDestroyWindow(getDisplay(), current_win); - XFreeColormap(getDisplay(), cmap); + if (!checkXError(env)) { + destroyWindow(); + return false; + } + return true; } int getCurrentScreen(void) { @@ -470,13 +503,23 @@ throwException(env, "Could not create visual info from FB config"); return false; } - createWindow(env, screen, vis_info, title, x, y, width, height, fscreen, undecorated); + bool window_created = createWindow(env, screen, vis_info, title, x, y, width, height, fscreen, undecorated); + XFree(vis_info); + if (!window_created) { + glXDestroyContext(getDisplay(), context); + XFree(configs); + return false; + } glx_window = glXCreateWindow(getDisplay(), configs[0], getCurrentWindow(), NULL); makeCurrent(); if (isDebugEnabled()) dumpVisualInfo(vis_info); XFree(configs); - XFree(vis_info); + if (!checkXError(env)) { + glXDestroyWindow(getDisplay(), glx_window); + glXDestroyContext(getDisplay(), context); + return false; + } return true; } @@ -501,9 +544,18 @@ throwException(env, "Could not create a direct GLX context"); return false; } - createWindow(env, screen, vis_info, title, x, y, width, height, fscreen, undecorated); - makeCurrent(); + bool window_created = createWindow(env, screen, vis_info, title, x, y, width, height, fscreen, undecorated); XFree(vis_info); + if (!window_created) { + glXDestroyContext(getDisplay(), context); + return false; + } + makeCurrent(); + if (!checkXError(env)) { + glXDestroyContext(getDisplay(), context); + destroyWindow(); + return false; + } return true; } Index: Window.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Window.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Window.h 13 Apr 2004 12:13:32 -0000 1.11 +++ Window.h 11 May 2004 20:34:47 -0000 1.12 @@ -56,6 +56,8 @@ extern void resetCursor(int x, int y); + extern bool checkXError(JNIEnv *env); + extern Atom getWarpAtom(void); /* Index: org_lwjgl_opengl_Pbuffer.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- org_lwjgl_opengl_Pbuffer.cpp 7 Apr 2004 07:46:03 -0000 1.13 +++ org_lwjgl_opengl_Pbuffer.cpp 11 May 2004 20:34:47 -0000 1.14 @@ -74,6 +74,15 @@ return extgl_Extensions.GLX13 ? org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED : 0; } +static void destroyPbuffer(PbufferInfo *buffer_info) { + GLXPbuffer buffer = buffer_info->buffer; + GLXContext context = buffer_info->context; + glXDestroyPbuffer(getDisplay(), buffer); + glXDestroyContext(getDisplay(), context); + free(buffer_info); + decDisplay(); +} + /* * Class: org_lwjgl_opengl_Pbuffer * Method: nCreate @@ -131,14 +140,14 @@ if (context == NULL) { XFree(configs); throwException(env, "Could not create a GLX context"); - return false; + return -1; } jboolean allow_software_acceleration = getBooleanProperty(env, "org.lwjgl.opengl.Window.allowSoftwareOpenGL"); if (!allow_software_acceleration && glXIsDirect(disp, context) == False) { glXDestroyContext(disp, context); XFree(configs); throwException(env, "Could not create a direct GLX context"); - return false; + return -1; } const int buffer_attribs[] = {GLX_PBUFFER_WIDTH, width, GLX_PBUFFER_HEIGHT, height, @@ -150,6 +159,10 @@ PbufferInfo *buffer_info = (PbufferInfo *)malloc(sizeof(PbufferInfo)); buffer_info->buffer = buffer; buffer_info->context = context; + if (!checkXError(env)) { + destroyPbuffer(buffer_info); + return -1; + } return (jint)buffer_info; } @@ -178,12 +191,7 @@ (JNIEnv *env, jclass clazz, jint handle) { PbufferInfo *buffer_info = (PbufferInfo *)handle; - GLXPbuffer buffer = buffer_info->buffer; - GLXContext context = buffer_info->context; - glXDestroyPbuffer(getDisplay(), buffer); - glXDestroyContext(getDisplay(), context); - free(buffer_info); - decDisplay(); + destroyPbuffer(buffer_info); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nSetAttrib |