blob: e11979eca254316d9f7fd454cc6c12599eaa311b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#include "TZR.h"
#include "TZR_globals.h"
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_mixer.h>
void
TZR_Quit(void)
{
for (size_t i = 0; i < ___tzr_resources_size; i++)
TZR_DestroyResource(&___tzr_resources[i], 1);
if (___tzr_resources != NULL)
free(___tzr_resources);
___tzr_resources = NULL;
___tzr_resources_size = 0;
___tzr_resources_capacity = 0;
if (___tzr_target != NULL) {
SDL_DestroyTexture(___tzr_target);
___tzr_target = NULL;
}
if (___tzr_renderer != NULL) {
SDL_DestroyRenderer(___tzr_renderer);
___tzr_renderer = NULL;
}
if (___tzr_window != NULL) {
SDL_DestroyWindow(___tzr_window);
___tzr_window = NULL;
}
if (___tzr_config.mixer) {
Mix_CloseAudio();
Mix_Quit();
}
IMG_Quit();
SDL_Quit();
}
|