21#include "System/json.h"
37 Texture(
const std::string& fileName);
48 auto loadFile(
const std::string& fileName) -> void;
58 [[nodiscard]]
auto getFrames()
const -> unsigned;
68 [[nodiscard]]
auto name()
const ->
const std::string&;
74 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
~Texture()
Definition Texture.cpp:47
auto getTilesWide() const -> unsigned
Definition Texture.cpp:193
auto load(Stream &stream) -> void
Definition Texture.cpp:213
unsigned frames
The total number of frames the texture has if it is a spritesheet.
Definition Texture.h:100
int textureWidth
Definition Texture.h:91
auto save(Stream &stream) const -> void
Definition Texture.cpp:208
auto name() const -> const std::string &
Definition Texture.cpp:218
int textureHeight
Definition Texture.h:91
std::string imagePath
the path to the image that was loaded from
Definition Texture.h:90
GLenum format
Definition Texture.h:93
auto loadFile(const std::string &fileName) -> void
Definition Texture.cpp:126
auto getFrames() const -> unsigned
Definition Texture.cpp:203
auto deactivate() const -> void
Definition Texture.cpp:121
friend auto to_json(json &j, const Texture &a) -> void
Definition Texture.cpp:238
friend auto from_json(const json &j, Texture &a) -> void
Definition Texture.cpp:247
auto getTilesHigh() const -> unsigned
Definition Texture.cpp:198
unsigned char * imageData
Definition Texture.h:92
Texture()
default ctor, don't use, it doesn't make sense.
Definition Texture.cpp:30
unsigned tilesHigh
Definition Texture.h:98
auto getTextureWidth() const -> int
Definition Texture.cpp:183
unsigned tilesWide
The number of tiles wide of the image as a spritesheet.
Definition Texture.h:97
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:86
auto operator=(const Texture &other) -> Texture &
Definition Texture.cpp:84
GLuint textureID
Definition Texture.h:94
auto getTextureHeight() const -> int
Definition Texture.cpp:188
auto activate() const -> void
Definition Texture.cpp:116
auto getTextureID() const -> GLuint
get the opengl id of texture
Definition Texture.cpp:228
int numPerPixel
Definition Texture.h:91