#include #include "resources.h" SDL_Texture* character_spritesheet; SDL_Texture* map_texture; SDL_Texture* load_texture(struct demo* demo, const char* image_name) { SDL_Texture* texture = IMG_LoadTexture(demo->ren, image_name); if(texture == NULL) { printf("Failed to load textue %s, error: %s, exitting!", image_name, IMG_GetError()); exit(1); } return texture; } void load_resources(struct demo* demo) { if(!character_spritesheet) { character_spritesheet = load_texture(demo, "assets/Sprites/sprites.png"); } if(!map_texture) { map_texture = load_texture(demo, "assets/Sprites/Tileset.png"); } }