summaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
authorMichael Zucchi <[email protected]>2013-01-25 15:37:49 +0100
committerXerxes Rånby <[email protected]>2013-01-25 15:37:49 +0100
commit3cf2b66e13104b372611b3a9dbb722110370a9c7 (patch)
tree070bbe4e58f4661a601259e1ddfe6e96eefb3be4 /make
parent6b86449596dabf87201d7321799a39a7b78ab692 (diff)
Bug 567 (part 1): add support for openal extensions
Imported JOAL specific parts from the patch made by Michael Zucchi. Author: Michael Zucchi <[email protected]> Signed-off-by: Xerxes Rånby <[email protected]>
Diffstat (limited to 'make')
-rwxr-xr-xmake/build.xml21
-rw-r--r--make/joal-alext-constants.cfg9
-rw-r--r--make/joal-alext.cfg41
-rw-r--r--make/joal-alextabstract-CustomJavaCode.java12
4 files changed, 83 insertions, 0 deletions
diff --git a/make/build.xml b/make/build.xml
index 51c92d5..b2b0ec9 100755
--- a/make/build.xml
+++ b/make/build.xml
@@ -175,6 +175,8 @@
<property name="joal.constants.cfg" value="${config}/joal-constants.cfg" />
<property name="joal.alc.cfg" value="${config}/joal-alc.cfg" />
<property name="joal.alc.constants.cfg" value="${config}/joal-alc-constants.cfg" />
+ <property name="joal.alext.cfg" value="${config}/joal-alext.cfg" />
+ <property name="joal.alext.constants.cfg" value="${config}/joal-alext-constants.cfg" />
<!-- Create the required output directories. -->
<mkdir dir="${src.generated.java}" />
@@ -276,6 +278,25 @@
<classpath refid="gluegen.classpath" />
</gluegen>
+ <!-- Generate the ALExt interface class and implementation -->
+ <gluegen src="${stub.includes.openal}/alext.h"
+ outputRootDir="${build}"
+ config="${joal.alext.cfg}"
+ includeRefid="stub.includes.fileset.all"
+ emitter="com.jogamp.gluegen.procaddress.ProcAddressEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+
+ <!-- Generate the ALExt constants interface -->
+ <gluegen src="${stub.includes.openal}/alext.h"
+ outputRootDir="${build}"
+ config="${joal.alext.constants.cfg}"
+ includeRefid="stub.includes.fileset.all"
+ emitter="com.jogamp.gluegen.JavaEmitter">
+ <classpath refid="gluegen.classpath" />
+ </gluegen>
+
+
<!-- Inform the user that the generators have successfully created
- the necessary Java files -->
<echo message="" />
diff --git a/make/joal-alext-constants.cfg b/make/joal-alext-constants.cfg
new file mode 100644
index 0000000..e645bb8
--- /dev/null
+++ b/make/joal-alext-constants.cfg
@@ -0,0 +1,9 @@
+# This .cfg file is used to generate the ALCConstants interface.
+Include joal-common.cfg
+
+Style InterfaceOnly
+JavaClass ALExtConstants
+
+# Factor out the OpenAL constants into their own interface
+#IgnoreNot ^ALC_.+
+IgnoreNot ^AL.+
diff --git a/make/joal-alext.cfg b/make/joal-alext.cfg
new file mode 100644
index 0000000..4798f31
--- /dev/null
+++ b/make/joal-alext.cfg
@@ -0,0 +1,41 @@
+# This .cfg file is used to generate the JOAL interface.
+Include joal-common.cfg
+
+Style InterfaceAndImpl
+JavaClass ALExt
+ImplPackage jogamp.openal
+ImplJavaClass ALExtAbstractImpl
+AccessControl ALExtAbstractImpl PUBLIC_ABSTRACT
+Extends ALExt ALExtConstants
+
+EmitProcAddressTable true
+ProcAddressTableClassName ALExtProcAddressTable
+GetProcAddressTableExpr alExtProcAddressTable
+ProcAddressNameExpr LP $UPPERCASE({0})
+
+Import java.io.UnsupportedEncodingException
+Import java.util.*
+Import com.jogamp.openal.*
+Import jogamp.openal.*
+
+# Factor out the OpenAL constants into their own interface
+Ignore ^AL_.+
+Ignore ^ALC_.+
+
+IncludeAs CustomJavaCode ALExtAbstractImpl joal-alextabstract-CustomJavaCode.java
+
+# Mappings for data types
+Opaque boolean ALCboolean
+
+# These routines use or return strings
+ArgumentIsString alcLoopbackOpenDeviceSOFT 0
+
+# Provide #includes to native code
+CustomCCode #include "alext.h"
+
+# Indicate that the direct buffers for ALCcontext, etc. are "opaque",
+# i.e., the user shouldn't be poking around in them
+ReturnValueCapacity alcLoopbackOpenDeviceSOFT 0
+
+IncludeAs CustomCCode joal-common-CustomCCode.c
+
diff --git a/make/joal-alextabstract-CustomJavaCode.java b/make/joal-alextabstract-CustomJavaCode.java
new file mode 100644
index 0000000..e73dc60
--- /dev/null
+++ b/make/joal-alextabstract-CustomJavaCode.java
@@ -0,0 +1,12 @@
+private static final ALExtProcAddressTable alExtProcAddressTable;
+
+static {
+ alExtProcAddressTable = new ALExtProcAddressTable();
+ if(null==alExtProcAddressTable) {
+ throw new RuntimeException("Couldn't instantiate ALExtProcAddressTable");
+ }
+ alExtProcAddressTable.reset(ALImpl.alDynamicLookupHelper);
+}
+
+public static ALExtProcAddressTable getALExtProcAddressTable() { return alExtProcAddressTable; }
+