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
Texture2D.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_GRAPHICS_GL_TEXTURE2D_HPP_
9#define GALAXY_GRAPHICS_GL_TEXTURE2D_HPP_
10
12
13namespace galaxy
14{
15 namespace graphics
16 {
20 class Texture2D final : public Texture
21 {
22 public:
26 Texture2D();
27
32
37
41 virtual ~Texture2D();
42
50 [[nodiscard]]
51 bool load(const std::string& file);
52
62 [[nodiscard]]
63 bool load_mem(std::span<std::uint8_t> buffer);
64
70 void save(std::string_view file);
71
75 void recreate();
76
80 void bind() override;
81
85 void unbind() override;
86 };
87 } // namespace graphics
88} // namespace galaxy
89
90#endif
Standard opengl texture.
Definition Texture2D.hpp:21
bool load(const std::string &file)
Load a texture from vfs.
Definition Texture2D.cpp:52
Texture2D & operator=(Texture2D &&)
Move assignment operator.
Definition Texture2D.cpp:38
void unbind() override
Deactivate context.
virtual ~Texture2D()
Destructor.
Definition Texture2D.cpp:48
bool load_mem(std::span< std::uint8_t > buffer)
Loads texture from memory.
Definition Texture2D.cpp:69
void save(std::string_view file)
Saves texture to file on disk.
void bind() override
Activate context.
void recreate()
Deletes texture data and configuration in OpenGL and creates new texture handle.
OpenGL 2D Texture.
Definition Texture.hpp:26
Animated.cpp galaxy.
Definition Animated.cpp:16