twn_skybox.c
This commit is contained in:
26
src/rendering/twn_skybox.c
Normal file
26
src/rendering/twn_skybox.c
Normal file
@ -0,0 +1,26 @@
|
||||
#include "twn_rendering.h"
|
||||
#include "twn_rendering_c.h"
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
char *paths_in_use;
|
||||
|
||||
void push_skybox(const char *paths) {
|
||||
if (paths_in_use && SDL_strcmp(paths, paths_in_use) == 0)
|
||||
return;
|
||||
|
||||
if (paths_in_use)
|
||||
SDL_free(paths_in_use);
|
||||
|
||||
paths_in_use = SDL_strdup(paths);
|
||||
}
|
||||
|
||||
|
||||
void render_skybox(void) {
|
||||
if (!paths_in_use)
|
||||
return;
|
||||
|
||||
/* note: ownership of 'paths_in_use' goes there */
|
||||
finally_render_skybox(paths_in_use);
|
||||
paths_in_use = NULL;
|
||||
}
|
Reference in New Issue
Block a user