galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
TextureArray.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_GRAPHICS_GL_TEXTUREARRAY_HPP_
9#define GALAXY_GRAPHICS_GL_TEXTUREARRAY_HPP_
10
12#include "galaxy/meta/Memory.hpp"
13
14namespace galaxy
15{
16 namespace graphics
17 {
24 class TextureArray final : public Texture
25 {
26 public:
31
36
41
45 virtual ~TextureArray();
46
56 [[nodiscard]]
57 bool add(const std::string& file);
58
65 void build(const int width, const int height);
66
75 [[nodiscard]]
76 bool build_from_tileset(const std::string& file, const int tile_size);
77
81 void bind() override;
82
86 void unbind() override;
87
88 private:
93 meta::vector<unsigned char*> m_data;
94 };
95 } // namespace graphics
96} // namespace galaxy
97
98#endif
void unbind() override
Deactivate context.
bool add(const std::string &file)
Add a texture to the texture array.
meta::vector< unsigned char * > m_data
Data from adding a file to the texture array. Not kept after building.
void bind() override
Activate context.
void build(const int width, const int height)
Creates the array texture.
TextureArray & operator=(TextureArray &&)
Move assignment operator.
bool build_from_tileset(const std::string &file, const int tile_size)
Creates an array texture from a tileset.
virtual ~TextureArray()
Destructor.
OpenGL 2D Texture.
Definition Texture.hpp:26
float width() const
Get texture width.
Definition Texture.cpp:157
float height() const
Get texture height.
Definition Texture.cpp:162
Animated.cpp galaxy.
Definition Animated.cpp:16