aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Texture.cpp
blob: 9d8e02de57a7a89ad3c29f62e51efdf441beaa17 (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
#include "../util/Log.h"

#include "Asset.h"
#include "Resource.h"
#include "Texture.h"
#include "types.h"
#include <utility>

using namespace crepe;
using namespace std;

Texture::Texture(const Asset & src) : Resource(src) {
	dbg_trace();
}

Texture::~Texture() {
	dbg_trace();
	this->texture.reset();
}

void Texture::load(std::unique_ptr<SDL_Texture, std::function<void(SDL_Texture *)>> texture) {
	this->texture = std::move(texture);
	this->loaded = true;
}

ivec2 Texture::get_size() const {
	if (this->texture == nullptr) return {};
	return {};
}