1
0
Fork 0
2022-untitled-game/code/game/engine/audio_mgr.h

35 lines
622 B
C
Raw Permalink Normal View History

2022-08-02 16:35:50 +00:00
#pragma once
typedef struct audio_listener {
vec3 position;
vec3 front;
vec3 up;
} audio_listener_t;
typedef struct audio_mgr {
int sound_count;
audio_listener_t listener;
audio_source_t sources[MAX_AUDIO_SOURCE_COUNT];
handle_t index_to_handle_map[MAX_AUDIO_SOURCE_COUNT];
handle_t handle_to_index_map[MAX_AUDIO_SOURCE_COUNT];
} audio_mgr_t;
void
audio_mgr_startup(void);
void
set_listener(vec3 position, vec3 front, vec3 up);
handle_t
play_sound(audio_source_t sound);
void
stop_sound(int handle);
void
update_sound_position(int handle, vec3 position);
void
fill_audio_buffer(uint8_t* buffer, int len);