Initial commit.

This commit is contained in:
2026-02-08 03:23:18 +01:00
commit 034b318059
10 changed files with 845 additions and 0 deletions

39
engine/ljud/bus.odin Normal file
View File

@@ -0,0 +1,39 @@
package ljud
import "core:log"
import "core:strings"
import ma "vendor:miniaudio"
Bus :: ma.sound_group
create_bus :: proc(engine: ^Engine) -> (^Bus, bool) {
assert(engine != nil)
b := new(Bus)
assert(b != nil)
result := ma.sound_group_init(
pEngine = &engine.ma_engine,
flags = {},
pParentGroup = nil, // TODO: SS - Support parent busses.
pGroup = b,
)
if result != .SUCCESS {
free(b)
return nil, false
}
ma.sound_group_set_spatialization_enabled(b, true) // TODO: SS - Needs to be configurable outside.
ma.sound_group_set_min_distance(b, 1.0) // TODO: SS - Needs to be configurable outside.
ma.sound_group_set_max_distance(b, 50) // TODO: SS - Needs to be configurable outside.
return b, true
}
destroy_bus :: proc(engine: ^Engine, bus: ^Bus) {
assert(engine != nil)
assert(bus != nil)
ma.sound_group_uninit(bus)
}