raylibstarter 0.1.0
texture2d.cpp
Go to the documentation of this file.
1#include <raylib.h>
2
3#include "texture2d.h"
4
5game::core::Texture2D::Texture2D(const char *filename) {
6 // @todo Error handling needed
7 this->texture_ = LoadTexture(filename);
8}
9
11 TraceLog(LOG_INFO, "game::core::Texture2D destructor called");
12 UnloadTexture(this->texture_);
13}
14
15const ::Texture2D &game::core::Texture2D::texture() const {
16 return this->texture_;
17}
18
19const int &game::core::Texture2D::width() const {
20 return this->texture_.width;
21}
22
24 return this->texture_.height;
25}
const ::Texture2D & texture() const
Definition: texture2d.cpp:15
const int & width() const
Definition: texture2d.cpp:19
::Texture2D texture_
Raylib Texture2D structure which contains width, height and the ID of the associated VRAM texture.
Definition: texture2d.h:54
const int & height() const
Definition: texture2d.cpp:23
~Texture2D()
Destructor.
Definition: texture2d.cpp:10