mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
More work on custom device backends.
With this commit, custom backends can now be implemented as self-contained modules that can easily be plugged in and mixed and matched depending on a programs requirements. The order in which custom backends are specified in the context config determine their priority. This commit updates the custom_backend example by moving the SDL code out into its own file in "extras/backends/sdl". The example will now just include the SDL code files like normal. This represents a more realistic scenario.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
The SDL backend does not require any user data, nor configs. Configs are provided here in case
|
||||
they are needed in the future, however you can safely pass in NULL when setting up your context
|
||||
and device configs.
|
||||
*/
|
||||
#ifndef miniaudio_backend_sdl_h
|
||||
#define miniaudio_backend_sdl_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
MA_API const ma_device_backend_vtable* MA_DEVICE_BACKEND_VTABLE_SDL;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int _unused;
|
||||
} ma_context_config_sdl;
|
||||
|
||||
MA_API ma_context_config_sdl ma_context_config_sdl_init(void);
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int _unused;
|
||||
} ma_device_config_sdl;
|
||||
|
||||
MA_API ma_device_config_sdl ma_device_config_sdl_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* miniaudio_backend_sdl_h */
|
||||
Reference in New Issue
Block a user