67 lines
2.4 KiB
C
67 lines
2.4 KiB
C
#ifndef GAME_H
|
|
#define GAME_H
|
|
|
|
#include "AssetManager.h"
|
|
#include "ObjectStore.h"
|
|
#include "SDL_pixels.h"
|
|
#include "reusable_ids.h"
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif // !__cplusplus
|
|
|
|
bool init_engine(const char *game_name, uint32_t window_width,
|
|
uint32_t window_height, SDL_Color window_background_color,
|
|
bool full_screen, uint8_t audio_tracks);
|
|
bool game_running();
|
|
ObjectID add_object(void *object, EventHandlerPtr eh, UpdateFuncPtr uf,
|
|
RenderFuncPtr rf);
|
|
void remove_object(ObjectID *id);
|
|
AssetID load_asset(const char *path, AssetType type);
|
|
void render_texture_asset(AssetID id, float x, float y, float w, float h);
|
|
void render_text_with_font_asset(AssetID id, const char *text, float x,
|
|
float y);
|
|
void set_font_asset_size(AssetID id, uint32_t size);
|
|
int8_t play_audio_asset(AssetID id, int16_t loops, bool fade_in,
|
|
uint32_t fade_length_in_ms);
|
|
void pause_audio_asset_on_track(AssetID id, uint8_t track);
|
|
void resume_audio_asset_on_track(AssetID id, uint8_t track);
|
|
void stop_audio_asset_on_track(AssetID id, uint8_t track);
|
|
void fade_out_audio_asset_on_track(AssetID id, uint8_t track,
|
|
uint32_t fade_length_in_ms);
|
|
void pause_all_instances_of_audio_asset(AssetID id);
|
|
void resume_all_instances_of_audio_asset(AssetID id);
|
|
void stop_all_instances_of_audio_asset(AssetID id);
|
|
void fade_out_all_instances_of_audio_asset(AssetID id,
|
|
uint32_t fade_length_in_ms);
|
|
int8_t get_audio_asset_volume(AssetID id);
|
|
void set_audio_asset_volume(AssetID id, int8_t volume);
|
|
void play_music_asset(AssetID id, int16_t loops, bool fade_in,
|
|
uint32_t fade_length_in_ms);
|
|
void pause_music_asset(AssetID id);
|
|
void resume_music_asset(AssetID id);
|
|
void stop_music_asset(AssetID id);
|
|
void fade_out_music_asset(AssetID id, uint32_t fade_length_in_ms);
|
|
int8_t get_music_asset_volume(AssetID id);
|
|
void set_music_asset_volume(AssetID id, int8_t volume);
|
|
bool is_music_asset_playing(AssetID id);
|
|
void pause_playing_music();
|
|
void resume_playing_music();
|
|
void stop_playing_music();
|
|
void fade_out_playing_music(uint32_t fade_length_in_ms);
|
|
void set_playing_music_volume(int8_t volume);
|
|
bool is_music_playing();
|
|
void close_asset(AssetID *id);
|
|
void handle_events();
|
|
void update();
|
|
void render();
|
|
void close_engine();
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif // !__cplusplus
|
|
|
|
#endif // !GAME_H
|