summaryrefslogtreecommitdiff
path: root/src/destructor.cpp
blob: 1adcb650c3467b7e9b426ea60020783d8af12500 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "FLD.hpp"
#include <SDL2/SDL.h>

FLD::~FLD()
{
	for (auto [_, e] : images)
		if (e.ptr != nullptr)
			SDL_DestroyTexture(e.ptr);
	if (_target != nullptr) {
		SDL_DestroyTexture(_target);
		_target = nullptr;
	}
	if (_renderer != nullptr) {
		SDL_DestroyRenderer(_renderer);
		_renderer = nullptr;
	}
	if (_window != nullptr) {
		SDL_DestroyWindow(_window);
		_window = nullptr;
	}
	SDL_Quit();
}