aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Texture.cpp
blob: 2ac8606853fc78f15cb8d557eec0350a1eb32335 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "../util/Log.h"

#include "Asset.h"
#include "Resource.h"
#include "Texture.h"
#include "facade/SDLContext.h"
#include "manager/Mediator.h"
#include "types.h"

using namespace crepe;
using namespace std;

Texture::Texture(const Asset & src, Mediator & mediator) : Resource(src, mediator) {
	dbg_trace();
	SDLContext & ctx = mediator.sdl_context;
	this->texture = ctx.texture_from_path(src.get_path());
	this->size = ctx.get_size(*this);
}

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