21#include "System/json.h"
39 Texture(
const std::string& fileName);
50 auto loadFile(
const std::string& fileName) -> void;
60 [[nodiscard]]
auto getFrames()
const -> unsigned;
69 [[nodiscard]]
auto name()
const ->
const std::string&;
75 auto name(
const std::string&
name) -> void;
sys::Json Stream
Definition AudioObject.h:20
unsigned int GLuint
Definition IndexBuffer.h:17
nlohmann::json json
Definition Json.cpp:19
GLenum format
Definition Texture.h:94
auto deactivate() const -> void
Definition Texture.cpp:124
int textureHeight
Definition Texture.h:92
auto getFrames() const -> unsigned
Definition Texture.cpp:206
auto save(Stream &stream) const -> void
Definition Texture.cpp:211
auto getTilesWide() const -> unsigned
Definition Texture.cpp:196
unsigned tilesWide
The number of tiles wide of the image as a spritesheet.
Definition Texture.h:98
auto getTextureHeight() const -> int
Definition Texture.cpp:191
friend auto to_json(json &j, const Texture &a) -> void
Definition Texture.cpp:241
friend auto from_json(const json &j, Texture &a) -> void
Definition Texture.cpp:250
auto loadFile(const std::string &fileName) -> void
Definition Texture.cpp:129
auto operator=(const Texture &other) -> Texture &
Definition Texture.cpp:87
int textureWidth
Definition Texture.h:92
unsigned char * imageData
Definition Texture.h:93
auto name() const -> const std::string &
Definition Texture.cpp:221
auto activate() const -> void
Definition Texture.cpp:119
Texture()
default ctor, don't use, it doesn't make sense.
Definition Texture.cpp:33
GLuint textureID
Definition Texture.h:95
int numPerPixel
Definition Texture.h:92
auto getTextureID() const -> GLuint
get the opengl id of texture
Definition Texture.cpp:231
~Texture()
Definition Texture.cpp:50
unsigned tilesHigh
Definition Texture.h:99
auto load(const Stream &stream) -> void
Definition Texture.cpp:216
std::string imagePath
the path to the image that was loaded from
Definition Texture.h:91
auto getTextureWidth() const -> int
Definition Texture.cpp:186
unsigned frames
The total number of frames the texture has if it is a spritesheet.
Definition Texture.h:101
std::string _name
Sprite will save the name of the texture it needs to load, so that multiple sprites can use the same ...
Definition Texture.h:87
auto getTilesHigh() const -> unsigned
Definition Texture.cpp:201