From afa3632e8df813f54195c8a97833eff5c832d6ee Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Sat, 10 Jul 2010 17:33:11 +0200 Subject: fixed alcGetString functionpointer mapping (gluegen does not handle method renames correctly). ALCImpl is now ALCAbstractImpl. "Custom code" is now in ALCImpl which extends ALCAbstractImpl. --- make/joal-alc-impl-CustomJavaCode.java | 52 ---------------------------------- 1 file changed, 52 deletions(-) delete mode 100755 make/joal-alc-impl-CustomJavaCode.java (limited to 'make/joal-alc-impl-CustomJavaCode.java') diff --git a/make/joal-alc-impl-CustomJavaCode.java b/make/joal-alc-impl-CustomJavaCode.java deleted file mode 100755 index c6f8e92..0000000 --- a/make/joal-alc-impl-CustomJavaCode.java +++ /dev/null @@ -1,52 +0,0 @@ -public java.lang.String alcGetString(ALCdevice device, int param) { - if (device == null && param == ALC_DEVICE_SPECIFIER) { - throw new ALException("Call alcGetDeviceSpecifiers to fetch all available device names"); - } - - java.nio.ByteBuffer buf = alcGetStringImpl(device, param); - if (buf == null) { - return null; - } - byte[] res = new byte[buf.capacity()]; - buf.get(res); - try { - return new String(res, "US-ASCII"); - } catch (UnsupportedEncodingException e) { - throw new ALException(e); - } -} - -/** Fetches the names of the available ALC device specifiers. - Equivalent to the C call alcGetString(NULL, ALC_DEVICE_SPECIFIER). */ -public java.lang.String[] alcGetDeviceSpecifiers() { - return getDoubleNullTerminatedString(ALC_DEVICE_SPECIFIER); -} - -/** Fetches the names of the available ALC capture device specifiers. - Equivalent to the C call alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER). */ -public java.lang.String[] alcGetCaptureDeviceSpecifiers() { - return getDoubleNullTerminatedString(ALC_CAPTURE_DEVICE_SPECIFIER); -} - -private java.lang.String[] getDoubleNullTerminatedString(int which) { - java.nio.ByteBuffer buf = alcGetStringImpl(null, which); - if (buf == null) { - return null; - } - byte[] bytes = new byte[buf.capacity()]; - buf.get(bytes); - try { - ArrayList/**/ res = new ArrayList/**/(); - int i = 0; - while (i < bytes.length) { - int startIndex = i; - while ((i < bytes.length) && (bytes[i] != 0)) - i++; - res.add(new String(bytes, startIndex, i - startIndex, "US-ASCII")); - i++; - } - return (String[]) res.toArray(new String[0]); - } catch (UnsupportedEncodingException e) { - throw new ALException(e); - } -} -- cgit v1.2.3