Implementing asset manager.
This commit is contained in:
parent
965015fa6d
commit
a498acb4d9
|
|
@ -0,0 +1,17 @@
|
|||
#include "asset_manager.h"
|
||||
|
||||
#include <SDL2/SDL_render.h>
|
||||
#include "display.h"
|
||||
#include "linked_list.h"
|
||||
|
||||
|
||||
|
||||
static void temporary_extract_asset(const char *path)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SDL_Texture load_image(const char *path)
|
||||
{
|
||||
IMG_LoadTexture(renderer, path);
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
#include "display.h"
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_image.h>
|
||||
|
||||
SDL_Window *window = NULL;
|
||||
SDL_Renderer *renderer = NULL;
|
||||
|
|
@ -8,6 +9,8 @@ SDL_Renderer *renderer = NULL;
|
|||
void display_init(void)
|
||||
{
|
||||
SDL_Init(SDL_INIT_EVERYTHING);
|
||||
IMG_Init(IMG_INIT_PNG);
|
||||
|
||||
window = SDL_CreateWindow("2D_Engine", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, DISPLAY_WIDTH * DISPLAY_SCALE, DISPLAY_HEIGHT * DISPLAY_SCALE, SDL_WINDOW_SHOWN);
|
||||
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef ASSET_MANAGER_H
|
||||
#define ASSET_MANAGER_H
|
||||
|
||||
#include <SDL2/SDL_image.h>
|
||||
|
||||
SDL_Texture load_image(const char *path);
|
||||
|
||||
#endif // ASSET_MANAGER_H
|
||||
Loading…
Reference in New Issue