Skip to content

Commit

Permalink
feat(api): [openal] update
Browse files Browse the repository at this point in the history
  • Loading branch information
squid233 committed Jan 24, 2025
1 parent 57319ef commit 3961f9d
Show file tree
Hide file tree
Showing 119 changed files with 5,847 additions and 10,029 deletions.
2,215 changes: 0 additions & 2,215 deletions generators/openal/src/main/kotlin/overrungl/openal/ALExt.kt

This file was deleted.

855 changes: 0 additions & 855 deletions generators/openal/src/main/kotlin/overrungl/openal/EFX.kt

This file was deleted.

101 changes: 13 additions & 88 deletions generators/openal/src/main/kotlin/overrungl/openal/OpenALGenerator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,99 +16,24 @@

package overrungl.openal

import overrungl.gen.*
import overrungl.gen.file.*

val ALboolean = jboolean c "ALboolean"
val ALint = int c "ALint"
val ALuint = uint c "ALuint"
val ALsizei = int c "ALsizei"
val ALenum = int c "ALenum"
val ALfloat = float c "ALfloat"
val ALdouble = double c "ALdouble"

val ALvoid_ptr = address c "ALvoid *"
val ALvoid_ptr_ptr = address c "ALvoid **"
val ALboolean_ptr = address c "ALboolean *"
val ALchar_ptr = string_u8 c "ALchar*"
val ALint_ptr = jint_array c "ALint *"
val ALuint_ptr = jint_array c "ALuint *"
val ALsizei_ptr = jint_array c "ALsizei *"
val ALenum_ptr = jint_array c "ALenum *"
val ALfloat_ptr = jfloat_array c "ALfloat *"
val ALdouble_ptr = jdouble_array c "ALdouble *"

val const_ALuint = uint c "const ALuint"

val const_ALvoid_ptr = address c "const ALvoid *"
val const_ALchar_ptr = string_u8 c "const ALchar*"
val const_ALint_ptr = address c "const ALint *"
val const_ALuint_ptr = address c "const ALuint *"
val const_ALenum_ptr = address c "const ALenum *"
val const_ALfloat_ptr = address c "const ALfloat *"
val const_ALdouble_ptr = address c "const ALdouble *"


val ALCdevice_ptr = address c "ALCdevice *"
val ALCcontext_ptr = address c "ALCcontext *"

val ALCboolean = jboolean c "ALCboolean"
val ALCsizei = int c "ALCsizei"
val ALCenum = int c "ALCenum"

val ALCvoid_ptr = address c "ALCvoid *"

val const_ALCchar_ptr = string_u8 c "const ALCchar*"
val const_ALCint_ptr = address c "const ALCint *"
val const_ALCenum_ptr = address c "const ALCenum *"

val ALint64SOFT = jlong c "ALint64SOFT"
val ALint64SOFT_ptr = address c "ALint64SOFT *"
val const_ALint64SOFT_ptr = address c "const ALint64SOFT *"

val ALCint64SOFT_ptr = address c "ALCint64SOFT *"

import overrungl.gen.file.DefinitionFile
import overrungl.gen.file.char_boolean
import overrungl.gen.file.registerDefType
import overrungl.gen.writeNativeImageRegistration

const val alPackage = "overrungl.openal"
const val alLookup = "ALInternal.lookup()"

fun main() {
alext()
efx()

registerDefType("ALboolean", c_char)
registerDefType("ALchar", c_char)
registerDefType("ALbyte", c_signed_char)
registerDefType("ALubyte", c_unsigned_char)
registerDefType("ALshort", c_short)
registerDefType("ALushort", c_unsigned_short)
registerDefType("ALint", c_int)
registerDefType("ALuint", c_unsigned_int)
registerDefType("ALsizei", c_int)
registerDefType("ALenum", c_int)
registerDefType("ALfloat", c_float)
registerDefType("ALdouble", c_double)
registerDefType("ALvoid", VoidType)

registerDefType("ALCboolean", c_char)
registerDefType("ALCchar", c_char)
registerDefType("ALCbyte", c_signed_char)
registerDefType("ALCubyte", c_unsigned_char)
registerDefType("ALCshort", c_short)
registerDefType("ALCushort", c_unsigned_short)
registerDefType("ALCint", c_int)
registerDefType("ALCuint", c_unsigned_int)
registerDefType("ALCsizei", c_int)
registerDefType("ALCenum", c_int)
registerDefType("ALCfloat", c_float)
registerDefType("ALCdouble", c_double)
registerDefType("ALCvoid", VoidType)

registerDefType("_alsoft_int64_t", int64_t)
registerDefType("_alsoft_uint64_t", overrungl.gen.file.uint64_t)

DefinitionFile("al.gen").compile(alPackage, "AL", alLookup)
DefinitionFile("alc.gen").compile(alPackage, "ALC", alLookup)
registerDefType("ALboolean", char_boolean)
registerDefType("ALCboolean", char_boolean)

val al = DefinitionFile("al.gen")
val alc = DefinitionFile("alc.gen")
val alext = DefinitionFile("alext.gen")
al.compile(alPackage, "AL", alLookup)
alc.compile(alPackage, "ALC", alLookup)
alext.compile(alPackage, "ALExt", alLookup)

writeNativeImageRegistration(alPackage)
}
24 changes: 12 additions & 12 deletions generators/openal/src/main/resources/al.gen
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// al.h

using ALboolean = java ALboolean;
using ALchar = java ALchar;
using ALbyte = java ALbyte;
using ALubyte = java ALubyte;
using ALshort = java ALshort;
using ALushort = java ALushort;
using ALint = java ALint;
using ALuint = java ALuint;
using ALsizei = java ALsizei;
using ALenum = java ALenum;
using ALfloat = java ALfloat;
using ALdouble = java ALdouble;
using ALvoid = java ALvoid;
using ALchar = char;
using ALbyte = signed char;
using ALubyte = unsigned char;
using ALshort = short;
using ALushort = unsigned short;
using ALint = int;
using ALuint = unsigned int;
using ALsizei = int;
using ALenum = int;
using ALfloat = float;
using ALdouble = double;
using ALvoid = void;

#define AL_NONE 0
#define AL_FALSE 0
Expand Down
24 changes: 12 additions & 12 deletions generators/openal/src/main/resources/alc.gen
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
using ALCdevice = struct ALCdevice;
using ALCcontext = struct ALCcontext;
using ALCboolean = java ALCboolean;
using ALCchar = java ALCchar;
using ALCbyte = java ALCbyte;
using ALCubyte = java ALCubyte;
using ALCshort = java ALCshort;
using ALCushort = java ALCushort;
using ALCint = java ALCint;
using ALCuint = java ALCuint;
using ALCsizei = java ALCsizei;
using ALCenum = java ALCenum;
using ALCfloat = java ALCfloat;
using ALCdouble = java ALCdouble;
using ALCvoid = java ALCvoid;
using ALCchar = char;
using ALCbyte = signed char;
using ALCubyte = unsigned char;
using ALCshort = short;
using ALCushort = unsigned short;
using ALCint = int;
using ALCuint = unsigned int;
using ALCsizei = int;
using ALCenum = int;
using ALCfloat = float;
using ALCdouble = double;
using ALCvoid = void;

#define ALC_FALSE 0
#define ALC_TRUE 1
Expand Down
Loading

0 comments on commit 3961f9d

Please sign in to comment.