Connected the AssetManager to the GameEngine and added function in the

GameEngine API to allow for loading and removing assets as well as rendering
textures using their AssetID
This commit is contained in:
abdelrahman committed 2022-09-23 04:39:17 +01:00
1 parent c4f1775392
commit 3f71cf0f3f
11 files changed
+156 -33

No files matched your search

+6 -3
View File
@@ -8,7 +8,7 @@
#endif /* DEBUG_ENGINE */
bool init_window(Window *wnd, const char *title, int width, int height,
bool full_screen) {
SDL_Color color, bool full_screen) {
if (!wnd) {
return false;
}
@@ -29,6 +29,8 @@ bool init_window(Window *wnd, const char *title, int width, int height,
SDL_GetWindowSize(wnd->SDL_base_window, &(wnd->width), &(wnd->height));
wnd->background_color = color;
wnd->renderer = create_renderer();
if (!wnd->renderer || !init_renderer(wnd->renderer, wnd->SDL_base_window)) {
@@ -46,12 +48,12 @@ bool init_window(Window *wnd, const char *title, int width, int height,
return true;
}
void fill_window_with_color(const Window *wnd, SDL_Color color) {
void clear_window(const Window *wnd) {
if (!wnd) {
return;
}
render_clear(wnd->renderer, color);
render_clear(wnd->renderer, wnd->background_color);
}
void swap_render_buffers(const Window *wnd) {
@@ -78,6 +80,7 @@ void destroy_window(Window *wnd) {
wnd->width = 0;
wnd->height = 0;
wnd->background_color = (SDL_Color){0, 0, 0, 255};
#ifdef DEBUG_ENGINE
printf("Window destroyed successfully\n");