![]() |
galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
|
Bindless OpenGL 2D Texture. More...
#include <Texture.hpp>
Collaboration diagram for galaxy::Texture:Public Member Functions | |
| Texture () | |
| Constructor. | |
| Texture (Texture &&) noexcept | |
| Move constructor. | |
| Texture & | operator= (Texture &&) noexcept |
| Move assignment operator. | |
| ~Texture () | |
| Destructor. | |
| bool | load (const std::string &file) |
| Load a texture from vfs. | |
| bool | load_mem (std::span< std::uint8_t > buffer) |
| Loads texture from memory. | |
| void | save (std::string_view file) |
| Saves texture to file on disk. | |
| TextureView | get_view (const unsigned int minlevel, const unsigned int numlevels, const unsigned int minlayer, const unsigned int numlayers) const noexcept |
| Generate a texture view handle. | |
| void | bind () const noexcept |
| Bind to sampler. | |
| void | unbind () const noexcept |
| Unbind sampler. | |
| void | destroy () |
| Destroy texture. | |
| float | width () const noexcept |
| Get texture width. | |
| float | height () const noexcept |
| Get texture height. | |
| unsigned int | id () const noexcept |
| Get OpenGL texture id. | |
| std::uint64_t | handle () const noexcept |
| Get OpenGL bindless handle. | |
Private Member Functions | |
| Texture (const Texture &)=delete | |
| Copy constructor. | |
| Texture & | operator= (const Texture &)=delete |
| Copy assignment operator. | |
Private Attributes | |
| unsigned int | m_id |
| OpenGL id. | |
| std::uint64_t | m_handle |
| Bindless handle. | |
| int | m_width |
| Texture width. | |
| int | m_height |
| Texture height. | |
Bindless OpenGL 2D Texture.
https://ktstephano.github.io/rendering/opengl/bindless
Definition at line 23 of file Texture.hpp.
| galaxy::Texture::Texture | ( | ) |
Constructor.
Definition at line 29 of file Texture.cpp.
|
noexcept |
Move constructor.
Definition at line 38 of file Texture.cpp.
| galaxy::Texture::~Texture | ( | ) |
|
privatedelete |
Copy constructor.
Move assignment operator.
Definition at line 51 of file Texture.cpp.
|
nodiscard |
Load a texture from vfs.
| file | Texture in VFS to load. |
Definition at line 74 of file Texture.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
nodiscard |
Loads texture from memory.
Loads from standard 256byte array.
| buffer | Memory buffer to load from. |
Definition at line 82 of file Texture.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void galaxy::Texture::save | ( | std::string_view | file | ) |
Saves texture to file on disk.
| file | Path and filename to save texture to. Does not need extension (it will be ignored). |
Definition at line 121 of file Texture.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
nodiscardnoexcept |
Generate a texture view handle.
| minlevel | Mipmap level. |
| numlevels | Number of mipmaps to include. |
| minlayer | Specifies the index of the first layer to include in the view. |
| numlayers | Specifies the number of layers to include in the view. |
Definition at line 159 of file Texture.cpp.
Here is the caller graph for this function:
|
noexcept |
Bind to sampler.
Not required because this supports bindless textures.
Definition at line 164 of file Texture.cpp.
Here is the caller graph for this function:
|
noexcept |
Unbind sampler.
Definition at line 169 of file Texture.cpp.
Here is the caller graph for this function:| void galaxy::Texture::destroy | ( | ) |
Destroy texture.
Definition at line 174 of file Texture.cpp.
Here is the caller graph for this function:
|
nodiscardnoexcept |
Get texture width.
Is cached for performance.
Definition at line 189 of file Texture.cpp.
Here is the caller graph for this function:
|
nodiscardnoexcept |
Get texture height.
Is cached for performance.
Definition at line 194 of file Texture.cpp.
Here is the caller graph for this function:
|
nodiscardnoexcept |
Get OpenGL texture id.
Definition at line 199 of file Texture.cpp.
Here is the caller graph for this function:
|
nodiscardnoexcept |
Get OpenGL bindless handle.
Definition at line 204 of file Texture.cpp.
Here is the caller graph for this function:
|
private |
OpenGL id.
Definition at line 156 of file Texture.hpp.
|
private |
Bindless handle.
Definition at line 161 of file Texture.hpp.
|
private |
Texture width.
Definition at line 166 of file Texture.hpp.
|
private |
Texture height.
Definition at line 171 of file Texture.hpp.