summaryrefslogtreecommitdiffstats
path: root/make/joal-alc.cfg
blob: 21f744979f993288316e8f63041c8cf9a1c115ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# This .cfg file is used to generate the JOAL interface.
Include joal-common.cfg

Style InterfaceAndImpl
JavaClass ALC
ImplPackage net.java.games.joal.impl
ImplJavaClass ALCImpl
Extends ALC ALCConstants

EmitProcAddressTable true
ProcAddressTableClassName ALCProcAddressTable
GetProcAddressTableExpr ALProcAddressLookup.getALCProcAddressTable()
ProcAddressNameExpr LP $UPPERCASE({0})

Import java.io.UnsupportedEncodingException
Import java.util.*
Import net.java.games.joal.*
Import net.java.games.joal.impl.*

# Factor out the OpenAL constants into their own interface
Ignore ^AL_.+
Ignore ^ALC_.+

# 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

# Move the body of alcGetString to a private method so we can
# implement alcGetString(NULL, ALC_DEVICE_SPECIFIER) in another method
RenameJavaMethod alcGetString alcGetStringImpl
# Specify the return length of this function with our own custom strlen
ReturnValueCapacity alcGetString strlen_alc(_ptr0, {1}, _res)

# Note that we don't declare this as "ReturnsString" because we're
# going to wrap it in another method
IncludeAs CustomJavaCode ALC     joal-alc-CustomJavaCode.java
IncludeAs CustomJavaCode ALCImpl joal-alc-impl-CustomJavaCode.java

# These routines use strings
ArgumentIsString alcIsExtensionPresent 1
ArgumentIsString alcOpenDevice 0

# Mappings for data types
Opaque boolean ALCboolean

# Provide #includes to native code
CustomCCode #include "alc.h"

# Indicate that the direct buffers for ALCcontext, etc. are "opaque",
# i.e., the user shouldn't be poking around in them
ReturnValueCapacity alcCreateContext 0
ReturnValueCapacity alcGetContextsDevice 0
ReturnValueCapacity alcGetCurrentContext 0
ReturnValueCapacity alcGetCurrentDevice 0
ReturnValueCapacity alcOpenDevice 0

# Need a prologue on alcOpenDevice and epilogue on alcMakeContextCurrent
# to set up the proc address tables the first time
JavaPrologue alcOpenDevice ALProcAddressLookup.resetALCProcAddressTable();
JavaEpilogue alcMakeContextCurrent ALProcAddressLookup.resetALProcAddressTable();

# To be able to use alcGetString before a context is created we need
# to instrument that routine as well
JavaPrologue alcGetString ALProcAddressLookup.resetALCProcAddressTable();

IncludeAs CustomCCode joal-common-CustomCCode.c
IncludeAs CustomCCode joal-alc-impl-CustomCCode.c