audio_set() -> audio_set_parameter(), with string based convention

This commit is contained in:
veclavtalica
2024-10-22 13:52:24 +03:00
parent 5a08c01208
commit b390e9db23
6 changed files with 25 additions and 38 deletions

View File

@ -15,13 +15,8 @@ TWN_API void audio_play(const char *path,
float volume, /* default: 1.0f, range: 0.0f to 1.0f */
float panning); /* default: 0.0f, range: -1.0 to 1.0f */
typedef enum {
AUDIO_PARAM_REPEAT,
AUDIO_PARAM_VOLUME,
AUDIO_PARAM_PANNING,
} AudioParam;
TWN_API void audio_set(const char *channel, AudioParam param, float value);
/* possible parameter options: "volume", "panning", "repeat" */
TWN_API void audio_set_parameter(const char *channel, const char *parameter, float value);
/* TODO */
// TWN_API bool audio_ended(const char *channel);

View File

@ -37,12 +37,12 @@ TWN_API int draw_text_width(char const *string,
int height_px, /* TODO: make optional */
char const *font);
TWN_API void draw_9slice(char const *texture_path,
int texture_w,
int texture_h,
int border_thickness,
Rect rect,
Color color); /* TODO: make optional */
TWN_API void draw_nine_slice(char const *texture_path,
int texture_w,
int texture_h,
int border_thickness,
Rect rect,
Color color); /* TODO: make optional */
/* pushes a textured 3d triangle onto the render queue */
/* vertices are in absolute coordinates, relative to world origin */

View File

@ -1,7 +1,9 @@
#ifndef TWN_ENGINE_API_H
#define TWN_ENGINE_API_H
#if defined(__WIN32)
#if defined(TWN_NOT_C)
#define TWN_API
#elif defined(__WIN32)
#define TWN_API __declspec(dllexport)
#else
#define TWN_API __attribute__((visibility("default")))