aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Texture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/api/Texture.cpp')
-rw-r--r--src/crepe/api/Texture.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/crepe/api/Texture.cpp b/src/crepe/api/Texture.cpp
index c755fa9..7791b5b 100644
--- a/src/crepe/api/Texture.cpp
+++ b/src/crepe/api/Texture.cpp
@@ -1,31 +1,32 @@
+#include <SDL2/SDL_render.h>
+#include "util/log.h"
#include "Asset.h"
#include "SdlContext.h"
-#include "util/log.h"
-
#include "Texture.h"
-#include <SDL2/SDL_render.h>
using namespace crepe::api;
+using namespace std;
-Texture::Texture(std::unique_ptr<Asset> res) {
+Texture::Texture(unique_ptr<Asset> res) {
dbg_trace();
this->load(std::move(res));
}
Texture::Texture(const char * src) {
dbg_trace();
- this->load(std::make_unique<Asset>(src));
+ this->load(make_unique<Asset>(src));
}
Texture::~Texture() {
dbg_trace();
- if (this->m_texture != nullptr) {
- SDL_DestroyTexture(m_texture);
+ if (this->texture != nullptr) {
+ SDL_DestroyTexture(this->texture);
}
}
-void Texture::load(std::unique_ptr<Asset> res) {
+
+void Texture::load(unique_ptr<Asset> res) {
SdlContext & ctx = SdlContext::get_instance();
- m_texture = ctx.texture_from_path(res->canonical());
+ this->texture = ctx.texture_from_path(res->canonical());
}