diff options
author | kbr <[email protected]> | 2005-12-22 08:01:04 +0000 |
---|---|---|
committer | kbr <[email protected]> | 2005-12-22 08:01:04 +0000 |
commit | 7d4baa0cff089699b7e17c71a2609d5f1b58c969 (patch) | |
tree | 11b99dad5f256b5ad50b3b406e274a8d1fb3ee1e /make | |
parent | db347e8cb651a73b7609fbf98eefd1b0c8efc6c6 (diff) |
Revived gluegen-branch-1-0 branch of JOAL source tree, which was a
never-productized port of the JOAL workspace using GlueGen to
autogenerate its code. Brought branch up to current version of GlueGen
and OpenAL 1.1 headers. Changed code generation style to use
call-through-function-pointer nearly everywhere; resulted in
significant refactoring of GlueGen's GLEmitter into generic
ProcAddressEmitter, checked in separately. Worked around bug in
current OpenAL implementation where alGetProcAddress doesn't work
properly for core routines; uses dlsym or similar for function lookup.
Revised build.xml to use cpptasks as in JOGL. Cleaned up API to match
JOGL's more closely; renamed OpenALException to ALException and made
it a RuntimeException, cleaned up ALFactory and ALut, deleted
Sound3DException in favor of ALException, moved JOALVersion to
util/Version, etc. Added BufferUtils from GlueGen workspace (really
need shared project used among all Java Games APIs). Revised ALut,
WAVLoader and demos; demos will be checked in later (no Developer
rights yet on joal-demos workspace).
git-svn-id: file:///home/mbien/NetBeansProjects/JOGAMP/joal-sync/git-svn/../svn-server-sync/joal/branches/gluegen-branch-1-0@96 03bf7f67-59de-4072-a415-9a990d468a3f
Diffstat (limited to 'make')
-rwxr-xr-x | make/build.xml | 700 | ||||
-rwxr-xr-x | make/joal-CustomCCode.c | 40 | ||||
-rwxr-xr-x | make/joal-alc-constants.cfg | 4 | ||||
-rwxr-xr-x | make/joal-alc.cfg | 28 | ||||
-rwxr-xr-x | make/joal-common-CustomCCode.c | 9 | ||||
-rwxr-xr-x | make/joal-common.cfg | 2 | ||||
-rwxr-xr-x | make/joal.cfg | 41 | ||||
-rwxr-xr-x | make/joal.properties | 27 | ||||
-rwxr-xr-x | make/stub_includes/openal/al.h | 890 | ||||
-rwxr-xr-x | make/stub_includes/openal/alc.h | 309 | ||||
-rwxr-xr-x | make/stub_includes/openal/alctypes.h | 125 | ||||
-rwxr-xr-x | make/stub_includes/openal/altypes.h | 332 | ||||
-rwxr-xr-x | make/stub_includes/openal/alu.h | 34 | ||||
-rwxr-xr-x | make/stub_includes/openal/alut.h | 70 | ||||
-rw-r--r-- | make/stub_includes/openal/eax.h | 2 |
15 files changed, 1315 insertions, 1298 deletions
diff --git a/make/build.xml b/make/build.xml index 3d2eea3..1649856 100755 --- a/make/build.xml +++ b/make/build.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - - Ant build for JOAL. This build has been tested with ANT 1.5.3. The + - Ant build for JOAL. This build has been tested with ANT 1.6.2. The - optional.jar that contains the optional ANT tasks must be in the ANT - classpath (typically the ant/lib directory). - @@ -31,12 +31,6 @@ - win32.mingw: build everything (jar, DSOs) for the current platform - clean: clean all built - javadoc: create the standard developer Javadoc - - javadoc.dev.win32: - - javadoc.dev.x11: - - javadoc.dev.macosx: create the internal developer Javadoc. This includes the - - Java and C file generators. Note that it is only supported - - to create the Javadoc for the platform on which you are - - currently running. - - Optional properties: - -Djoal.cg=1 when combined with the build or javadoc targets will cause @@ -84,22 +78,33 @@ <condition property="isWindows"> <os family="windows" /> </condition> + <condition property="isFreeBSD"> + <os name="FreeBSD" /> + </condition> + <condition property="isLinuxAMD64"> + <and> + <istrue value="${isLinux}" /> + <os arch="AMD64" /> + </and> + </condition> + <condition property="isIA64"> + <os arch="IA64" /> + </condition> + <echo message="OS X=${isOSX}" /> + <echo message="Windows=${isWindows}" /> + <echo message="Unix=${isUnix}" /> + <echo message="Linux=${isLinux}" /> + <echo message="Solaris=${isSolaris}" /> + <echo message="FreeBSD=${isFreeBSD}" /> + <echo message="LinuxAMD64=${isLinuxAMD64}" /> + <echo message="IA64=${isIA64}" /> </target> <!-- ================================================================== --> <!-- - Load user properties which override build defaults. --> - <target name="load.user.properties.nonmacosx" depends="base.init" unless="isOSX"> - <!-- Load the user specified properties file that defines various host - - specific paths. The user will be notified if this is does not - - exist. --> - <property name="user.properties.file" value="${user.home}/joal.properties" /> - <property file="${user.properties.file}" /> - <echo message="Loaded ${user.properties.file}." /> - <echo message="antlr.jar=${antlr.jar}" /> - </target> - <target name="load.user.properties.macosx" depends="base.init" if="isOSX"> + <target name="load.user.properties" depends="base.init"> <!-- Load the user specified properties file that defines various host - specific paths. The user will be notified if this is does not - exist. --> @@ -107,10 +112,29 @@ <property file="${user.properties.file}" /> <echo message="Loaded ${user.properties.file}." /> <echo message="antlr.jar=${antlr.jar}" /> - </target> - <target name="load.user.properties" depends="load.user.properties.nonmacosx,load.user.properties.macosx"> - <fail message="antlr.jar was not specified in joal.properties. Please see README.txt for instructions" unless="antlr.jar"/> - <fail message="joal.lib.dir was not specified in joal.properties. Please see README.txt for instructions" unless="joal.lib.dir"/> + <fail message="antlr.jar was not specified in joal.properties. Please see README.txt for instructions" unless="antlr.jar"/> + <fail message="joal.lib.dir was not specified in joal.properties. Please see README.txt for instructions" unless="joal.lib.dir"/> + <condition property="isVC6"> + <and> + <istrue value="${isWindows}" /> + <equals arg1="${win32.c.compiler}" arg2="vc6" /> + </and> + </condition> + <condition property="isVC7"> + <and> + <istrue value="${isWindows}" /> + <equals arg1="${win32.c.compiler}" arg2="vc7" /> + </and> + </condition> + <condition property="isMingw"> + <and> + <istrue value="${isWindows}" /> + <equals arg1="${win32.c.compiler}" arg2="mingw" /> + </and> + </condition> + <echo message="VC6=${isVC6}" /> + <echo message="VC7=${isVC7}" /> + <echo message="MingW=${isMingw}" /> </target> <!-- ================================================================== --> @@ -143,8 +167,8 @@ This build.xml expects that GlueGen has already been built and that its classes are in the build/classes subdirectory of this other workspace. Currently we expect that it is contained in the JOGL project. --> - <property name="gluegen.root" value="../../jogl" /> - <property name="gluegen.classes" value="${gluegen.root}/build/classes" /> + <property name="jogl.root" value="../../jogl" /> + <property name="gluegen.classes" value="${jogl.root}/build/classes" /> <!-- Names of directories relative to the project root. Some of these are used in FileMappers later for dependence information @@ -195,11 +219,6 @@ <property name="java.includes.dir.solaris" value="${java.includes.dir}/solaris" /> <property name="java.includes.dir.macosx" value="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Headers" /> - <!-- Java files to exclude based on platform (relative to "src") --> - <property name="java.excludes.win32" value="net/java/games/joal/impl/x11/**, net/java/games/joal/impl/macosx/**" /> - <property name="java.excludes.x11" value="net/java/games/joal/impl/windows/**, net/java/games/joal/impl/macosx/**" /> - <property name="java.excludes.macosx" value="net/java/games/joal/impl/x11/**, net/java/games/joal/impl/windows/**" /> - <!-- Create the classpath that includes ANTLR and any already - compiled classes. This requires the user-defined "antlr.jar" - property. --> @@ -218,10 +237,7 @@ <property name="javadoc.dev" value="${project.root}/javadoc_joal_dev" /> <property name="javadoc.link" value="http://java.sun.com/j2se/1.4.2/docs/api/" /> <property name="javadoc.packagenames" value="net.java.games.joal,net.java.games.joal.util" /> - <property name="javadoc.dev.packagenames.win32" value="net.java.games.joal.impl.windows" /> - <property name="javadoc.dev.packagenames.x11" value="net.java.games.joal.impl.x11" /> - <property name="javadoc.dev.packagenames.macosx" value="net.java.games.joal.impl.macosx" /> - <property name="javadoc.dev.packagenames" value="net.java.games.joal,net.java.games.joal.impl,net.java.games.joal.util" /> + <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},net.java.games.joal.impl" /> <!-- Names of configuration files used during glue code generation. --> <property name="joal.cfg" value="${config}/joal.cfg" /> @@ -234,164 +250,82 @@ <!-- - Platform specific declares. --> - <target name="declare.win32.pre" depends="init" if="isWindows"> - <!-- Set platform directories. --> - <property name="stub.includes.platform" value="${stub.includes}/win32" /> - <property name="java.includes.dir.platform" value="${java.includes.dir.win32}" /> - <property name="java.lib.dir.platform" value="${java.lib.dir.win32}" /> - <property name="java.excludes.platform" value="${java.excludes.win32}" /> - - <!-- Set Javadoc properties. --> - <property name="javadoc.dev.packagenames.platform" value="${javadoc.dev.packagenames.win32}" /> - - <!-- Choose the C compiler being used. --> - <condition property="isMingw"> - <equals arg1="${win32.c.compiler}" arg2="mingw" /> - </condition> - <condition property="isVC6"> - <equals arg1="${win32.c.compiler}" arg2="vc6" /> - </condition> - <condition property="isVC7"> - <equals arg1="${win32.c.compiler}" arg2="vc7" /> - </condition> - </target> - - <target name="declare.win32.vc.common"> - <property name="c.compiler" value="cl.exe" /> - <property name="c.compiler.flags" value="${c.compiler.optflags} /nologo /TC /c" /> - <property name="c.compiler.obj.suffix" value="obj" /> - <property name="c.compiler.joal.outputfile.expr" value="/Fo${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <property name="c.compiler.includes" value="/I"make/stub_includes/openal" /I"${rootrel.src.c}" /I"${c.compiler.include.root}/PlatformSDK/Include" /I"${c.compiler.include.root}/include" /I"${java.includes.dir}" /I"${java.includes.dir.platform}"" /> - <property name="c.linker" value="link.exe" /> - <property name="c.linker.flags" value="/DLL /LIBPATH:"${c.linker.lib.root}/PlatformSDK/lib" /LIBPATH:"${c.linker.lib.root}/lib" /LIBPATH:"${java.lib.dir.platform}" /LIBPATH:"${joal.lib.dir}" /INCREMENTAL:NO /NOLOGO /MACHINE:IX86 /OPT:REF /OPT:ICF /SUBSYSTEM:WINDOWS" /> - <property name="c.linker.joal.libs" value="openal32.lib" /> - <property name="rootrel.c.linker.joal.dso" value="${rootrel.obj}/joal.dll" /> - <property name="c.linker.joal.dso" value="${project.root}/${rootrel.c.linker.joal.dso}" /> - <property name="c.linker.joal.flags" value="/OUT:"${c.linker.joal.dso}"" /> + <target name="declare.win32.vc6" if="isVC6"> + <echo message="Win32.VC6" /> + <property name="c.compiler.include.root" value="${vc6.root}" /> + <property name="c.linker.lib.root" value="${vc6.root}" /> + <property name="compiler.cfg.id" value="compiler.cfg.win32.msvc" /> + <property name="linker.cfg.id" value="linker.cfg.win32.msvc" /> </target> + + <target name="declare.win32.vc7" if="isVC7"> + <echo message="Win32.VC7" /> + <property name="c.compiler.include.root" value="${vc7.root}" /> + <property name="c.linker.lib.root" value="${vc7.root}" /> - <target name="declare.win32.vc6.debug" if="debug"> - <!-- FIXME: put in debug flags --> - <property name="c.compiler.optflags" value="/MD /W3 /O2 /Ob1 /GF /Gy" /> + <property name="compiler.cfg.id" value="compiler.cfg.win32.msvc" /> + <property name="linker.cfg.id" value="linker.cfg.win32.msvc" /> </target> - <target name="declare.win32.vc6.optimized" unless="debug"> - <property name="c.compiler.optflags" value="/MD /W3 /O2 /Ob1 /GF /Gy" /> + + <target name="declare.win32.mingw" if="isMingw"> + <echo message="Win32.MingW" /> + <property name="compiler.cfg.id" value="compiler.cfg.win32.mingw" /> + <property name="linker.cfg.id" value="linker.cfg.win32.mingw" /> </target> - <target name="declare.win32.vc6.pre" depends="declare.win32.pre,declare.win32.vc6.debug,declare.win32.vc6.optimized"> - <property name="c.compiler.include.root" value="${vc6.root}" /> - <property name="c.linker.lib.root" value="${vc6.root}" /> + <target name="declare.win32" depends="declare.win32.vc6,declare.win32.vc7,declare.win32.mingw" if="isWindows"> + <property name="java.includes.dir.platform" value="${java.includes.dir.win32}" /> + <property name="java.lib.dir.platform" value="${java.lib.dir.win32}" /> </target> - <target name="declare.win32.vc6" depends="declare.win32.vc6.pre, declare.win32.vc.common" if="isVC6" /> - - <target name="declare.win32.vc7.debug" if="debug"> - <property name="c.compiler.optflags" value="/MDd /Yd /GS /RTCs /RTCu /RTCc /W3 /Od /GF /EHsc /Zi /GS /Gy /Wp64 /Zi /D "_DEBUG"" /> - </target> - <target name="declare.win32.vc7.optimized" unless="debug"> - <property name="c.compiler.optflags" value="/MD /W3 /O2 /Ob1 /GF /EHsc /GS /Gy /Wp64 /D "NDEBUG"" /> - </target> + <target name="declare.linux.x86" if="isLinux" unless="isLinuxAMD64"> + <echo message="Linux.x86" /> + <property name="java.includes.dir.platform" value="${java.includes.dir.linux}" /> + <property name="java.lib.dir.platform" value="${java.lib.dir.linux}" /> - <target name="declare.win32.vc7.pre" depends="declare.win32.pre,declare.win32.vc7.debug,declare.win32.vc7.optimized"> - <property name="c.compiler.include.root" value="${vc7.root}" /> - <property name="c.linker.lib.root" value="${vc7.root}" /> + <property name="compiler.cfg.id" value="compiler.cfg.linux" /> + <property name="linker.cfg.id" value="linker.cfg.linux" /> </target> + + <target name="declare.linux.amd64" if="isLinuxAMD64"> + <echo message="Linux.AMD64" /> + <property name="java.includes.dir.platform" value="${java.includes.dir.linux}" /> + <property name="java.lib.dir.platform" value="${java.lib.dir.linux.amd64}" /> - <target name="declare.win32.vc7" depends="declare.win32.vc7.pre, declare.win32.vc.common" if="isVC7" /> - - <target name="declare.win32.mingw" depends="declare.win32.pre" if="isMingw" > - <property name="c.compiler" value="gcc.exe" /> - <property name="c.compiler.optflags" value="-O3" /> - <property name="c.compiler.flags" value="${c.compiler.optflags} -c -DBUILD_DLL -D_WINGDI_ -D_STRICT_ANSI -D_JNI_IMPLEMENTATION_ -o" /> - <property name="c.compiler.obj.suffix" value="o" /> - <property name="c.compiler.joal.outputfile.expr" value="${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <property name="c.compiler.includes" value="-I"make/stub_includes/openal" -I"${rootrel.src.c}" -I"${java.includes.dir}" -I"${java.includes.dir.platform}"" /> - <property name="c.linker" value="gcc.exe" /> - <property name="c.linker.flags" value="-shared" /> - <property name="c.linker.joal.libs" value="-Wl,--kill-at -L"${java.lib.dir.platform}" -L"${joal.lib.dir}" -lopenal32" /> - <property name="rootrel.c.linker.joal.dso" value="${rootrel.obj}/joal.dll" /> - <property name="c.linker.joal.dso" value="${project.root}/${rootrel.c.linker.joal.dso}" /> - <property name="c.linker.joal.flags" value="-o ${c.linker.joal.dso}" /> + <property name="compiler.cfg.id" value="compiler.cfg.linux.amd64" /> + <property name="linker.cfg.id" value="linker.cfg.linux.amd64" /> </target> - <target name="declare.win32" depends="declare.win32.pre,declare.win32.vc6,declare.win32.vc7,declare.win32.mingw" /> + <target name="declare.linux" depends="declare.linux.x86,declare.linux.amd64" if="isLinux" /> - <target name="declare.x11" depends="init"> - <!-- Set platform directories. --> - <property name="stub.includes.platform" value="${stub.includes.x11}" /> - <property name="java.excludes.platform" value="${java.excludes.x11}" /> + <target name="declare.solaris" if="isSolaris"> + <echo message="Solaris" /> + <property name="java.includes.dir.platform" value="${java.includes.dir.solaris}" /> + <property name="java.lib.dir.platform" value="${java.lib.dir.solaris}" /> - <!-- Set Javadoc properties. --> - <property name="javadoc.dev.packagenames.platform" value="${javadoc.dev.packagenames.x11}" /> + <property name="compiler.cfg.id" value="compiler.cfg.solaris" /> + <property name="linker.cfg.id" value="linker.cfg.solaris" /> </target> - <target name="declare.linux" depends="declare.x11" if="isLinux"> - <property name="java.includes.dir.platform" value="${java.includes.dir.linux}" /> - <property name="java.lib.dir.platform" value="${java.lib.dir.linux}" /> - - <!-- Set up gcc --> - <property name="c.compiler" value="gcc" /> - <property name="c.compiler.optflags" value="-O2" /> - <property name="c.compiler.flags" value="${c.compiler.optflags} -c -o" /> - <property name="c.compiler.obj.suffix" value="o" /> - <property name="c.compiler.joal.outputfile.expr" value="${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <property name="c.compiler.includes" value="-I"make/stub_includes/openal" -I"${rootrel.src.c}" -I"${java.includes.dir}" -I"${java.includes.dir.platform}"" /> - <property name="c.linker" value="gcc" /> - <property name="c.linker.flags" value="-shared" /> - <property name="c.linker.joal.libs" value="-L"${java.lib.dir.platform}" -L"${joal.lib.dir}" -lopenal" /> - <property name="rootrel.c.linker.joal.dso" value="${rootrel.obj}/libjoal.so" /> - <property name="c.linker.joal.dso" value="${project.root}/${rootrel.c.linker.joal.dso}" /> - <property name="c.linker.joal.flags" value="-o ${c.linker.joal.dso}" /> - </target> + <target name="declare.macosx" if="isOSX"> + <echo message="MacOSX" /> + <property name="java.includes.dir.platform" value="${java.includes.dir.macosx}" /> + <property name="java.lib.dir.platform" value="${java.lib.dir.macosx}" /> - <target name="declare.solaris" depends="declare.x11" if="isSolaris"> - <property name="java.includes.dir.platform" value="${java.includes.dir.solaris}" /> - <property name="java.lib.dir.platform" value="${java.lib.dir.solaris}" /> - - <!-- Set up Solaris CC --> - <property name="c.compiler" value="cc" /> - <property name="c.compiler.optflags" value="-xO0 -KPIC" /> - <property name="c.compiler.flags" value="${c.compiler.optflags} -c -o" /> - <property name="c.compiler.obj.suffix" value="o" /> - <property name="c.compiler.joal.outputfile.expr" value="${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <property name="c.compiler.includes" value="-I"make/stub_includes/openal" -I"${rootrel.src.c}" -I"${java.includes.dir}" -I"${java.includes.dir.platform}"" /> - <property name="c.linker" value="cc" /> - <property name="c.linker.flags" value="-G" /> - <property name="c.linker.joal.libs" value="-L"${java.lib.dir.platform}" -L"${joal.lib.dir}" -lopenal" /> - <property name="rootrel.c.linker.joal.dso" value="${rootrel.obj}/libjoal.so" /> - <property name="c.linker.joal.dso" value="${project.root}/${rootrel.c.linker.joal.dso}" /> - <property name="c.linker.joal.flags" value="-o ${c.linker.joal.dso}" /> + <property name="compiler.cfg.id" value="compiler.cfg.macosx" /> + <property name="linker.cfg.id" value="linker.cfg.macosx" /> </target> - <target name="declare.macosx" depends="init" if="isOSX"> - <!-- Set platform directories. --> - <property name="stub.includes.platform" value="${stub.includes}/macosx" /> - <property name="java.includes.dir.platform" value="${java.includes.dir.macosx}" /> - <property name="java.lib.dir.platform" value="${java.lib.dir.macosx}" /> - <property name="java.excludes.platform" value="${java.excludes.macosx}" /> - - <!-- Set Javadoc properties. --> - <property name="javadoc.dev.packagenames.platform" value="${javadoc.dev.packagenames.macosx}" /> - - <!-- Set up gcc --> - <property name="c.compiler" value="gcc" /> - <property name="c.compiler.optflags" value="-Os -arch ppc -Dmacosx" /> - <!-- Note: specifying -ObjC for all files is sloppy (only needed for --> - <!-- JAWT-related .c files) but this doesn't break anything and is easier --> - <!-- than rewriting the whole Makefile --> - <property name="c.compiler.flags" value="${c.compiler.optflags} -fno-common -fpascal-strings -Wmost -ObjC -c -o" /> - <property name="c.compiler.obj.suffix" value="o" /> - <property name="c.compiler.joal.outputfile.expr" value="${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <property name="c.compiler.includes" value="-I"make/stub_includes/openal" -I"${rootrel.src.c}" -I"${java.includes.dir}" -I"${java.includes.dir.platform}"" /> - <property name="c.linker" value="gcc" /> - <property name="c.linker.flags" value="-arch ppc -prebind -Wl,-single_module -dynamiclib -compatibility_version 1 -current_version 1 -prebind_all_twolevel_modules" /> - <property name="c.linker.joal.libs" value="-framework OpenAL" /> - <property name="rootrel.c.linker.joal.dso" value="${rootrel.obj}/libjoal.jnilib" /> - <property name="c.linker.joal.dso" value="${project.root}/${rootrel.c.linker.joal.dso}" /> - <property name="c.linker.joal.flags" value="-o ${c.linker.joal.dso}" /> + <target name="declare.freebsd" if="isFreeBSD"> + <echo message="FreeBSD" /> + <property name="java.includes.dir.platform" value="${java.includes.dir.freebsd}" /> + <property name="java.lib.dir.platform" value="${java.lib.dir.linux}" /> + + <property name="compiler.cfg.id" value="compiler.cfg.freebsd" /> + <property name="linker.cfg.id" value="linker.cfg.linux" /> </target> - + <!-- ================================================================== --> <!-- - Initialize all parameters required for the build and create any @@ -409,7 +343,7 @@ <mkdir dir="${obj.joal}" /> </target> - <target name="declare" depends="init,declare.win32,declare.linux,declare.solaris,declare.macosx" /> + <target name="declare" depends="init,declare.win32,declare.linux,declare.solaris,declare.macosx,declare.freebsd" /> <!-- ================================================================== --> <!-- Java file generation --> @@ -445,7 +379,7 @@ --> <target name="java.generate" depends="java.generate.check" unless="java.generate.skip"> <!-- Add the GlueGen task to ANT --> - <taskdef name="gluegen" classname="net.java.games.gluegen.ant.GlueGenTask" + <taskdef name="gluegen" classname="com.sun.gluegen.ant.GlueGenTask" classpathref="antlr.classpath" /> <!-- Use the GlueGen task to generate the Java files --> @@ -454,7 +388,7 @@ <gluegen src="${stub.includes.openal}/al.h" config="${joal.cfg}" includeRefid="stub.includes.fileset.all" - emitter="net.java.games.gluegen.JavaEmitter"> + emitter="com.sun.gluegen.procaddress.ProcAddressEmitter"> <classpath refid="antlr.classpath" /> </gluegen> @@ -462,7 +396,7 @@ <gluegen src="${stub.includes.openal}/al.h" config="${joal.constants.cfg}" includeRefid="stub.includes.fileset.all" - emitter="net.java.games.gluegen.JavaEmitter"> + emitter="com.sun.gluegen.JavaEmitter"> <classpath refid="antlr.classpath" /> </gluegen> @@ -470,7 +404,7 @@ <gluegen src="${stub.includes.openal}/alc.h" config="${joal.alc.cfg}" includeRefid="stub.includes.fileset.all" - emitter="net.java.games.gluegen.JavaEmitter"> + emitter="com.sun.gluegen.procaddress.ProcAddressEmitter"> <classpath refid="antlr.classpath" /> </gluegen> @@ -478,7 +412,7 @@ <gluegen src="${stub.includes.openal}/alc.h" config="${joal.alc.constants.cfg}" includeRefid="stub.includes.fileset.all" - emitter="net.java.games.gluegen.JavaEmitter"> + emitter="com.sun.gluegen.JavaEmitter"> <classpath refid="antlr.classpath" /> </gluegen> @@ -491,13 +425,10 @@ <!-- ================================================================== --> <!-- - - Compile the original and generated source. The composable pipelines - - will be generated. + - Compile the original and generated source. --> <target name="java.compile" depends="java.generate"> - <!-- Perform the first pass Java compile. --> - <javac destdir="${classes}" - excludes="${java.excludes.platform}" source="1.4" debug="true" debuglevel="source,lines"> + <javac destdir="${classes}" source="1.4" debug="true" debuglevel="source,lines"> <src path="${src}" /> <src path="${src.generated.java}" /> <classpath refid="antlr.classpath" /> @@ -509,157 +440,187 @@ - Compile the native C code for JOAL. --> - <!-- - - Check dependencies to see whether we need to recompile .c or .m files - --> - <target name="c.compile.joal.check.nonmacosx" unless="isOSX"> - <condition property="c.compile.joal.skip"> - <and> - <uptodate> - <srcfiles dir="${project.root}" includes="${rootrel.src.c}/*.c" /> - <mapper type="glob" from="${rootrel.src.c}${sep}*.c" to="${rootrel.obj.joal}${sep}*.${c.compiler.obj.suffix}" /> - </uptodate> - <uptodate> - <srcfiles dir="${project.root}" includes="${rootrel.generated.c.joal}/*.c" /> - <mapper type="glob" from="${rootrel.generated.c.joal}${sep}*.c" to="${rootrel.obj.joal}${sep}*.${c.compiler.obj.suffix}" /> - </uptodate> - </and> - </condition> - </target> - - <target name="c.compile.joal.check.macosx" if="isOSX"> - <condition property="c.compile.joal.skip"> - <and> - <uptodate> - <srcfiles dir="${project.root}" includes="${rootrel.src.c}/*.c" /> - <mapper type="glob" from="${rootrel.src.c}${sep}*.c" to="${rootrel.obj.joal}${sep}*.${c.compiler.obj.suffix}" /> - </uptodate> - <uptodate> - <srcfiles dir="${project.root}" includes="${rootrel.generated.c.joal}/*.c" /> - <mapper type="glob" from="${rootrel.generated.c.joal}${sep}*.c" to="${rootrel.obj.joal}${sep}*.${c.compiler.obj.suffix}" /> - </uptodate> - <uptodate> - <srcfiles dir="${project.root}" includes="${rootrel.src.c}/*.m" /> - <mapper type="glob" from="${rootrel.src.c}${sep}*.m" to="${rootrel.obj.joal}${sep}*.${c.compiler.obj.suffix}" /> - </uptodate> - </and> - </condition> - </target> - - <target name="c.compile.joal.check" depends="c.compile.joal.check.nonmacosx,c.compile.joal.check.macosx"> - </target> - - <!-- - - Compile source files - --> - <target name="c.compile.joal.macosx.objs" if="isOSX"> - <apply executable="${c.compiler}" dest="${rootrel.obj.joal}" dir="${project.root}" relative="true" failonerror="true"> - <arg line="${c.compiler.includes}" /> - <arg line="${c.compiler.flags}" /> - <fileset dir="${project.root}"> - <include name="${rootrel.src.c}/*.m"/> - </fileset> - <targetfile /> - <srcfile /> - <mapper type="glob" from="${rootrel.src.c}${sep}*.m" to="${c.compiler.joal.outputfile.expr}" /> - </apply> - </target> - - <target name="c.compile.joal" depends="c.compile.joal.check" unless="c.compile.joal.skip"> - - <!-- Note: commented out for now since we currently don't have any hand-generated C, - but we might later when we add back in EAX and other support --> - - <!-- -- -- <apply executable="${c.compiler}" dest="${rootrel.obj.joal}" dir="${project.root}" relative="true" failonerror="true"> -- <arg line="${c.compiler.includes}" /> -- <arg line="${c.compiler.flags}" /> -- <fileset dir="${project.root}"> -- <include name="${rootrel.src.c}/*.c"/> -- </fileset> -- <targetfile /> -- <srcfile /> -- <mapper type="glob" from="${rootrel.src.c}${sep}*.c" to="${c.compiler.joal.outputfile.expr}" /> -- </apply> ---> - <apply executable="${c.compiler}" dest="${rootrel.obj.joal}" dir="${project.root}" relative="true" failonerror="true"> - <arg line="${c.compiler.includes}" /> - <arg line="${c.compiler.flags}" /> - <fileset dir="${project.root}"> - <include name="${rootrel.generated.c.joal}/*.c"/> - </fileset> - <targetfile /> - <srcfile /> - <mapper type="glob" from="${rootrel.generated.c.joal}${sep}*.c" to="${c.compiler.joal.outputfile.expr}" /> - </apply> - - <apply executable="${c.compiler}" dest="${rootrel.obj.joal}" dir="${project.root}" relative="true" failonerror="true"> - <arg line="${c.compiler.includes}" /> - <arg line="${c.compiler.flags}" /> - <fileset dir="${project.root}"> - <include name="${rootrel.src.c}/*.c"/> - </fileset> - <targetfile /> - <srcfile /> - <mapper type="glob" from="${rootrel.src.c}${sep}*.c" to="${c.compiler.joal.outputfile.expr}" /> - </apply> - - <antcall target="c.compile.joal.macosx.objs" inheritRefs="true" /> - </target> - + <target name="c.configure"> - <!-- - - Link object files - --> - <target name="c.link.joal.check"> - <!-- Check object files against resulting DSO/DLL --> - <uptodate property="c.link.joal.skip"> - <srcfiles id="c.link.joal.obj.fileset" dir="${project.root}" includes="${rootrel.obj.joal}/*.${c.compiler.obj.suffix}" /> - <mapper type="merge" to="${rootrel.c.linker.joal.dso}" /> - </uptodate> - </target> - - <target name="c.link.joal" depends="c.link.joal.check" unless="c.link.joal.skip"> - <pathconvert pathsep=" " property="c.link.joal.obj.files" refid="c.link.joal.obj.fileset" /> - <exec dir="." executable="${c.linker}" failonerror="true"> - <arg line="${c.linker.joal.flags}" /> - <arg line="${c.linker.flags}" /> - <arg line="${c.link.joal.obj.files}" /> - <arg line="${c.linker.joal.libs}" /> - </exec> - </target> - - <target name="c.compile.joal.win32.vc6" depends="declare.win32.vc6"> - <antcall target="c.compile.joal" inheritRefs="true" /> - <antcall target="c.link.joal" inheritRefs="true" /> - </target> - - <target name="c.compile.joal.win32.vc7" depends="declare.win32.vc7"> - <antcall target="c.compile.joal" inheritRefs="true" /> - <antcall target="c.link.joal" inheritRefs="true" /> - </target> - - <target name="c.compile.joal.win32.mingw" depends="declare.win32.mingw"> - <antcall target="c.compile.joal" inheritRefs="true" /> - <antcall target="c.link.joal" inheritRefs="true" /> + <!-- import cpptasks --> + <typedef resource="net/sf/antcontrib/cpptasks/antlib.xml" classpath="${jogl.root}/make/lib/cpptasks.jar"/> + <!--typedef resource="net/sf/antcontrib/cpptasks/antlib.xml"/--> + + <!-- compiler configuration --> + <compiler id="compiler.cfg.linux" name="gcc" /> + + <compiler id="compiler.cfg.linux.amd64" name="gcc"> + <compilerarg value="-fPIC"/> + </compiler> + + <compiler id="compiler.cfg.solaris" name="suncc"> + </compiler> + + <compiler id="compiler.cfg.win32.mingw" name="gcc"> + <defineset> + <define name="_DEBUG" if="c.compiler.use-debug"/> + <define name="DEBUG" if="c.compiler.use-debug"/> + <define name="NDEBUG" unless="c.compiler.use-debug"/> + + <define name="DBUILD_DLL" /> + <define name="_WINGDI_" /> + <define name="_STRICT_ANSI" /> + <define name="_JNI_IMPLEMENTATION_" /> + </defineset> + </compiler> + + <compiler id="compiler.cfg.win32.msvc" name="msvc"> + <compilerarg value="/W3"/> <!-- set warning level --> + <compilerarg value="/Ob1"/> <!-- inline only functions marked inline --> + <compilerarg value="/GF"/> <!-- enable string pooling --> + <compilerarg value="/Gy"/> <!-- enable function level linking --> + <compilerarg value="/GS" if="isVC7"/> <!-- buffer security checks --> + <compilerarg value="/Wp64" if="isVC7"/> <!-- detect 64-bit port problems --> + <compilerarg value="/RTCcsu" if="isVC7"/> <!-- various runtime checks --> + <!-- Note: previous compiler options for VC7 were: + Debug: /MDd /Yd /GS /RTCs /RTCu /RTCc /W3 /Od /GF /EHsc /Zi /GS /Gy /Wp64 /Zi /D "_DEBUG" + Optimized: /MD /W3 /O2 /Ob1 /GF /EHsc /GS /Gy /Wp64 /D "NDEBUG" --> + + <sysincludepath path="${c.compiler.include.root}/PlatformSDK/Include"/> + <sysincludepath path="${c.compiler.include.root}/include"/> + + <defineset> + <define name="_DEBUG" if="c.compiler.use-debug"/> + <define name="DEBUG" if="c.compiler.use-debug"/> + <define name="NDEBUG" unless="c.compiler.use-debug"/> + </defineset> + </compiler> + + <compiler id="compiler.cfg.macosx" name="gcc"> + <compilerarg value="-arch" if="macosxfat"/> + <compilerarg value="ppc" if="macosxfat"/> + <compilerarg value="-arch" if="macosxfat"/> + <compilerarg value="i386" if="macosxfat"/> + <compilerarg value="-Wmost" /> + <compilerarg value="-ObjC" /> + <defineset> + <define name="macosx" /> + </defineset> + </compiler> + + <compiler id="compiler.cfg.freebsd" name="gcc"> + <includepath path="/usr/X11R6/include" /> + </compiler> + + <!-- linker configuration --> + + <linker id="linker.cfg.linux" name="gcc"> + <syslibset dir="${joal.lib.dir}" libs="openal"/> + </linker> + + <linker id="linker.cfg.linux.amd64" name="gcc"> + <syslibset dir="${joal.lib.dir}" libs="openal"/> + </linker> + + <linker id="linker.cfg.solaris" name="suncc"> + <syslibset dir="${joal.lib.dir}" libs="openal"/> + </linker> + + <linker id="linker.cfg.win32.mingw" name="gcc" incremental="false"> + <linkerarg value="-Wl,--kill-at" /> <!-- remove @ from function names --> + <syslibset dir="${joal.lib.dir}" libs="openal32, kernel32"/> + </linker> + + <linker id="linker.cfg.win32.msvc" name="msvc" incremental="false"> + <linkerarg value="/OPT:REF,ICF" /> <!-- enable link-time optimisations --> + <linkerarg value="/SUBSYSTEM:WINDOWS" /> <!-- output is not a console app as uses WinMain entry point --> + <linkerarg value="/MACHINE:IX86" /> <!-- explicity set target platform --> + + <syslibset dir="${joal.lib.dir}" libs="openal32" /> + <syslibset dir="${c.linker.lib.root}/lib" libs="kernel32" unless="isVC7"/> + <syslibset dir="${c.linker.lib.root}/PlatformSDK/lib" libs="kernel32" if="isVC7"/> + </linker> + + <linker id="linker.cfg.macosx" name="gcc"> + <linkerarg value="-arch" if="macosxfat"/> + <linkerarg value="ppc" if="macosxfat"/> + <linkerarg value="-arch" if="macosxfat"/> + <linkerarg value="i386" if="macosxfat"/> + <linkerarg value="-framework" /> + <linkerarg value="Cocoa" /> + <linkerarg value="-framework" /> + <linkerarg value="OpenGL" /> + <linkerarg value="-framework" if="c.compiler.use-cglib" /> + <linkerarg value="Cg" if="c.compiler.use-cglib" /> + </linker> + + <patternset id="c.src.files.joal"> + <include name="${rootrel.src.c}/*.c"/> + <include name="${rootrel.generated.c.joal}/*.c"/> + </patternset> + + </target> + + <target name="c.build" depends="c.configure"> + <fail message="Requires '${c.compiler.src.files}'" unless="c.compiler.src.files"/> + <fail message="Requires '${compiler.cfg.id}'" unless="compiler.cfg.id"/> + <fail message="Requires '${linker.cfg.id}'" unless="linker.cfg.id"/> + <fail message="Requires '${output.lib.name}'" unless="output.lib.name"/> + + <echo message="Output lib name = ${output.lib.name}" /> + + <!-- NOTE: the value of the debug and optimise attributes will not be overridden if already set externally --> + <property name="c.compiler.debug" value="false" /> + <!-- Optimise flags one of { none, size, speed, minimal, full, aggressive, extreme, unsafe } --> + <property name="c.compiler.optimise" value="none" /> + + <condition property="c.compiler.use-debug"><istrue value="${c.compiler.debug}"/></condition> + + <cc outtype="shared" + objdir="${obj.joal}" + outfile="${obj}/${output.lib.name}" + optimize="${c.compiler.optimise}" + debug="${c.compiler.debug}" + multithreaded="true" + exceptions="false" + rtti="false"> + + <!-- TODO: versioninfo companyname="java.net" + legalcopyright="Copyright" + productname="JOAL" + productversion="x.y.z" + description="Description" + fileversion="x.y.z" + filecomments="File Comment" /--> + + <fileset dir="${project.root}"><patternset refid="${c.compiler.src.files}"/></fileset> + + <compiler extends="${compiler.cfg.id}" > + <sysincludepath path="${java.includes.dir}"/> + <sysincludepath path="${java.includes.dir.platform}"/> + <includepath path="stub_includes/openal"/> + </compiler> + + <linker extends="${linker.cfg.id}" /> + </cc> + </target> + + <target name="c.rename.joal.lib.mingw" if="isMingw"> + <!-- FIXME: this is a hack; the cpptask should have an option to change the + suffix or at least understand the override from .so to .dll --> + <move file="${obj}/libjoal.so" tofile="${obj}/joal.dll" failonerror="false" /> + </target> + + <target name="c.rename.joal.lib.macosx" if="isOSX"> + <!-- FIXME: this is a hack; the cpptask should have an option to change the + suffix or at least understand the override from dylib to jnilib --> + <move file="${obj}/libjoal.dylib" tofile="${obj}/libjoal.jnilib" /> + </target> + + <target name="c.build.joal"> + <antcall target="c.build" inheritRefs="true"> + <param name="c.compiler.src.files" value="c.src.files.joal"/> + <param name="output.lib.name" value="joal"/> + </antcall> + <antcall target="c.rename.joal.lib.mingw" inheritRefs="true" /> + <antcall target="c.rename.joal.lib.macosx" inheritRefs="true" /> </target> - <target name="c.compile.joal.linux" depends="declare.linux"> - <antcall target="c.compile.joal" inheritRefs="true" /> - <antcall target="c.link.joal" inheritRefs="true" /> - </target> - - <target name="c.compile.joal.solaris" depends="declare.solaris"> - <antcall target="c.compile.joal" inheritRefs="true" /> - <antcall target="c.link.joal" inheritRefs="true" /> - </target> - - <target name="c.compile.joal.macosx" depends="declare.macosx"> - <antcall target="c.compile.joal" inheritRefs="true" /> - <antcall target="c.link.joal" inheritRefs="true" /> - </target> - <!-- ================================================================== --> <!-- - Build the joal.jar file. @@ -668,10 +629,10 @@ <!-- Build the jar excluding any build specific classes. --> <jar destfile="${joal.jar}"> <fileset dir="${classes}"> - <include name="net/java/games/joal/**" /> + <include name="net/java/games/**" /> </fileset> <fileset dir="${gluegen.classes}"> - <include name="net/java/games/gluegen/runtime/**" /> + <include name="com/sun/gluegen/runtime/**" /> </fileset> </jar> @@ -686,7 +647,7 @@ --> <target name="javadoc" depends="setup.java.home.dir,init"> <javadoc packagenames="${javadoc.packagenames}" - sourcepath="${src};${src.generated.java}" + sourcepath="${src};${src.generated.java}" destdir="${javadoc}" windowtitle="JOAL API" source="1.4" link="${javadoc.link}" /> @@ -695,16 +656,12 @@ <target name="javadoc.dev" depends="init"> <!-- Build the internal developer Javadoc --> <javadoc packagenames="${javadoc.dev.packagenames},${javadoc.dev.packagenames.platform}" - sourcepath="${src};${src.generated.java}" + sourcepath="${src};${src.generated.java}" destdir="${javadoc.dev}" windowtitle="JOAL API" source="1.4" link="${javadoc.link}" /> </target> - <target name="javadoc.dev.win32" depends="setup.java.home.dir,declare.win32,javadoc.dev" if="isWindows" /> - <target name="javadoc.dev.x11" depends="setup.java.home.dir,declare.x11,javadoc.dev" if="isUnix" /> - <target name="javadoc.dev.macosx" depends="setup.java.home.dir,declare.macosx,javadoc.dev" if="isOSX" /> - <!-- ================================================================== --> <!-- - Build the platform-independent distribution out of jars built for @@ -768,78 +725,29 @@ <fileset dir="${javadoc}" /> <fileset dir="${javadoc.dev}" /> </delete> - + <ant dir="../unit_tests" target="clean"/> </target> <!-- ================================================================== --> <!-- - - Inform the user that one of the platform targets should be used. - --> - <target name="all" depends="setup.java.home.dir,init,win32.vc6,win32.vc7,win32.mingw,linux,solaris,macosx" /> - - <!-- - - Win32 with MS VC6 - --> - <target name="win32.vc6" depends="declare.win32.pre" if="isVC6"> - <!-- Generate, compile, and build the jar for the Java sources. --> - <antcall target="jar" inheritRefs="true" /> - - <!-- Compile the native C sources and build the joal.dll. --> - <antcall target="c.compile.joal.win32.vc6" /> - </target> - - <!-- - - Win32 with MS VC7 + - Build everything. --> - <target name="win32.vc7" depends="declare.win32.pre" if="isVC7"> + <target name="all" depends="setup.java.home.dir,init,declare"> <!-- Generate, compile, and build the jar for the Java sources. --> <antcall target="jar" inheritRefs="true" /> - <!-- Compile the native C sources and build the joal.dll. --> - <antcall target="c.compile.joal.win32.vc7" /> - </target> - - <!-- - - Win32 with mingw32 - --> - <target name="win32.mingw" depends="declare.win32.pre" if="isMingw"> - <!-- Generate, compile, and build the jar for the Java sources. --> - <antcall target="jar" inheritRefs="true" /> - - <!-- Compile the native C sources and build the joal.dll. --> - <antcall target="c.compile.joal.win32.mingw" /> - </target> - - <!-- - - Linux (assuming GCC) - --> - <target name="linux" depends="declare.linux" if="isLinux"> - <!-- Generate, compile, and build the jar for the Java sources. --> - <antcall target="jar" inheritRefs="true" /> - - <!-- Compile the native C sources and build the joal lib. --> - <antcall target="c.compile.joal.linux" /> + <!-- Compile the native C sources . --> + <antcall target="c.build.joal" inheritRefs="true" /> </target> + <!-- ================================================================== --> <!-- - - Solaris (assuming Solaris CC) + - Build and run tests. --> - <target name="solaris" depends="declare.solaris" if="isSolaris"> - <!-- Generate, compile, and build the jar for the Java sources. --> - <antcall target="jar" inheritRefs="true" /> - - <!-- Compile the native C sources and build the joal lib. --> - <antcall target="c.compile.joal.solaris" /> - </target> - <!-- - - Mac OSX - --> - <target name="macosx" depends="declare.macosx" if="isOSX"> - <!-- Generate, compile, and build the jar for the Java sources. --> - <antcall target="jar" inheritRefs="true" /> - - <!-- Compile the native C sources and build the joal lib. --> - <antcall target="c.compile.joal.macosx" /> + <target name="runtests" depends="all"> + <ant dir="../unit_tests" target="compile"/> + <ant dir="../unit_tests" target="runOpenALTest"/> + <ant dir="../unit_tests" target="runSound3DTest"/> </target> </project> diff --git a/make/joal-CustomCCode.c b/make/joal-CustomCCode.c new file mode 100755 index 0000000..a6d0bb6 --- /dev/null +++ b/make/joal-CustomCCode.c @@ -0,0 +1,40 @@ +#if defined(_MSC_VER) /* Windows */ +#include <windows.h> +static HMODULE oalModule = NULL; +#endif + +/* Java->C glue code: + * Java package: net.java.games.joal.impl.ALImpl + * Java method: long dynamicLookupFunction0(java.lang.String fname) + * C function: ALproc alGetProcAddress(const ALchar * fname); + */ +JNIEXPORT jlong JNICALL +Java_net_java_games_joal_impl_ALImpl_dynamicLookupFunction0__Ljava_lang_String_2(JNIEnv *env, jobject _unused, jstring fname) { + const char* _UTF8fname = NULL; + ALproc _res; + if (fname != NULL) { + if (fname != NULL) { + _UTF8fname = (*env)->GetStringUTFChars(env, fname, (jboolean*)NULL); + if (_UTF8fname == NULL) { + (*env)->ThrowNew(env, (*env)->FindClass(env, "java/lang/OutOfMemoryError"), + "Failed to get UTF-8 chars for argument \"fname\" in native dispatcher for \"alGetProcAddress\""); + return 0; + } + } + } +#if defined(_MSC_VER) /* Windows */ + if (oalModule == NULL) { + oalModule = GetModuleHandle("OpenAL32"); + } + _res = (ALproc) GetProcAddress(oalModule, _UTF8fname); +/* Looks like we can use dlsym on OS X as well as other Unix flavors */ +/* #elif defined(__APPLE__) && defined(__MACH__) */ /* OS X */ +#else /* Assume vanilla Unix */ + _res = (ALproc) dlsym(RTLD_DEFAULT, _UTF8fname); +#endif + + if (fname != NULL) { + (*env)->ReleaseStringUTFChars(env, fname, _UTF8fname); + } + return (jlong) (intptr_t) _res; +} diff --git a/make/joal-alc-constants.cfg b/make/joal-alc-constants.cfg index 0863beb..83ea061 100755 --- a/make/joal-alc-constants.cfg +++ b/make/joal-alc-constants.cfg @@ -6,7 +6,3 @@ JavaClass ALCConstants # Factor out the OpenAL constants into their own interface IgnoreNot ^ALC_.+ - -# Add back in the constants the PCPP can't currently parse -# (FIXME: once it does, these lines will have to be removed) -CustomJavaCode ALCConstants public static final int ALC_INVALID = -1; diff --git a/make/joal-alc.cfg b/make/joal-alc.cfg index 088dc7b..1166a5a 100755 --- a/make/joal-alc.cfg +++ b/make/joal-alc.cfg @@ -7,6 +7,11 @@ ImplPackage net.java.games.joal.impl ImplJavaClass ALCImpl Extends ALC ALCConstants +EmitProcAddressTable true +ProcAddressTableClassName ALCProcAddressTable +GetProcAddressTableExpr ALProcAddressLookup.getALCProcAddressTable() +ProcAddressNameExpr LP $UPPERCASE({0}) + Import java.nio.* Import net.java.games.joal.* Import net.java.games.joal.impl.* @@ -15,13 +20,19 @@ Import net.java.games.joal.impl.* Ignore ^AL_.+ Ignore ^ALC_.+ -# These routines are ignored +# This routine is ignored. The analogous routine alGetProcAddress is +# broken at least up through OpenAL 1.1 so there is no point in trying +# to use this routine to look up the ALC function pointers. Ignore alcGetProcAddress # These routines use or return strings ReturnsString alcGetString +ArgumentIsString alcIsExtensionPresent 1 ArgumentIsString alcOpenDevice 0 +# Mappings for data types +Opaque boolean ALCboolean + # Provide #includes to native code CustomCCode #include "alc.h" @@ -33,10 +44,13 @@ ReturnValueCapacity alcGetCurrentContext 0 ReturnValueCapacity alcGetCurrentDevice 0 ReturnValueCapacity alcOpenDevice 0 -# Hand-generated routine for ALut support -CustomJavaCode ALC public void alcFreeCurrentContext(); +# These routines need to be statically linked for bootstrapping +SkipProcAddressGen alcOpenDevice +SkipProcAddressGen alcCreateContext +SkipProcAddressGen alcMakeContextCurrent + +# Need an epilogue on alcMakeContextCurrent to set up the proc address +# tables the first time +JavaEpilogue alcMakeContextCurrent ALProcAddressLookup.resetProcAddressTables(); -CustomJavaCode ALCImpl public void alcFreeCurrentContext() -CustomJavaCode ALCImpl { -CustomJavaCode ALCImpl alcMakeContextCurrent(null); -CustomJavaCode ALCImpl } +IncludeAs CustomCCode joal-common-CustomCCode.c diff --git a/make/joal-common-CustomCCode.c b/make/joal-common-CustomCCode.c new file mode 100755 index 0000000..f749723 --- /dev/null +++ b/make/joal-common-CustomCCode.c @@ -0,0 +1,9 @@ +#ifdef _MSC_VER /* Windows, Microsoft compilers */ +/* This typedef is only needed for VC6 */ +#if _MSC_VER <= 1200 +typedef int intptr_t; +#endif +#else +/* This header seems to be available on all other platforms */ +#include <inttypes.h> +#endif diff --git a/make/joal-common.cfg b/make/joal-common.cfg index c0cf9b2..85dba07 100755 --- a/make/joal-common.cfg +++ b/make/joal-common.cfg @@ -5,3 +5,5 @@ HierarchicalNativeOutput false JavaOutputDir ../build/gensrc/classes NativeOutputDir ../build/gensrc/native/joal +# Raise ALException instead of RuntimeException in glue code +RuntimeExceptionType ALException diff --git a/make/joal.cfg b/make/joal.cfg index 9b19b8b..c6894d9 100755 --- a/make/joal.cfg +++ b/make/joal.cfg @@ -7,22 +7,61 @@ ImplPackage net.java.games.joal.impl ImplJavaClass ALImpl Extends AL ALConstants +Implements ALImpl DynamicLookupHelper + +EmitProcAddressTable true +ProcAddressTableClassName ALProcAddressTable +GetProcAddressTableExpr ALProcAddressLookup.getALProcAddressTable() +ProcAddressNameExpr LP $UPPERCASE({0}) + Import net.java.games.joal.* Import net.java.games.joal.impl.* +Import com.sun.gluegen.runtime.* # Factor out the OpenAL constants into their own interface Ignore ^AL_.+ -# These routines are ignored +# alGetProcAddress is broken for core OpenAL routines at least up +# through OpenAL 1.1, so we have to implement our own dlsym() +# operation in order to populate the ALProcAddressTable and +# ALCProcAddressTable. If / when it is fixed and we don't need +# compatibility with preexisting OpenAL 1.0 and 1.1 installations we +# can enable the code below and delete the custom C code for +# dynamicLookupFunction0. Ignore alGetProcAddress +# This routine is not exposed in the public API +# AccessControl alGetProcAddress PACKAGE_PRIVATE +# And it's also statically linked for bootstrapping +# (could also consider looking it up via dlsym to more fully allow +# unloading of OpenAL, but that doesn't seem necessary and requires +# more native code to load/unload libraries) +# SkipProcAddressGen alGetProcAddress +# We also have to hack its return type for now because we can't make +# just that void* opaque +# Opaque long ALproc + # This routine doesn't seem to exist Ignore alHint +# Mappings for data types +Opaque boolean ALboolean + # These routines use or return strings ReturnsString alGetString ArgumentIsString alIsExtensionPresent 0 ArgumentIsString alGetEnumValue 0 +ArgumentIsString alGetProcAddress 0 # Provide #includes to native code CustomCCode #include "al.h" + +CustomJavaCode ALImpl /** Provides dlsym() capabilities because alGetProcAddress is +CustomJavaCode ALImpl broken for core OpenAL routines at least up through OpenAL 1.1. */ +CustomJavaCode ALImpl public long dynamicLookupFunction(String functionName) { +CustomJavaCode ALImpl return dynamicLookupFunction0(functionName); +CustomJavaCode ALImpl } +CustomJavaCode ALImpl private native long dynamicLookupFunction0(String functionName); + +IncludeAs CustomCCode joal-common-CustomCCode.c +IncludeAs CustomCCode joal-CustomCCode.c diff --git a/make/joal.properties b/make/joal.properties index d9809d1..436dc9f 100755 --- a/make/joal.properties +++ b/make/joal.properties @@ -26,24 +26,21 @@ antlr.jar=C:/Users/kbr/ANTLR/antlr-2.7.2/antlr.jar # # The required joal.lib.dir points to the directory containing the -# OpanAL library against which JOAL is linked. On Windows, this is the +# OpenAL library against which JOAL is linked. On Windows, this is the # directory containing OpenAL32.lib (the import library); on other # platforms, it's the directory containing libopenal.so. # Windows -joal.lib.dir=C:/Program Files/OpenAL 1.0 Software Development Kit/libs +# OpenAL 1.0 +# joal.lib.dir=C:/Program Files/OpenAL 1.0 Software Development Kit/libs +# OpenAL 1.1 (can link against either version; binding supports OpenAL +# 1.1 if available at run time) +# joal.lib.dir=C:/Program Files/OpenAL 1.1 SDK/libs/Win32 # Linux -# joal.lib.dir=/home/kbr/OpenAL/lib +# joal.lib.dir=/usr/lib # Mac OS X -# joal.lib.dir=/Library/Frameworks/OpenAL.framework/Versions/Current/OpenAL +# joal.lib.dir=/Library/Frameworks/OpenAL.framework # Solaris (not yet supported) -# joal.lib.dir=/home/kbr/OpenAL/lib - -# -# Force the use of jikes in +E (emacs) mode -# NOTE: this is optional -# -#build.compiler=jikes -#build.compiler.emacs=true +# joal.lib.dir=/usr/lib # If you are building on Windows and have the Microsoft Visual C++ # compilers installed, you can choose an alternate compiler with which @@ -64,3 +61,9 @@ vc6.root=C:/Program Files/Microsoft Visual Studio/VC98 # to point to the absolute path of the VC98 directory # vc7.root=C:/Program Files/Microsoft Visual Studio .NET/Vc7 + +# +# If you are building on a Mac OS X system supporting +# cross-compilation and want to generate fat (PPC and x86) binaries, +# uncomment the property below +# macosxfat=true diff --git a/make/stub_includes/openal/al.h b/make/stub_includes/openal/al.h index 98600c9..d73a1c0 100755 --- a/make/stub_includes/openal/al.h +++ b/make/stub_includes/openal/al.h @@ -1,5 +1,5 @@ -#ifndef _AL_H_ -#define _AL_H_ +#ifndef AL_AL_H +#define AL_AL_H /** * OpenAL cross platform audio library @@ -20,471 +20,737 @@ * Boston, MA 02111-1307, USA. * Or go to http://www.gnu.org/copyleft/lgpl.html */ -#include "altypes.h" -#ifdef __cplusplus +#if defined(__cplusplus) extern "C" { #endif -#ifdef _WIN32 - #ifdef _OPENAL32LIB - #define ALAPI __declspec(dllexport) +#if defined(_WIN32) && !defined(_XBOX) + /* _OPENAL32LIB is deprecated */ + #if defined(AL_BUILD_LIBRARY) || defined (_OPENAL32LIB) + #define AL_API __declspec(dllexport) #else - #define ALAPI __declspec(dllimport) + #define AL_API __declspec(dllimport) #endif - #define ALAPIENTRY __cdecl - #define AL_CALLBACK #else - #ifdef TARGET_OS_MAC - #if TARGET_OS_MAC - #pragma export on - #endif - #endif - #define ALAPI - #define ALAPIENTRY - #define AL_CALLBACK + #define AL_API extern #endif +#if defined(_WIN32) + #define AL_APIENTRY __cdecl +#else + #define AL_APIENTRY +#endif + +#if TARGET_OS_MAC + #pragma export on +#endif + +/* The OPENAL, ALAPI, and ALAPIENTRY macros are deprecated, but are included for applications porting code + from AL 1.0 */ #define OPENAL +#define ALAPI AL_API +#define ALAPIENTRY AL_APIENTRY + +#define AL_VERSION_1_0 +#define AL_VERSION_1_1 + + +/** 8-bit boolean */ +typedef char ALboolean; + +/** character */ +typedef char ALchar; + +/** signed 8-bit 2's complement integer */ +typedef char ALbyte; + +/** unsigned 8-bit integer */ +typedef unsigned char ALubyte; + +/** signed 16-bit 2's complement integer */ +typedef short ALshort; + +/** unsigned 16-bit integer */ +typedef unsigned short ALushort; + +/** signed 32-bit 2's complement integer */ +typedef int ALint; + +/** unsigned 32-bit integer */ +typedef unsigned int ALuint; + +/** non-negative 32-bit binary integer size */ +typedef int ALsizei; + +/** enumerated 32-bit value */ +typedef int ALenum; + +/** 32-bit IEEE754 floating-point */ +typedef float ALfloat; + +/** 64-bit IEEE754 floating-point */ +typedef double ALdouble; + +/** void type (for opaque pointers only) */ +typedef void ALvoid; + +/** Function pointer type */ +typedef void* ALproc; + +/* Enumerant values begin at column 50. No tabs. */ + +/* bad value */ +#define AL_INVALID -1 + +#define AL_NONE 0 + +/* Boolean False. */ +#define AL_FALSE 0 + +/** Boolean True. */ +#define AL_TRUE 1 + +/** Indicate Source has relative coordinates. */ +#define AL_SOURCE_RELATIVE 0x202 -#ifndef AL_NO_PROTOTYPES -/** - * OpenAL Maintenance Functions - * Initialization and exiting. - * State Management and Query. - * Error Handling. - * Extension Support. - */ - -/** State management. */ -ALAPI ALvoid ALAPIENTRY alEnable( ALenum capability ); -ALAPI ALvoid ALAPIENTRY alDisable( ALenum capability ); -ALAPI ALboolean ALAPIENTRY alIsEnabled( ALenum capability ); - -/** Application preferences for driver performance choices. */ -ALAPI ALvoid ALAPIENTRY alHint( ALenum target, ALenum mode ); - -/** State retrieval. */ -ALAPI ALboolean ALAPIENTRY alGetBoolean( ALenum param ); -ALAPI ALint ALAPIENTRY alGetInteger( ALenum param ); -ALAPI ALfloat ALAPIENTRY alGetFloat( ALenum param ); -ALAPI ALdouble ALAPIENTRY alGetDouble( ALenum param ); -ALAPI ALvoid ALAPIENTRY alGetBooleanv( ALenum param, ALboolean* data ); -ALAPI ALvoid ALAPIENTRY alGetIntegerv( ALenum param, ALint* data ); -ALAPI ALvoid ALAPIENTRY alGetFloatv( ALenum param, ALfloat* data ); -ALAPI ALvoid ALAPIENTRY alGetDoublev( ALenum param, ALdouble* data ); -ALAPI ALubyte* ALAPIENTRY alGetString( ALenum param ); /** - * Error support. - * Obtain the most recent error generated in the AL state machine. + * Directional source, inner cone angle, in degrees. + * Range: [0-360] + * Default: 360 */ -ALAPI ALenum ALAPIENTRY alGetError( ALvoid ); +#define AL_CONE_INNER_ANGLE 0x1001 +/** + * Directional source, outer cone angle, in degrees. + * Range: [0-360] + * Default: 360 + */ +#define AL_CONE_OUTER_ANGLE 0x1002 +/** + * Specify the pitch to be applied, either at source, + * or on mixer results, at listener. + * Range: [0.5-2.0] + * Default: 1.0 + */ +#define AL_PITCH 0x1003 + /** - * Extension support. - * Obtain the address of a function (usually an extension) - * with the name fname. All addresses are context-independent. + * Specify the current location in three dimensional space. + * OpenAL, like OpenGL, uses a right handed coordinate system, + * where in a frontal default view X (thumb) points right, + * Y points up (index finger), and Z points towards the + * viewer/camera (middle finger). + * To switch from a left handed coordinate system, flip the + * sign on the Z coordinate. + * Listener position is always in the world coordinate system. + */ +#define AL_POSITION 0x1004 + +/** Specify the current direction. */ +#define AL_DIRECTION 0x1005 + +/** Specify the current velocity in three dimensional space. */ +#define AL_VELOCITY 0x1006 + +/** + * Indicate whether source is looping. + * Type: ALboolean? + * Range: [AL_TRUE, AL_FALSE] + * Default: FALSE. */ -ALAPI ALboolean ALAPIENTRY alIsExtensionPresent( ALubyte* fname ); +#define AL_LOOPING 0x1007 +/** + * Indicate the buffer to provide sound samples. + * Type: ALuint. + * Range: any valid Buffer id. + */ +#define AL_BUFFER 0x1009 + +/** + * Indicate the gain (volume amplification) applied. + * Type: ALfloat. + * Range: ]0.0- ] + * A value of 1.0 means un-attenuated/unchanged. + * Each division by 2 equals an attenuation of -6dB. + * Each multiplicaton with 2 equals an amplification of +6dB. + * A value of 0.0 is meaningless with respect to a logarithmic + * scale; it is interpreted as zero volume - the channel + * is effectively disabled. + */ +#define AL_GAIN 0x100A + +/* + * Indicate minimum source attenuation + * Type: ALfloat + * Range: [0.0 - 1.0] + * + * Logarthmic + */ +#define AL_MIN_GAIN 0x100D -/** - * Extension support. - * Obtain the address of a function (usually an extension) - * with the name fname. All addresses are context-independent. +/** + * Indicate maximum source attenuation + * Type: ALfloat + * Range: [0.0 - 1.0] + * + * Logarthmic */ -ALAPI ALvoid* ALAPIENTRY alGetProcAddress( ALubyte* fname ); +#define AL_MAX_GAIN 0x100E +/** + * Indicate listener orientation. + * + * at/up + */ +#define AL_ORIENTATION 0x100F /** - * Extension support. - * Obtain the integer value of an enumeration (usually an extension) with the name ename. + * Specify the channel mask. (Creative) + * Type: ALuint + * Range: [0 - 255] */ -ALAPI ALenum ALAPIENTRY alGetEnumValue( ALubyte* ename ); +#define AL_CHANNEL_MASK 0x3000 +/** + * Source state information. + */ +#define AL_SOURCE_STATE 0x1010 +#define AL_INITIAL 0x1011 +#define AL_PLAYING 0x1012 +#define AL_PAUSED 0x1013 +#define AL_STOPPED 0x1014 +/** + * Buffer Queue params + */ +#define AL_BUFFERS_QUEUED 0x1015 +#define AL_BUFFERS_PROCESSED 0x1016 /** - * LISTENER - * Listener is the sample position for a given context. - * The multi-channel (usually stereo) output stream generated - * by the mixer is parametrized by this Listener object: - * its position and velocity relative to Sources, within - * occluder and reflector geometry. + * Source buffer position information */ +#define AL_SEC_OFFSET 0x1024 +#define AL_SAMPLE_OFFSET 0x1025 +#define AL_BYTE_OFFSET 0x1026 +/* + * Source type (Static, Streaming or undetermined) + * Source is Static if a Buffer has been attached using AL_BUFFER + * Source is Streaming if one or more Buffers have been attached using alSourceQueueBuffers + * Source is undetermined when it has the NULL buffer attached + */ +#define AL_SOURCE_TYPE 0x1027 +#define AL_STATIC 0x1028 +#define AL_STREAMING 0x1029 +#define AL_UNDETERMINED 0x1030 +/** Sound samples: format specifier. */ +#define AL_FORMAT_MONO8 0x1100 +#define AL_FORMAT_MONO16 0x1101 +#define AL_FORMAT_STEREO8 0x1102 +#define AL_FORMAT_STEREO16 0x1103 /** + * source specific reference distance + * Type: ALfloat + * Range: 0.0 - +inf * - * Listener Environment: default 0. + * At 0.0, no distance attenuation occurs. Default is + * 1.0. */ -ALAPI ALvoid ALAPIENTRY alListeneri( ALenum param, ALint value ); - +#define AL_REFERENCE_DISTANCE 0x1020 /** + * source specific rolloff factor + * Type: ALfloat + * Range: 0.0 - +inf * - * Listener Gain: default 1.0f. */ -ALAPI ALvoid ALAPIENTRY alListenerf( ALenum param, ALfloat value ); +#define AL_ROLLOFF_FACTOR 0x1021 +/** + * Directional source, outer cone gain. + * + * Default: 0.0 + * Range: [0.0 - 1.0] + * Logarithmic + */ +#define AL_CONE_OUTER_GAIN 0x1022 -/** +/** + * Indicate distance above which sources are not + * attenuated using the inverse clamped distance model. * - * Listener Position. - * Listener Velocity. + * Default: +inf + * Type: ALfloat + * Range: 0.0 - +inf */ -ALAPI ALvoid ALAPIENTRY alListener3f( ALenum param, ALfloat v1, ALfloat v2, ALfloat v3 ); +#define AL_MAX_DISTANCE 0x1023 +/** + * Sound samples: frequency, in units of Hertz [Hz]. + * This is the number of samples per second. Half of the + * sample frequency marks the maximum significant + * frequency component. + */ +#define AL_FREQUENCY 0x2001 +#define AL_BITS 0x2002 +#define AL_CHANNELS 0x2003 +#define AL_SIZE 0x2004 /** + * Buffer state. * - * Listener Position: ALfloat[3] - * Listener Velocity: ALfloat[3] - * Listener Orientation: ALfloat[6] (forward and up vector). + * Not supported for public use (yet). */ -ALAPI ALvoid ALAPIENTRY alListenerfv( ALenum param, ALfloat* values ); +#define AL_UNUSED 0x2010 +#define AL_PENDING 0x2011 +#define AL_PROCESSED 0x2012 -ALAPI ALvoid ALAPIENTRY alGetListeneri( ALenum param, ALint* value ); -ALAPI ALvoid ALAPIENTRY alGetListenerf( ALenum param, ALfloat* value ); -ALAPI ALvoid ALAPIENTRY alGetListener3f( ALenum param, ALfloat* v1, ALfloat* v2, ALfloat* v3 ); -ALAPI ALvoid ALAPIENTRY alGetListenerfv( ALenum param, ALfloat* values ); +/** Errors: No Error. */ +#define AL_NO_ERROR AL_FALSE -/** - * SOURCE - * Source objects are by default localized. Sources - * take the PCM data provided in the specified Buffer, - * apply Source-specific modifications, and then - * submit them to be mixed according to spatial - * arrangement etc. +/** + * Invalid Name paramater passed to AL call. */ +#define AL_INVALID_NAME 0xA001 +/** + * Invalid parameter passed to AL call. + */ +#define AL_ILLEGAL_ENUM 0xA002 +#define AL_INVALID_ENUM 0xA002 +/** + * Invalid enum parameter value. + */ +#define AL_INVALID_VALUE 0xA003 -/** Create Source objects. */ -ALAPI ALvoid ALAPIENTRY alGenSources( ALsizei n, ALuint* sources ); - -/** Delete Source objects. */ -ALAPI ALvoid ALAPIENTRY alDeleteSources( ALsizei n, ALuint* sources ); +/** + * Illegal call. + */ +#define AL_ILLEGAL_COMMAND 0xA004 +#define AL_INVALID_OPERATION 0xA004 -/** Verify a handle is a valid Source. */ -ALAPI ALboolean ALAPIENTRY alIsSource( ALuint id ); + +/** + * No mojo. + */ +#define AL_OUT_OF_MEMORY 0xA005 -/** Set an integer parameter for a Source object. */ -ALAPI ALvoid ALAPIENTRY alSourcei( ALuint source, ALenum param, ALint value ); -ALAPI ALvoid ALAPIENTRY alSourcef( ALuint source, ALenum param, ALfloat value ); -ALAPI ALvoid ALAPIENTRY alSource3f( ALuint source, ALenum param, ALfloat v1, ALfloat v2, ALfloat v3 ); -ALAPI ALvoid ALAPIENTRY alSourcefv( ALuint source, ALenum param, ALfloat* values ); -/** Get an integer parameter for a Source object. */ -ALAPI ALvoid ALAPIENTRY alGetSourcei( ALuint source, ALenum param, ALint* value ); -ALAPI ALvoid ALAPIENTRY alGetSourcef( ALuint source, ALenum param, ALfloat* value ); -ALAPI ALvoid ALAPIENTRY alGetSource3f( ALuint source, ALenum param, ALfloat* v1, ALfloat* v2, ALfloat* v3 ); -ALAPI ALvoid ALAPIENTRY alGetSourcefv( ALuint source, ALenum param, ALfloat* values ); +/** Context strings: Vendor Name. */ +#define AL_VENDOR 0xB001 +#define AL_VERSION 0xB002 +#define AL_RENDERER 0xB003 +#define AL_EXTENSIONS 0xB004 -ALAPI ALvoid ALAPIENTRY alSourcePlayv( ALsizei n, ALuint *sources ); -ALAPI ALvoid ALAPIENTRY alSourcePausev( ALsizei n, ALuint *sources ); -ALAPI ALvoid ALAPIENTRY alSourceStopv( ALsizei n, ALuint *sources ); -ALAPI ALvoid ALAPIENTRY alSourceRewindv(ALsizei n,ALuint *sources); +/** Global tweakage. */ -/** Activate a source, start replay. */ -ALAPI ALvoid ALAPIENTRY alSourcePlay( ALuint source ); +/** + * Doppler scale. Default 1.0 + */ +#define AL_DOPPLER_FACTOR 0xC000 /** - * Pause a source, - * temporarily remove it from the mixer list. + * Tweaks speed of propagation. */ -ALAPI ALvoid ALAPIENTRY alSourcePause( ALuint source ); +#define AL_DOPPLER_VELOCITY 0xC001 /** - * Stop a source, - * temporarily remove it from the mixer list, - * and reset its internal state to pre-Play. - * To remove a Source completely, it has to be - * deleted following Stop, or before Play. + * Speed of Sound in units per second */ -ALAPI ALvoid ALAPIENTRY alSourceStop( ALuint source ); +#define AL_SPEED_OF_SOUND 0xC003 /** - * Rewinds a source, - * temporarily remove it from the mixer list, - * and reset its internal state to pre-Play. + * Distance models + * + * used in conjunction with DistanceModel + * + * implicit: NONE, which disances distance attenuation. */ -ALAPI ALvoid ALAPIENTRY alSourceRewind( ALuint source ); +#define AL_DISTANCE_MODEL 0xD000 +#define AL_INVERSE_DISTANCE 0xD001 +#define AL_INVERSE_DISTANCE_CLAMPED 0xD002 +#define AL_LINEAR_DISTANCE 0xD003 +#define AL_LINEAR_DISTANCE_CLAMPED 0xD004 +#define AL_EXPONENT_DISTANCE 0xD005 +#define AL_EXPONENT_DISTANCE_CLAMPED 0xD006 +/* FIXME: no way to parse both the prototypes and the function pointer typedefs. */ +/* GlueGen requires both in order to recognize a function as dynamically linked. */ +/* #if !defined(AL_NO_PROTOTYPES) */ -/** - * BUFFER - * Buffer objects are storage space for sample data. - * Buffers are referred to by Sources. There can be more than - * one Source using the same Buffer data. If Buffers have - * to be duplicated on a per-Source basis, the driver has to - * take care of allocation, copying, and deallocation as well - * as propagating buffer data changes. +/* + * Renderer State management */ +AL_API void AL_APIENTRY alEnable( ALenum capability ); +AL_API void AL_APIENTRY alDisable( ALenum capability ); +AL_API ALboolean AL_APIENTRY alIsEnabled( ALenum capability ); -/** Buffer object generation. */ -ALAPI ALvoid ALAPIENTRY alGenBuffers( ALsizei n, ALuint* buffers ); -ALAPI ALvoid ALAPIENTRY alDeleteBuffers( ALsizei n, ALuint* buffers ); -ALAPI ALboolean ALAPIENTRY alIsBuffer( ALuint buffer ); - -/** - * Specify the data to be filled into a buffer. +/* + * State retrieval */ -ALAPI ALvoid ALAPIENTRY alBufferData( ALuint buffer, - ALenum format, - ALvoid* data, - ALsizei size, - ALsizei freq ); - +AL_API const ALchar* AL_APIENTRY alGetString( ALenum param ); -ALAPI ALvoid ALAPIENTRY alGetBufferi( ALuint buffer, ALenum param, ALint* value ); -ALAPI ALvoid ALAPIENTRY alGetBufferf( ALuint buffer, ALenum param, ALfloat* value ); +AL_API void AL_APIENTRY alGetBooleanv( ALenum param, ALboolean* data ); +AL_API void AL_APIENTRY alGetIntegerv( ALenum param, ALint* data ); +AL_API void AL_APIENTRY alGetFloatv( ALenum param, ALfloat* data ); +AL_API void AL_APIENTRY alGetDoublev( ALenum param, ALdouble* data ); -/** - * Queue stuff - */ +AL_API ALboolean AL_APIENTRY alGetBoolean( ALenum param ); -ALAPI ALvoid ALAPIENTRY alSourceQueueBuffers( ALuint source, ALsizei n, ALuint* buffers ); -ALAPI ALvoid ALAPIENTRY alSourceUnqueueBuffers( ALuint source, ALsizei n, ALuint* buffers ); +AL_API ALint AL_APIENTRY alGetInteger( ALenum param ); -/** - * Knobs and dials - */ -ALAPI ALvoid ALAPIENTRY alDistanceModel( ALenum value ); -ALAPI ALvoid ALAPIENTRY alDopplerFactor( ALfloat value ); -ALAPI ALvoid ALAPIENTRY alDopplerVelocity( ALfloat value ); +AL_API ALfloat AL_APIENTRY alGetFloat( ALenum param ); -#else /* AL_NO_PROTOTYPES */ +AL_API ALdouble AL_APIENTRY alGetDouble( ALenum param ); -/** - * OpenAL Maintenance Functions - * Initialization and exiting. - * State Management and Query. - * Error Handling. - * Extension Support. - */ - -/** State management. */ -ALAPI ALvoid ALAPIENTRY (*alEnable)( ALenum capability ); -ALAPI ALvoid ALAPIENTRY (*alDisable)( ALenum capability ); -ALAPI ALboolean ALAPIENTRY (*alIsEnabled)( ALenum capability ); - -/** Application preferences for driver performance choices. */ -ALAPI ALvoid ALAPIENTRY (*alHint)( ALenum target, ALenum mode ); - -/** State retrieval. */ -ALAPI ALboolean ALAPIENTRY (*alGetBoolean)( ALenum param ); -ALAPI ALint ALAPIENTRY (*alGetInteger)( ALenum param ); -ALAPI ALfloat ALAPIENTRY (*alGetFloat)( ALenum param ); -ALAPI ALdouble ALAPIENTRY (*alGetDouble)( ALenum param ); -ALAPI ALvoid ALAPIENTRY (*alGetBooleanv)( ALenum param, ALboolean* data ); -ALAPI ALvoid ALAPIENTRY (*alGetIntegerv)( ALenum param, ALint* data ); -ALAPI ALvoid ALAPIENTRY (*alGetFloatv)( ALenum param, ALfloat* data ); -ALAPI ALvoid ALAPIENTRY (*alGetDoublev)( ALenum param, ALdouble* data ); -ALAPI ALubyte* ALAPIENTRY (*alGetString)( ALenum param ); -/** +/* * Error support. * Obtain the most recent error generated in the AL state machine. */ -ALAPI ALenum ALAPIENTRY (*alGetError)( ALvoid ); +AL_API ALenum AL_APIENTRY alGetError( void ); -/** +/* * Extension support. - * Obtain the address of a function (usually an extension) - * with the name fname. All addresses are context-independent. + * Query for the presence of an extension, and obtain any appropriate + * function pointers and enum values. */ -ALAPI ALboolean ALAPIENTRY (*alIsExtensionPresent)( ALubyte* fname ); +AL_API ALboolean AL_APIENTRY alIsExtensionPresent( const ALchar* extname ); +AL_API ALproc AL_APIENTRY alGetProcAddress( const ALchar* fname ); -/** - * Extension support. - * Obtain the address of a function (usually an extension) - * with the name fname. All addresses are context-independent. - */ -ALAPI ALvoid* ALAPIENTRY (*alGetProcAddress)( ALubyte* fname ); +AL_API ALenum AL_APIENTRY alGetEnumValue( const ALchar* ename ); -/** - * Extension support. - * Obtain the integer value of an enumeration (usually an extension) with the name ename. - */ -ALAPI ALenum ALAPIENTRY (*alGetEnumValue)( ALubyte* ename ); +/* + * LISTENER + * Listener represents the location and orientation of the + * 'user' in 3D-space. + * + * Properties include: - + * + * Gain AL_GAIN ALfloat + * Position AL_POSITION ALfloat[3] + * Velocity AL_VELOCITY ALfloat[3] + * Orientation AL_ORIENTATION ALfloat[6] (Forward then Up vectors) +*/ +/* + * Set Listener parameters + */ +AL_API void AL_APIENTRY alListenerf( ALenum param, ALfloat value ); +AL_API void AL_APIENTRY alListener3f( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 ); +AL_API void AL_APIENTRY alListenerfv( ALenum param, const ALfloat* values ); -/** - * LISTENER - * Listener is the sample position for a given context. - * The multi-channel (usually stereo) output stream generated - * by the mixer is parametrized by this Listener object: - * its position and velocity relative to Sources, within - * occluder and reflector geometry. - */ +AL_API void AL_APIENTRY alListeneri( ALenum param, ALint value ); +AL_API void AL_APIENTRY alListener3i( ALenum param, ALint value1, ALint value2, ALint value3 ); +AL_API void AL_APIENTRY alListeneriv( ALenum param, const ALint* values ); -/** - * - * Listener Environment: default 0. +/* + * Get Listener parameters */ -ALAPI ALvoid ALAPIENTRY (*alListeneri)( ALenum param, ALint value ); +AL_API void AL_APIENTRY alGetListenerf( ALenum param, ALfloat* value ); +AL_API void AL_APIENTRY alGetListener3f( ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3 ); -/** - * - * Listener Gain: default 1.0f. - */ -ALAPI ALvoid ALAPIENTRY (*alListenerf)( ALenum param, ALfloat value ); +AL_API void AL_APIENTRY alGetListenerfv( ALenum param, ALfloat* values ); +AL_API void AL_APIENTRY alGetListeneri( ALenum param, ALint* value ); -/** - * - * Listener Position. - * Listener Velocity. - */ -ALAPI ALvoid ALAPIENTRY (*alListener3f)( ALenum param, ALfloat v1, ALfloat v2, ALfloat v3 ); +AL_API void AL_APIENTRY alGetListener3i( ALenum param, ALint *value1, ALint *value2, ALint *value3 ); + +AL_API void AL_APIENTRY alGetListeneriv( ALenum param, ALint* values ); /** + * SOURCE + * Sources represent individual sound objects in 3D-space. + * Sources take the PCM data provided in the specified Buffer, + * apply Source-specific modifications, and then + * submit them to be mixed according to spatial arrangement etc. + * + * Properties include: - * - * Listener Position: ALfloat[3] - * Listener Velocity: ALfloat[3] - * Listener Orientation: ALfloat[6] (forward and up vector). + * Gain AL_GAIN ALfloat + * Min Gain AL_MIN_GAIN ALfloat + * Max Gain AL_MAX_GAIN ALfloat + * Position AL_POSITION ALfloat[3] + * Velocity AL_VELOCITY ALfloat[3] + * Direction AL_DIRECTION ALfloat[3] + * Head Relative Mode AL_SOURCE_RELATIVE ALint (AL_TRUE or AL_FALSE) + * Reference Distance AL_REFERENCE_DISTANCE ALfloat + * Max Distance AL_MAX_DISTANCE ALfloat + * RollOff Factor AL_ROLLOFF_FACTOR ALfloat + * Inner Angle AL_CONE_INNER_ANGLE ALint or ALfloat + * Outer Angle AL_CONE_OUTER_ANGLE ALint or ALfloat + * Cone Outer Gain AL_CONE_OUTER_GAIN ALint or ALfloat + * Pitch AL_PITCH ALfloat + * Looping AL_LOOPING ALint (AL_TRUE or AL_FALSE) + * MS Offset AL_MSEC_OFFSET ALint or ALfloat + * Byte Offset AL_BYTE_OFFSET ALint or ALfloat + * Sample Offset AL_SAMPLE_OFFSET ALint or ALfloat + * Attached Buffer AL_BUFFER ALint + * State (Query only) AL_SOURCE_STATE ALint + * Buffers Queued (Query only) AL_BUFFERS_QUEUED ALint + * Buffers Processed (Query only) AL_BUFFERS_PROCESSED ALint */ -ALAPI ALvoid ALAPIENTRY (*alListenerfv)( ALenum param, ALfloat* values ); -ALAPI ALvoid ALAPIENTRY (*alGetListeneri)( ALenum param, ALint* value ); -ALAPI ALvoid ALAPIENTRY (*alGetListenerf)( ALenum param, ALfloat* value ); -ALAPI ALvoid ALAPIENTRY (*alGetListener3f)( ALenum param, ALfloat* v1, ALfloat* v2, ALfloat* v3 ); -ALAPI ALvoid ALAPIENTRY (*alGetListenerfv)( ALenum param, ALfloat* values ); +/* Create Source objects */ +AL_API void AL_APIENTRY alGenSources( ALsizei n, ALuint* sources ); +/* Delete Source objects */ +AL_API void AL_APIENTRY alDeleteSources( ALsizei n, const ALuint* sources ); -/** - * SOURCE - * Source objects are by default localized. Sources - * take the PCM data provided in the specified Buffer, - * apply Source-specific modifications, and then - * submit them to be mixed according to spatial - * arrangement etc. - */ +/* Verify a handle is a valid Source */ +AL_API ALboolean AL_APIENTRY alIsSource( ALuint sid ); +/* + * Set Source parameters + */ +AL_API void AL_APIENTRY alSourcef( ALuint sid, ALenum param, ALfloat value ); +AL_API void AL_APIENTRY alSource3f( ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 ); -/** Create Source objects. */ -ALAPI ALvoid ALAPIENTRY (*alGenSources)( ALsizei n, ALuint* sources ); +AL_API void AL_APIENTRY alSourcefv( ALuint sid, ALenum param, const ALfloat* values ); -/** Delete Source objects. */ -ALAPI ALvoid ALAPIENTRY (*alDeleteSources)( ALsizei n, ALuint* sources ); +AL_API void AL_APIENTRY alSourcei( ALuint sid, ALenum param, ALint value ); -/** Verify a handle is a valid Source. */ -ALAPI ALboolean ALAPIENTRY (*alIsSource)( ALuint id ); +AL_API void AL_APIENTRY alSource3i( ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3 ); -/** Set an integer parameter for a Source object. */ -ALAPI ALvoid ALAPIENTRY (*alSourcei)( ALuint source, ALenum param, ALint value ); -ALAPI ALvoid ALAPIENTRY (*alSourcef)( ALuint source, ALenum param, ALfloat value ); -ALAPI ALvoid ALAPIENTRY (*alSource3f)( ALuint source, ALenum param, ALfloat v1, ALfloat v2, ALfloat v3 ); -ALAPI ALvoid ALAPIENTRY (*alSourcefv)( ALuint source, ALenum param, ALfloat* values ); +AL_API void AL_APIENTRY alSourceiv( ALuint sid, ALenum param, const ALint* values ); -/** Get an integer parameter for a Source object. */ -ALAPI ALvoid ALAPIENTRY (*alGetSourcei)( ALuint source, ALenum param, ALint* value ); -ALAPI ALvoid ALAPIENTRY (*alGetSourcef)( ALuint source, ALenum param, ALfloat* value ); -ALAPI ALvoid ALAPIENTRY (*alGetSourcefv)( ALuint source, ALenum param, ALfloat* values ); +/* + * Get Source parameters + */ +AL_API void AL_APIENTRY alGetSourcef( ALuint sid, ALenum param, ALfloat* value ); -ALAPI ALvoid ALAPIENTRY (*alSourcePlayv)( ALsizei n, ALuint *sources ); -ALAPI ALvoid ALAPIENTRY (*alSourceStopv)( ALsizei n, ALuint *sources ); +AL_API void AL_APIENTRY alGetSource3f( ALuint sid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3); -/** Activate a source, start replay. */ -ALAPI ALvoid ALAPIENTRY (*alSourcePlay)( ALuint source ); +AL_API void AL_APIENTRY alGetSourcefv( ALuint sid, ALenum param, ALfloat* values ); -/** - * Pause a source, - * temporarily remove it from the mixer list. - */ -ALAPI ALvoid ALAPIENTRY (*alSourcePause)( ALuint source ); +AL_API void AL_APIENTRY alGetSourcei( ALuint sid, ALenum param, ALint* value ); -/** - * Stop a source, - * temporarily remove it from the mixer list, - * and reset its internal state to pre-Play. - * To remove a Source completely, it has to be - * deleted following Stop, or before Play. - */ -ALAPI ALvoid ALAPIENTRY (*alSourceStop)( ALuint source ); +AL_API void AL_APIENTRY alGetSource3i( ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3); +AL_API void AL_APIENTRY alGetSourceiv( ALuint sid, ALenum param, ALint* values ); -/** - * BUFFER - * Buffer objects are storage space for sample data. - * Buffers are referred to by Sources. There can be more than - * one Source using the same Buffer data. If Buffers have - * to be duplicated on a per-Source basis, the driver has to - * take care of allocation, copying, and deallocation as well - * as propagating buffer data changes. +/* + * Source vector based playback calls */ +/* Play, replay, or resume (if paused) a list of Sources */ +AL_API void AL_APIENTRY alSourcePlayv( ALsizei ns, const ALuint *sids ); +/* Stop a list of Sources */ +AL_API void AL_APIENTRY alSourceStopv( ALsizei ns, const ALuint *sids ); +/* Rewind a list of Sources */ +AL_API void AL_APIENTRY alSourceRewindv( ALsizei ns, const ALuint *sids ); -/** Buffer object generation. */ -ALAPI ALvoid ALAPIENTRY (*alGenBuffers)( ALsizei n, ALuint* buffers ); -ALAPI ALvoid ALAPIENTRY (*alDeleteBuffers)( ALsizei n, ALuint* buffers ); -ALAPI ALboolean ALAPIENTRY (*alIsBuffer)( ALuint buffer ); +/* Pause a list of Sources */ +AL_API void AL_APIENTRY alSourcePausev( ALsizei ns, const ALuint *sids ); -/** - * Specify the data to be filled into a buffer. +/* + * Source based playback calls */ -ALAPI ALvoid ALAPIENTRY (*alBufferData)( ALuint buffer, - ALenum format, - ALvoid* data, - ALsizei size, - ALsizei freq ); -ALAPI ALvoid ALAPIENTRY (*alGetBufferi)( ALuint buffer, ALenum param, ALint* value ); -ALAPI ALvoid ALAPIENTRY (*alGetBufferf)( ALuint buffer, ALenum param, ALfloat* value ); +/* Play, replay, or resume a Source */ +AL_API void AL_APIENTRY alSourcePlay( ALuint sid ); +/* Stop a Source */ +AL_API void AL_APIENTRY alSourceStop( ALuint sid ); +/* Rewind a Source (set playback postiton to beginning) */ +AL_API void AL_APIENTRY alSourceRewind( ALuint sid ); +/* Pause a Source */ +AL_API void AL_APIENTRY alSourcePause( ALuint sid ); -/** - * Queue stuff +/* + * Source Queuing */ -ALAPI ALvoid ALAPIENTRY (*alSourceQueueBuffers)( ALuint source, ALsizei n, ALuint* buffers ); -ALAPI ALvoid ALAPIENTRY (*alSourceUnqueueBuffers)( ALuint source, ALsizei n, ALuint* buffers ); +AL_API void AL_APIENTRY alSourceQueueBuffers( ALuint sid, ALsizei numEntries, const ALuint *bids ); + +AL_API void AL_APIENTRY alSourceUnqueueBuffers( ALuint sid, ALsizei numEntries, ALuint *bids ); + /** - * Knobs and dials + * BUFFER + * Buffer objects are storage space for sample data. + * Buffers are referred to by Sources. One Buffer can be used + * by multiple Sources. + * + * Properties include: - + * + * Frequency (Query only) AL_FREQUENCY ALint + * Size (Query only) AL_SIZE ALint + * Bits (Query only) AL_BITS ALint + * Channels (Query only) AL_CHANNELS ALint */ -ALAPI ALvoid ALAPIENTRY (*alDistanceModel)( ALenum value ); -ALAPI ALvoid ALAPIENTRY (*alDopplerFactor)( ALfloat value ); -ALAPI ALvoid ALAPIENTRY (*alDopplerVelocity)( ALfloat value ); -#endif /* AL_NO_PROTOTYPES */ +/* Create Buffer objects */ +AL_API void AL_APIENTRY alGenBuffers( ALsizei n, ALuint* buffers ); -#ifdef TARGET_OS_MAC - #if TARGET_OS_MAC - #pragma export off - #endif +/* Delete Buffer objects */ +AL_API void AL_APIENTRY alDeleteBuffers( ALsizei n, const ALuint* buffers ); + +/* Verify a handle is a valid Buffer */ +AL_API ALboolean AL_APIENTRY alIsBuffer( ALuint bid ); + +/* Specify the data to be copied into a buffer */ +AL_API void AL_APIENTRY alBufferData( ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq ); + +/* + * Set Buffer parameters + */ +AL_API void AL_APIENTRY alBufferf( ALuint bid, ALenum param, ALfloat value ); + +AL_API void AL_APIENTRY alBuffer3f( ALuint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 ); + +AL_API void AL_APIENTRY alBufferfv( ALuint bid, ALenum param, const ALfloat* values ); + +AL_API void AL_APIENTRY alBufferi( ALuint bid, ALenum param, ALint value ); + +AL_API void AL_APIENTRY alBuffer3i( ALuint bid, ALenum param, ALint value1, ALint value2, ALint value3 ); + +AL_API void AL_APIENTRY alBufferiv( ALuint bid, ALenum param, const ALint* values ); + +/* + * Get Buffer parameters + */ +AL_API void AL_APIENTRY alGetBufferf( ALuint bid, ALenum param, ALfloat* value ); + +AL_API void AL_APIENTRY alGetBuffer3f( ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3); + +AL_API void AL_APIENTRY alGetBufferfv( ALuint bid, ALenum param, ALfloat* values ); + +AL_API void AL_APIENTRY alGetBufferi( ALuint bid, ALenum param, ALint* value ); + +AL_API void AL_APIENTRY alGetBuffer3i( ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3); + +AL_API void AL_APIENTRY alGetBufferiv( ALuint bid, ALenum param, ALint* values ); + + +/* + * Global Parameters + */ +AL_API void AL_APIENTRY alDopplerFactor( ALfloat value ); + +AL_API void AL_APIENTRY alDopplerVelocity( ALfloat value ); + +AL_API void AL_APIENTRY alSpeedOfSound( ALfloat value ); + +AL_API void AL_APIENTRY alDistanceModel( ALenum distanceModel ); + +/* FIXME: see above */ +/* #else */ /* AL_NO_PROTOTYPES */ + +typedef void (AL_APIENTRY *LPALENABLE)( ALenum capability ); +typedef void (AL_APIENTRY *LPALDISABLE)( ALenum capability ); +typedef ALboolean (AL_APIENTRY *LPALISENABLED)( ALenum capability ); +typedef const ALchar* (AL_APIENTRY *LPALGETSTRING)( ALenum param ); +typedef void (AL_APIENTRY *LPALGETBOOLEANV)( ALenum param, ALboolean* data ); +typedef void (AL_APIENTRY *LPALGETINTEGERV)( ALenum param, ALint* data ); +typedef void (AL_APIENTRY *LPALGETFLOATV)( ALenum param, ALfloat* data ); +typedef void (AL_APIENTRY *LPALGETDOUBLEV)( ALenum param, ALdouble* data ); +typedef ALboolean (AL_APIENTRY *LPALGETBOOLEAN)( ALenum param ); +typedef ALint (AL_APIENTRY *LPALGETINTEGER)( ALenum param ); +typedef ALfloat (AL_APIENTRY *LPALGETFLOAT)( ALenum param ); +typedef ALdouble (AL_APIENTRY *LPALGETDOUBLE)( ALenum param ); +typedef ALenum (AL_APIENTRY *LPALGETERROR)( void ); +typedef ALboolean (AL_APIENTRY *LPALISEXTENSIONPRESENT)(const ALchar* extname ); +typedef void* (AL_APIENTRY *LPALGETPROCADDRESS)( const ALchar* fname ); +typedef ALenum (AL_APIENTRY *LPALGETENUMVALUE)( const ALchar* ename ); +typedef void (AL_APIENTRY *LPALLISTENERF)( ALenum param, ALfloat value ); +typedef void (AL_APIENTRY *LPALLISTENER3F)( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 ); +typedef void (AL_APIENTRY *LPALLISTENERFV)( ALenum param, const ALfloat* values ); +typedef void (AL_APIENTRY *LPALLISTENERI)( ALenum param, ALint value ); +typedef void (AL_APIENTRY *LPALLISTENER3I)( ALenum param, ALint value1, ALint value2, ALint value3 ); +typedef void (AL_APIENTRY *LPALLISTENERIV)( ALenum param, const ALint* values ); +typedef void (AL_APIENTRY *LPALGETLISTENERF)( ALenum param, ALfloat* value ); +typedef void (AL_APIENTRY *LPALGETLISTENER3F)( ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3 ); +typedef void (AL_APIENTRY *LPALGETLISTENERFV)( ALenum param, ALfloat* values ); +typedef void (AL_APIENTRY *LPALGETLISTENERI)( ALenum param, ALint* value ); +typedef void (AL_APIENTRY *LPALGETLISTENER3I)( ALenum param, ALint *value1, ALint *value2, ALint *value3 ); +typedef void (AL_APIENTRY *LPALGETLISTENERIV)( ALenum param, ALint* values ); +typedef void (AL_APIENTRY *LPALGENSOURCES)( ALsizei n, ALuint* sources ); +typedef void (AL_APIENTRY *LPALDELETESOURCES)( ALsizei n, const ALuint* sources ); +typedef ALboolean (AL_APIENTRY *LPALISSOURCE)( ALuint sid ); +typedef void (AL_APIENTRY *LPALSOURCEF)( ALuint sid, ALenum param, ALfloat value); +typedef void (AL_APIENTRY *LPALSOURCE3F)( ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 ); +typedef void (AL_APIENTRY *LPALSOURCEFV)( ALuint sid, ALenum param, const ALfloat* values ); +typedef void (AL_APIENTRY *LPALSOURCEI)( ALuint sid, ALenum param, ALint value); +typedef void (AL_APIENTRY *LPALSOURCE3I)( ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3 ); +typedef void (AL_APIENTRY *LPALSOURCEIV)( ALuint sid, ALenum param, const ALint* values ); +typedef void (AL_APIENTRY *LPALGETSOURCEF)( ALuint sid, ALenum param, ALfloat* value ); +typedef void (AL_APIENTRY *LPALGETSOURCE3F)( ALuint sid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3); +typedef void (AL_APIENTRY *LPALGETSOURCEFV)( ALuint sid, ALenum param, ALfloat* values ); +typedef void (AL_APIENTRY *LPALGETSOURCEI)( ALuint sid, ALenum param, ALint* value ); +typedef void (AL_APIENTRY *LPALGETSOURCE3I)( ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3); +typedef void (AL_APIENTRY *LPALGETSOURCEIV)( ALuint sid, ALenum param, ALint* values ); +typedef void (AL_APIENTRY *LPALSOURCEPLAYV)( ALsizei ns, const ALuint *sids ); +typedef void (AL_APIENTRY *LPALSOURCESTOPV)( ALsizei ns, const ALuint *sids ); +typedef void (AL_APIENTRY *LPALSOURCEREWINDV)( ALsizei ns, const ALuint *sids ); +typedef void (AL_APIENTRY *LPALSOURCEPAUSEV)( ALsizei ns, const ALuint *sids ); +typedef void (AL_APIENTRY *LPALSOURCEPLAY)( ALuint sid ); +typedef void (AL_APIENTRY *LPALSOURCESTOP)( ALuint sid ); +typedef void (AL_APIENTRY *LPALSOURCEREWIND)( ALuint sid ); +typedef void (AL_APIENTRY *LPALSOURCEPAUSE)( ALuint sid ); +typedef void (AL_APIENTRY *LPALSOURCEQUEUEBUFFERS)(ALuint sid, ALsizei numEntries, const ALuint *bids ); +typedef void (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERS)(ALuint sid, ALsizei numEntries, ALuint *bids ); +typedef void (AL_APIENTRY *LPALGENBUFFERS)( ALsizei n, ALuint* buffers ); +typedef void (AL_APIENTRY *LPALDELETEBUFFERS)( ALsizei n, const ALuint* buffers ); +typedef ALboolean (AL_APIENTRY *LPALISBUFFER)( ALuint bid ); +typedef void (AL_APIENTRY *LPALBUFFERDATA)( ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq ); +typedef void (AL_APIENTRY *LPALBUFFERF)( ALuint bid, ALenum param, ALfloat value); +typedef void (AL_APIENTRY *LPALBUFFER3F)( ALuint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 ); +typedef void (AL_APIENTRY *LPALBUFFERFV)( ALuint bid, ALenum param, const ALfloat* values ); +typedef void (AL_APIENTRY *LPALBUFFERI)( ALuint bid, ALenum param, ALint value); +typedef void (AL_APIENTRY *LPALBUFFER3I)( ALuint bid, ALenum param, ALint value1, ALint value2, ALint value3 ); +typedef void (AL_APIENTRY *LPALBUFFERIV)( ALuint bid, ALenum param, const ALint* values ); +typedef void (AL_APIENTRY *LPALGETBUFFERF)( ALuint bid, ALenum param, ALfloat* value ); +typedef void (AL_APIENTRY *LPALGETBUFFER3F)( ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3); +typedef void (AL_APIENTRY *LPALGETBUFFERFV)( ALuint bid, ALenum param, ALfloat* values ); +typedef void (AL_APIENTRY *LPALGETBUFFERI)( ALuint bid, ALenum param, ALint* value ); +typedef void (AL_APIENTRY *LPALGETBUFFER3I)( ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3); +typedef void (AL_APIENTRY *LPALGETBUFFERIV)( ALuint bid, ALenum param, ALint* values ); +typedef void (AL_APIENTRY *LPALDOPPLERFACTOR)( ALfloat value ); +typedef void (AL_APIENTRY *LPALDOPPLERVELOCITY)( ALfloat value ); +typedef void (AL_APIENTRY *LPALSPEEDOFSOUND)( ALfloat value ); +typedef void (AL_APIENTRY *LPALDISTANCEMODEL)( ALenum distanceModel ); + +/* FIXME: see above */ +/* #endif */ /* AL_NO_PROTOTYPES */ + +#if TARGET_OS_MAC + #pragma export off #endif -#ifdef __cplusplus -} +#if defined(__cplusplus) +} /* extern "C" */ #endif -#endif +#endif /* AL_AL_H */ diff --git a/make/stub_includes/openal/alc.h b/make/stub_includes/openal/alc.h index 7f37d21..0c50a88 100755 --- a/make/stub_includes/openal/alc.h +++ b/make/stub_includes/openal/alc.h @@ -1,90 +1,277 @@ -#ifndef _ALC_H_ -#define _ALC_H_ +#ifndef AL_ALC_H +#define AL_ALC_H -#include "altypes.h" -#include "alctypes.h" - -#ifdef __cplusplus +#if defined(__cplusplus) extern "C" { #endif -typedef struct ALCdevice_struct ALCdevice; -typedef struct ALCcontext_struct ALCcontext; - -#ifdef _WIN32 - #ifdef _OPENAL32LIB - #define ALCAPI __declspec(dllexport) +#if defined(_WIN32) && !defined(_XBOX) + /* _OPENAL32LIB is deprecated */ + #if defined(AL_BUILD_LIBRARY) || defined (_OPENAL32LIB) + #define ALC_API __declspec(dllexport) #else - #define ALCAPI __declspec(dllimport) + #define ALC_API __declspec(dllimport) #endif +#else + #define ALC_API extern +#endif - #define ALCAPIENTRY __cdecl +#if defined(_WIN32) + #define ALC_APIENTRY __cdecl #else - #ifdef TARGET_OS_MAC - #if TARGET_OS_MAC - #pragma export on - #endif - #endif - #define ALCAPI - #define ALCAPIENTRY + #define ALC_APIENTRY #endif +#if TARGET_OS_MAC + #pragma export on +#endif +/* The ALCAPI, and ALCAPIENTRY macros are deprecated, but are included for applications porting code + from AL 1.0 */ +#define ALCAPI ALC_API +#define ALCAPIENTRY ALC_APIENTRY -#ifndef ALC_NO_PROTOTYPES +#define ALC_VERSION_0_1 1 -ALCAPI ALCubyte* ALCAPIENTRY alcGetString(ALCdevice *device,ALCenum param); -ALCAPI ALCvoid ALCAPIENTRY alcGetIntegerv(ALCdevice *device,ALCenum param,ALCsizei size,ALCint *data); +typedef struct ALCdevice_struct ALCdevice; +typedef struct ALCcontext_struct ALCcontext; -ALCAPI ALCdevice* ALCAPIENTRY alcOpenDevice(ALCubyte *deviceName); -ALCAPI ALCvoid ALCAPIENTRY alcCloseDevice(ALCdevice *device); -ALCAPI ALCcontext*ALCAPIENTRY alcCreateContext(ALCdevice *device,ALCint *attrList); -ALCAPI ALCboolean ALCAPIENTRY alcMakeContextCurrent(ALCcontext *context); -ALCAPI ALCvoid ALCAPIENTRY alcProcessContext(ALCcontext *context); -ALCAPI ALCcontext*ALCAPIENTRY alcGetCurrentContext(ALCvoid); -ALCAPI ALCdevice* ALCAPIENTRY alcGetContextsDevice(ALCcontext *context); -ALCAPI ALCvoid ALCAPIENTRY alcSuspendContext(ALCcontext *context); -ALCAPI ALCvoid ALCAPIENTRY alcDestroyContext(ALCcontext *context); +/** 8-bit boolean */ +typedef char ALCboolean; -ALCAPI ALCenum ALCAPIENTRY alcGetError(ALCdevice *device); +/** character */ +typedef char ALCchar; -ALCAPI ALCboolean ALCAPIENTRY alcIsExtensionPresent(ALCdevice *device,ALCubyte *extName); -ALCAPI ALCvoid * ALCAPIENTRY alcGetProcAddress(ALCdevice *device,ALCubyte *funcName); -ALCAPI ALCenum ALCAPIENTRY alcGetEnumValue(ALCdevice *device,ALCubyte *enumName); - -#else /* AL_NO_PROTOTYPES */ +/** signed 8-bit 2's complement integer */ +typedef char ALCbyte; -ALCAPI ALCubyte* ALCAPIENTRY (*alcGetString)(ALCdevice *device,ALCenum param); -ALCAPI ALCvoid ALCAPIENTRY (*alcGetIntegerv)(ALCdevice * device,ALCenum param,ALCsizei size,ALCint *data); +/** unsigned 8-bit integer */ +typedef unsigned char ALCubyte; -ALCAPI ALCdevice* ALCAPIENTRY (*alcOpenDevice)(ALubyte *deviceName); -ALCAPI ALCvoid ALCAPIENTRY (*alcCloseDevice)(ALCdevice *device); +/** signed 16-bit 2's complement integer */ +typedef short ALCshort; -ALCAPI ALCcontext*ALCAPIENTRY (*alcCreateContext)(ALCdevice *device,ALCint *attrList); -ALCAPI ALCboolean ALCAPIENTRY (*alcMakeContextCurrent)(ALCcontext *context); -ALCAPI ALCvoid ALCAPIENTRY (*alcProcessContext)(ALCcontext *context); -ALCAPI ALCcontext*ALCAPIENTRY (*alcGetCurrentContext)(ALCvoid); -ALCAPI ALCdevice* ALCAPIENTRY (*alcGetContextsDevice)(ALCcontext *context); -ALCAPI ALCvoid ALCAPIENTRY (*alcSuspendContext)(ALCcontext *context); -ALCAPI ALCvoid ALCAPIENTRY (*alcDestroyContext)(ALCcontext *context); +/** unsigned 16-bit integer */ +typedef unsigned short ALCushort; -ALCAPI ALCenum ALCAPIENTRY (*alcGetError)(ALCdevice *device); +/** signed 32-bit 2's complement integer */ +typedef int ALCint; -ALCAPI ALCboolean ALCAPIENTRY (*alcIsExtensionPresent)(ALCdevice *device,ALCubyte *extName); -ALCAPI ALCvoid * ALCAPIENTRY (*alcGetProcAddress)(ALCdevice *device,ALCubyte *funcName); -ALCAPI ALCenum ALCAPIENTRY (*alcGetEnumValue)(ALCdevice *device,ALCubyte *enumName); +/** unsigned 32-bit integer */ +typedef unsigned int ALCuint; -#endif /* AL_NO_PROTOTYPES */ +/** non-negative 32-bit binary integer size */ +typedef int ALCsizei; -#ifdef TARGET_OS_MAC - #if TARGET_OS_MAC - #pragma export off - #endif +/** enumerated 32-bit value */ +typedef int ALCenum; + +/** 32-bit IEEE754 floating-point */ +typedef float ALCfloat; + +/** 64-bit IEEE754 floating-point */ +typedef double ALCdouble; + +/** void type (for opaque pointers only) */ +typedef void ALCvoid; + + +/* Enumerant values begin at column 50. No tabs. */ + +/* bad value */ +#define ALC_INVALID 0 + +/* Boolean False. */ +#define ALC_FALSE 0 + +/* Boolean True. */ +#define ALC_TRUE 1 + +/** + * followed by <int> Hz + */ +#define ALC_FREQUENCY 0x1007 + +/** + * followed by <int> Hz + */ +#define ALC_REFRESH 0x1008 + +/** + * followed by AL_TRUE, AL_FALSE + */ +#define ALC_SYNC 0x1009 + +/** + * followed by <int> Num of requested Mono (3D) Sources + */ +#define ALC_MONO_SOURCES 0x1010 + +/** + * followed by <int> Num of requested Stereo Sources + */ +#define ALC_STEREO_SOURCES 0x1011 + +/** + * errors + */ + +/** + * No error + */ +#define ALC_NO_ERROR ALC_FALSE + +/** + * No device + */ +#define ALC_INVALID_DEVICE 0xA001 + +/** + * invalid context ID + */ +#define ALC_INVALID_CONTEXT 0xA002 + +/** + * bad enum + */ +#define ALC_INVALID_ENUM 0xA003 + +/** + * bad value + */ +#define ALC_INVALID_VALUE 0xA004 + +/** + * Out of memory. + */ +#define ALC_OUT_OF_MEMORY 0xA005 + + +/** + * The Specifier string for default device + */ +#define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004 +#define ALC_DEVICE_SPECIFIER 0x1005 +#define ALC_EXTENSIONS 0x1006 + +#define ALC_MAJOR_VERSION 0x1000 +#define ALC_MINOR_VERSION 0x1001 + +#define ALC_ATTRIBUTES_SIZE 0x1002 +#define ALC_ALL_ATTRIBUTES 0x1003 + +/** + * Capture extension + */ +#define ALC_CAPTURE_DEVICE_SPECIFIER 0x310 +#define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311 +#define ALC_CAPTURE_SAMPLES 0x312 + + +/* FIXME: no way to parse both the prototypes and the function pointer typedefs. */ +/* GlueGen requires both in order to recognize a function as dynamically linked. */ +/* #if !defined(ALC_NO_PROTOTYPES) */ + +/* + * Context Management + */ +ALC_API ALCcontext * ALC_APIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist ); + +ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context ); + +ALC_API void ALC_APIENTRY alcProcessContext( ALCcontext *context ); + +ALC_API void ALC_APIENTRY alcSuspendContext( ALCcontext *context ); + +ALC_API void ALC_APIENTRY alcDestroyContext( ALCcontext *context ); + +ALC_API ALCcontext * ALC_APIENTRY alcGetCurrentContext( ALCvoid ); + +ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice( ALCcontext *context ); + + +/* + * Device Management + */ +ALC_API ALCdevice * ALC_APIENTRY alcOpenDevice( const ALCchar *devicename ); + +ALC_API ALCboolean ALC_APIENTRY alcCloseDevice( ALCdevice *device ); + + +/* + * Error support. + * Obtain the most recent Context error + */ +ALC_API ALCenum ALC_APIENTRY alcGetError( ALCdevice *device ); + + +/* + * Extension support. + * Query for the presence of an extension, and obtain any appropriate + * function pointers and enum values. + */ +ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname ); + +ALC_API void * ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname ); + +ALC_API ALCenum ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname ); + + +/* + * Query functions + */ +ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param ); + +ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *data ); + + +/* + * Capture functions + */ +ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize ); + +ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device ); + +ALC_API void ALC_APIENTRY alcCaptureStart( ALCdevice *device ); + +ALC_API void ALC_APIENTRY alcCaptureStop( ALCdevice *device ); + +ALC_API void ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples ); + +/* FIXME: see above */ +/* #else */ /* ALC_NO_PROTOTYPES */ + +typedef ALCcontext * (ALC_APIENTRY *LPALCCREATECONTEXT) (ALCdevice *device, const ALCint *attrlist); +typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)( ALCcontext *context ); +typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)( ALCcontext *context ); +typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)( ALCcontext *context ); +typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)( ALCcontext *context ); +typedef ALCcontext * (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)( ALCvoid ); +typedef ALCdevice * (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)( ALCcontext *context ); +typedef ALCdevice * (ALC_APIENTRY *LPALCOPENDEVICE)( const ALCchar *devicename ); +typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)( ALCdevice *device ); +typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)( ALCdevice *device ); +typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)( ALCdevice *device, const ALCchar *extname ); +typedef void * (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname ); +typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname ); +typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)( ALCdevice *device, ALCenum param ); +typedef void (ALC_APIENTRY *LPALCGETINTEGERV)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest ); +typedef ALCdevice * (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize ); +typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)( ALCdevice *device ); +typedef void (ALC_APIENTRY *LPALCCAPTURESTART)( ALCdevice *device ); +typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)( ALCdevice *device ); +typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples ); + +/* FIXME: see above */ +/* #endif */ /* ALC_NO_PROTOTYPES */ + +#if TARGET_OS_MAC + #pragma export off #endif -#ifdef __cplusplus +#if defined(__cplusplus) } #endif -#endif +#endif /* AL_ALC_H */ diff --git a/make/stub_includes/openal/alctypes.h b/make/stub_includes/openal/alctypes.h deleted file mode 100755 index 436fcfa..0000000 --- a/make/stub_includes/openal/alctypes.h +++ /dev/null @@ -1,125 +0,0 @@ -#ifndef _ALCTYPES_H_ -#define _ALCTYPES_H_ - -/** - * OpenAL cross platform audio library - * Copyright (C) 1999-2000 by authors. - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * Or go to http://www.gnu.org/copyleft/lgpl.html - */ - - -#ifdef __cplusplus -extern "C" { -#endif - -/** ALC boolean type. */ -typedef char ALCboolean; - -/** ALC 8bit signed byte. */ -typedef char ALCbyte; - -/** ALC 8bit unsigned byte. */ -typedef unsigned char ALCubyte; - -/** ALC 16bit signed short integer type. */ -typedef short ALCshort; - -/** ALC 16bit unsigned short integer type. */ -typedef unsigned short ALCushort; - -/** ALC 32bit unsigned integer type. */ -typedef unsigned ALCuint; - -/** ALC 32bit signed integer type. */ -typedef int ALCint; - -/** ALC 32bit floating point type. */ -typedef float ALCfloat; - -/** ALC 64bit double point type. */ -typedef double ALCdouble; - -/** ALC 32bit type. */ -typedef unsigned int ALCsizei; - -/** ALC void type */ -typedef void ALCvoid; - -/** ALC enumerations. */ -typedef int ALCenum; - -/* Bad value. */ -#define ALC_INVALID (-1) - -/* Boolean False. */ -#define ALC_FALSE 0 - -/* Boolean True. */ -#define ALC_TRUE 1 - -/** Errors: No Error. */ -#define ALC_NO_ERROR ALC_FALSE - -#define ALC_MAJOR_VERSION 0x1000 -#define ALC_MINOR_VERSION 0x1001 -#define ALC_ATTRIBUTES_SIZE 0x1002 -#define ALC_ALL_ATTRIBUTES 0x1003 - -#define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004 -#define ALC_DEVICE_SPECIFIER 0x1005 -#define ALC_EXTENSIONS 0x1006 - -#define ALC_FREQUENCY 0x1007 -#define ALC_REFRESH 0x1008 -#define ALC_SYNC 0x1009 - -/** - * The device argument does not name a valid dvice. - */ -#define ALC_INVALID_DEVICE 0xA001 - -/** - * The context argument does not name a valid context. - */ -#define ALC_INVALID_CONTEXT 0xA002 - -/** - * A function was called at inappropriate time, - * or in an inappropriate way, causing an illegal state. - * This can be an incompatible ALenum, object ID, - * and/or function. - */ -#define ALC_INVALID_ENUM 0xA003 - -/** - * Illegal value passed as an argument to an AL call. - * Applies to parameter values, but not to enumerations. - */ -#define ALC_INVALID_VALUE 0xA004 - -/** - * A function could not be completed, - * because there is not enough memory available. - */ -#define ALC_OUT_OF_MEMORY 0xA005 - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/make/stub_includes/openal/altypes.h b/make/stub_includes/openal/altypes.h deleted file mode 100755 index 8aa99c6..0000000 --- a/make/stub_includes/openal/altypes.h +++ /dev/null @@ -1,332 +0,0 @@ -#ifndef _ALTYPES_H_ -#define _ALTYPES_H_ - -/** - * OpenAL cross platform audio library - * Copyright (C) 1999-2000 by authors. - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * Or go to http://www.gnu.org/copyleft/lgpl.html - */ - - -#ifdef __cplusplus -extern "C" { -#endif - -/** OpenAL boolean type. */ -typedef char ALboolean; - -/** OpenAL 8bit signed byte. */ -typedef char ALbyte; - -/** OpenAL 8bit unsigned byte. */ -typedef unsigned char ALubyte; - -/** OpenAL 16bit signed short integer type. */ -typedef short ALshort; - -/** OpenAL 16bit unsigned short integer type. */ -typedef unsigned short ALushort; - -/** OpenAL 32bit unsigned integer type. */ -typedef unsigned ALuint; - -/** OpenAL 32bit signed integer type. */ -typedef int ALint; - -/** OpenAL 32bit floating point type. */ -typedef float ALfloat; - -/** OpenAL 64bit double point type. */ -typedef double ALdouble; - -/** OpenAL 32bit type. */ -typedef unsigned int ALsizei; - -/** OpenAL void type */ -typedef void ALvoid; - -/** OpenAL enumerations. */ -typedef int ALenum; - -/* Bad value. */ -#define AL_INVALID (-1) - -/* Disable value. */ -#define AL_NONE 0 - -/* Boolean False. */ -#define AL_FALSE 0 - -/* Boolean True. */ -#define AL_TRUE 1 - -/** - * Indicate the type of AL_SOURCE. - * Sources can be spatialized - */ -#define AL_SOURCE_TYPE 0x200 - -/** Indicate source has absolute coordinates. */ -#define AL_SOURCE_ABSOLUTE 0x201 - -/** Indicate Source has listener relative coordinates. */ -#define AL_SOURCE_RELATIVE 0x202 - -/** - * Directional source, inner cone angle, in degrees. - * Range: [0-360] - * Default: 360 - */ -#define AL_CONE_INNER_ANGLE 0x1001 - -/** - * Directional source, outer cone angle, in degrees. - * Range: [0-360] - * Default: 360 - */ -#define AL_CONE_OUTER_ANGLE 0x1002 - -/** - * Specify the pitch to be applied, either at source, - * or on mixer results, at listener. - * Range: [0.5-2.0] - * Default: 1.0 - */ -#define AL_PITCH 0x1003 - -/** - * Specify the current location in three dimensional space. - * OpenAL, like OpenGL, uses a right handed coordinate system, - * where in a frontal default view X (thumb) points right, - * Y points up (index finger), and Z points towards the - * viewer/camera (middle finger). - * To switch from a left handed coordinate system, flip the - * sign on the Z coordinate. - * Listener position is always in the world coordinate system. - */ -#define AL_POSITION 0x1004 - -/** Specify the current direction as forward vector. */ -#define AL_DIRECTION 0x1005 - -/** Specify the current velocity in three dimensional space. */ -#define AL_VELOCITY 0x1006 - -/** - * Indicate whether source has to loop infinite. - * Type: ALboolean - * Range: [AL_TRUE, AL_FALSE] - * Default: AL_FALSE - */ -#define AL_LOOPING 0x1007 - -/** - * Indicate the buffer to provide sound samples. - * Type: ALuint. - * Range: any valid Buffer id. - */ -#define AL_BUFFER 0x1009 - -/** - * Indicate the gain (volume amplification) applied. - * Type: ALfloat. - * Range: ]0.0- ] - * A value of 1.0 means un-attenuated/unchanged. - * Each division by 2 equals an attenuation of -6dB. - * Each multiplicaton with 2 equals an amplification of +6dB. - * A value of 0.0 is meaningless with respect to a logarithmic - * scale; it is interpreted as zero volume - the channel - * is effectively disabled. - */ -#define AL_GAIN 0x100A - -/** - * Indicate minimum source attenuation. - * Type: ALfloat - * Range: [0.0 - 1.0] - */ -#define AL_MIN_GAIN 0x100D - -/** - * Indicate maximum source attenuation. - * Type: ALfloat - * Range: [0.0 - 1.0] - */ -#define AL_MAX_GAIN 0x100E - -/** - * Specify the current orientation. - * Type: ALfv6 (at/up) - * Range: N/A - */ -#define AL_ORIENTATION 0x100F - -/* byte offset into source (in canon format). -1 if source - * is not playing. Don't set this, get this. - * - * Type: ALfloat - * Range: [0.0 - ] - * Default: 1.0 - */ -#define AL_REFERENCE_DISTANCE 0x1020 - - /** - * Indicate the rolloff factor for the source. - * Type: ALfloat - * Range: [0.0 - ] - * Default: 1.0 - */ -#define AL_ROLLOFF_FACTOR 0x1021 - -/** - * Indicate the gain (volume amplification) applied. - * Type: ALfloat. - * Range: ]0.0- ] - * A value of 1.0 means un-attenuated/unchanged. - * Each division by 2 equals an attenuation of -6dB. - * Each multiplicaton with 2 equals an amplification of +6dB. - * A value of 0.0 is meaningless with respect to a logarithmic - * scale; it is interpreted as zero volume - the channel - * is effectively disabled. - */ -#define AL_CONE_OUTER_GAIN 0x1022 - -/** - * Specify the maximum distance. - * Type: ALfloat - * Range: [0.0 - ] - */ -#define AL_MAX_DISTANCE 0x1023 - -/** - * Specify the channel mask. (Creative) - * Type: ALuint - * Range: [0 - 255] - */ -#define AL_CHANNEL_MASK 0x3000 - -/** - * Source state information - */ -#define AL_SOURCE_STATE 0x1010 -#define AL_INITIAL 0x1011 -#define AL_PLAYING 0x1012 -#define AL_PAUSED 0x1013 -#define AL_STOPPED 0x1014 - -/** - * Buffer Queue params - */ -#define AL_BUFFERS_QUEUED 0x1015 -#define AL_BUFFERS_PROCESSED 0x1016 - -/** Sound buffers: format specifier. */ -#define AL_FORMAT_MONO8 0x1100 -#define AL_FORMAT_MONO16 0x1101 -#define AL_FORMAT_STEREO8 0x1102 -#define AL_FORMAT_STEREO16 0x1103 - -/** - * Sound buffers: frequency, in units of Hertz [Hz]. - * This is the number of samples per second. Half of the - * sample frequency marks the maximum significant - * frequency component. - */ -#define AL_FREQUENCY 0x2001 -#define AL_BITS 0x2002 -#define AL_CHANNELS 0x2003 -#define AL_SIZE 0x2004 -#define AL_DATA 0x2005 - -/** - * Buffer state. - * - * Not supported for public use (yet). - */ -#define AL_UNUSED 0x2010 -#define AL_PENDING 0x2011 -#define AL_PROCESSED 0x2012 - -/** Errors: No Error. */ -#define AL_NO_ERROR AL_FALSE - -/** - * Illegal name passed as an argument to an AL call. - */ -#define AL_INVALID_NAME 0xA001 - -/** - * Illegal enum passed as an argument to an AL call. - */ -#define AL_INVALID_ENUM 0xA002 -/** - * Illegal value passed as an argument to an AL call. - * Applies to parameter values, but not to enumerations. - */ -#define AL_INVALID_VALUE 0xA003 - -/** - * A function was called at inappropriate time, - * or in an inappropriate way, causing an illegal state. - * This can be an incompatible ALenum, object ID, - * and/or function. - */ -#define AL_INVALID_OPERATION 0xA004 - -/** - * A function could not be completed, - * because there is not enough memory available. - */ -#define AL_OUT_OF_MEMORY 0xA005 - -/** Context strings: Vendor Name. */ -#define AL_VENDOR 0xB001 -#define AL_VERSION 0xB002 -#define AL_RENDERER 0xB003 -#define AL_EXTENSIONS 0xB004 - -/** Global tweakage. */ - -/** - * Doppler scale. Default 1.0 - */ -#define AL_DOPPLER_FACTOR 0xC000 - -/** - * Doppler velocity. Default 1.0 - */ -#define AL_DOPPLER_VELOCITY 0xC001 - -/** - * Distance model. Default AL_INVERSE_DISTANCE_CLAMPED - */ -#define AL_DISTANCE_MODEL 0xD000 - -/** Distance models. */ - -#define AL_INVERSE_DISTANCE 0xD001 -#define AL_INVERSE_DISTANCE_CLAMPED 0xD002 - - /** - * enables - */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/make/stub_includes/openal/alu.h b/make/stub_includes/openal/alu.h deleted file mode 100755 index c6adff6..0000000 --- a/make/stub_includes/openal/alu.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef _ALU_H_ -#define _ALU_H_ - -#define ALUAPI -#define ALUAPIENTRY __cdecl - -#define BUFFERSIZE 48000 -#define FRACTIONBITS 14 -#define FRACTIONMASK ((1L<<FRACTIONBITS)-1) -#define OUTPUTCHANNELS 2 - -#include "altypes.h" - -#ifdef __cplusplus -extern "C" { -#endif - -ALUAPI ALint ALUAPIENTRY aluF2L(ALfloat value); -ALUAPI ALshort ALUAPIENTRY aluF2S(ALfloat value); -ALUAPI ALvoid ALUAPIENTRY aluCrossproduct(ALfloat *inVector1,ALfloat *inVector2,ALfloat *outVector); -ALUAPI ALfloat ALUAPIENTRY aluDotproduct(ALfloat *inVector1,ALfloat *inVector2); -ALUAPI ALvoid ALUAPIENTRY aluNormalize(ALfloat *inVector); -ALUAPI ALvoid ALUAPIENTRY aluMatrixVector(ALfloat matrix[3][3],ALfloat *vector); -ALUAPI ALvoid ALUAPIENTRY aluCalculateSourceParameters(ALuint source,ALuint channels,ALfloat *drysend,ALfloat *wetsend,ALfloat *pitch); -ALUAPI ALvoid ALUAPIENTRY aluMixData(ALvoid *context,ALvoid *buffer,ALsizei size,ALenum format); -ALUAPI ALvoid ALUAPIENTRY aluSetReverb(ALvoid *Reverb,ALuint Environment); -ALUAPI ALvoid ALUAPIENTRY aluReverb(ALvoid *Reverb,ALfloat Buffer[][2],ALsizei BufferSize); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/make/stub_includes/openal/alut.h b/make/stub_includes/openal/alut.h index 92f5635..7a33ccb 100755 --- a/make/stub_includes/openal/alut.h +++ b/make/stub_includes/openal/alut.h @@ -1,23 +1,67 @@ -#ifndef _ALUT_H_ -#define _ALUT_H_ +#ifndef _AL_ALUT_H +#define _AL_ALUT_H -#define ALUTAPI -#define ALUTAPIENTRY __cdecl +#include <al.h> -#include "al.h" -#include "alu.h" +#if defined(_WIN32) && !defined(_XBOX) && 0 + #if defined (_OPENAL32LIB) + #define ALUTAPI __declspec(dllexport) + #else + #define ALUTAPI __declspec(dllimport) + #endif +#else + #define ALUTAPI extern +#endif + +#if defined(_WIN32) + #define ALUTAPIENTRY __cdecl +#else + #define ALUTAPIENTRY +#endif -#ifdef __cplusplus +#if TARGET_OS_MAC + #pragma export on +#endif + +#if defined(__cplusplus) extern "C" { #endif -ALUTAPI ALvoid ALUTAPIENTRY alutInit(ALint *argc,ALbyte **argv); -ALUTAPI ALvoid ALUTAPIENTRY alutExit(ALvoid); -ALUTAPI ALvoid ALUTAPIENTRY alutLoadWAVFile(ALbyte *file,ALenum *format,ALvoid **data,ALsizei *size,ALsizei *freq,ALboolean *loop); -ALUTAPI ALvoid ALUTAPIENTRY alutLoadWAVMemory(ALbyte *memory,ALenum *format,ALvoid **data,ALsizei *size,ALsizei *freq,ALboolean *loop); -ALUTAPI ALvoid ALUTAPIENTRY alutUnloadWAV(ALenum format,ALvoid *data,ALsizei size,ALsizei freq); +#if !defined(ALUT_NO_PROTOTYPES) + +ALUTAPI void ALUTAPIENTRY alutInit( int *argc, char *argv[] ); +ALUTAPI void ALUTAPIENTRY alutExit( void ); + +#if defined(MACINTOSH_AL) +/* Windows and Linux versions have a loop parameter, Macintosh doesn't */ +ALUTAPI void ALUTAPIENTRY alutLoadWAVFile( const ALbyte *file, ALenum *format, ALvoid **data, ALsizei *size, ALsizei *freq ); +ALUTAPI void ALUTAPIENTRY alutLoadWAVMemory( const ALbyte *memory, ALenum *format, ALvoid **data, ALsizei *size, ALsizei *freq ); +#else +ALUTAPI void ALUTAPIENTRY alutLoadWAVFile( const ALbyte *file, ALenum *format, ALvoid **data, ALsizei *size, ALsizei *freq, ALboolean *loop ); +ALUTAPI void ALUTAPIENTRY alutLoadWAVMemory( const ALbyte *memory, ALenum *format, ALvoid **data, ALsizei *size, ALsizei *freq, ALboolean *loop ); +#endif +ALUTAPI void ALUTAPIENTRY alutUnloadWAV( ALenum format, ALvoid *data, ALsizei size, ALsizei freq ); + +#else /* ALUT_NO_PROTOTYPES */ + +ALUTAPI void (ALUTAPIENTRY *alutInit)( int *argc, char *argv[] ); +ALUTAPI void (ALUTAPIENTRY *alutExit)( void ); +#if defined(MACINTOSH_AL) +ALUTAPI void (ALUTAPIENTRY *alutLoadWAVFile)( const ALbyte *file, ALenum *format, ALvoid **data, ALsizei *size, ALsizei *freq ); +ALUTAPI void (ALUTAPIENTRY *alutLoadWAVMemory)( const ALbyte *memory, ALenum *format, ALvoid **data, ALsizei *size, ALsizei *freq ); +#else +ALUTAPI void (ALUTAPIENTRY *alutLoadWAVFile)( const ALbyte *file, ALenum *format, ALvoid **data, ALsizei *size, ALsizei *freq, ALboolean *loop ); +ALUTAPI void (ALUTAPIENTRY *alutLoadWAVMemory)( const ALbyte *memory, ALenum *format, ALvoid **data, ALsizei *size, ALsizei *freq, ALboolean *loop ); +#endif +ALUTAPI void (ALUTAPIENTRY *alutUnloadWAV)( ALenum format, ALvoid *data, ALsizei size, ALsizei freq ); + +#endif /* ALUT_NO_PROTOTYPES */ + +#if TARGET_OS_MAC + #pragma export off +#endif -#ifdef __cplusplus +#if defined(__cplusplus) } #endif diff --git a/make/stub_includes/openal/eax.h b/make/stub_includes/openal/eax.h index bf6f5cd..bf0d9b6 100644 --- a/make/stub_includes/openal/eax.h +++ b/make/stub_includes/openal/eax.h @@ -5,7 +5,7 @@ #include "windows.h" #endif -#include "altypes.h" +#include "al.h" #ifdef _WIN32 DEFINE_GUID(DSPROPSETID_EAX20_ListenerProperties, |