You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
710 B
41 lines
710 B
|
|
#ifndef _DEFGARBO |
|
#define _DEFGARBO |
|
|
|
#include <stdlib.h> |
|
#include <string.h> |
|
#include <SDL2/SDL.h> |
|
#include <string.h> |
|
#include "logger.h" |
|
#include <stdbool.h> |
|
|
|
|
|
/* Type definition for object cleanups */ |
|
typedef enum { |
|
NO, SURFACE, TEXTURE, RENDERER, WINDOW |
|
} sdl_types; |
|
|
|
typedef union { |
|
SDL_Window * window; |
|
SDL_Renderer * renderer; |
|
SDL_Surface * surface; |
|
SDL_Texture * texture; |
|
void * generic; |
|
} thing_for_cleanup ; |
|
|
|
typedef struct { |
|
sdl_types kind; |
|
thing_for_cleanup thing; |
|
} sdl_abstract; |
|
|
|
|
|
/* Function prototypes */ |
|
|
|
void queue_for_cleanup(void * SDL_thing, sdl_types kind); |
|
|
|
void cleanup(void * thing, sdl_types thing_type); |
|
|
|
void empty_cleanup_queue(void); |
|
|
|
#endif |
|
|
|
|