mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-07-05 06:00:33 -04:00
sound, music, mixer
This commit is contained in:
parent
42087c926c
commit
f8a1501289
42 changed files with 1345 additions and 157 deletions
|
@ -15,7 +15,7 @@ public:
|
|||
|
||||
SDLContext();
|
||||
|
||||
struct Config {
|
||||
struct VideoConfig {
|
||||
int window_width;
|
||||
int window_height;
|
||||
bool crt_filter;
|
||||
|
@ -26,11 +26,22 @@ public:
|
|||
int aspect_y;
|
||||
};
|
||||
|
||||
struct AudioConfig {
|
||||
const char *audioDevice;
|
||||
};
|
||||
|
||||
void init_video(const Config &config, const char *title);
|
||||
struct AudioInfo {
|
||||
int freq;
|
||||
};
|
||||
|
||||
void init_video(const VideoConfig &config, const char *title);
|
||||
|
||||
void close_video();
|
||||
|
||||
AudioInfo init_audio(const AudioConfig &config, SDL_AudioCallback cb, void *cb_ctx);
|
||||
void pause_audio(bool pause);
|
||||
void close_audio();
|
||||
|
||||
|
||||
void present_rect(uint16_t *pixels, unsigned int pitch, unsigned int x, unsigned int y, unsigned int xs,unsigned ys);
|
||||
void swap_render_buffers();
|
||||
|
@ -99,6 +110,12 @@ protected:
|
|||
slide_transition
|
||||
};
|
||||
|
||||
struct SDL_Audio_Deleter {
|
||||
void operator()(void *x);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
MS_EVENT ms_event;
|
||||
mutable std::mutex _mx;
|
||||
|
@ -112,6 +129,7 @@ protected:
|
|||
std::unique_ptr<SDL_Texture, SDL_Deleter> _texture;
|
||||
std::unique_ptr<SDL_Texture, SDL_Deleter> _texture2;
|
||||
std::unique_ptr<SDL_Texture, SDL_Deleter> _crt_effect;
|
||||
std::unique_ptr<void, SDL_Audio_Deleter> _audio;
|
||||
SDL_Texture *_visible_texture;
|
||||
SDL_Texture *_hidden_texture;
|
||||
|
||||
|
@ -125,6 +143,7 @@ protected:
|
|||
std::atomic<bool> _quit_requested = false;
|
||||
|
||||
|
||||
|
||||
std::vector<char> _display_update_queue;
|
||||
using QueueIter = const char *;
|
||||
std::queue<uint16_t> _keyboard_queue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue