![]() |
galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
|
#include <Texture.hpp>
Public Member Functions | |
Texture (Texture &&) | |
Move constructor. | |
Texture & | operator= (Texture &&) |
Move assignment operator. | |
virtual | ~Texture () |
Destructor. | |
TextureView | make_view (const unsigned int minlevel=0, const unsigned int numlevels=1, const unsigned int minlayer=0, const unsigned int numlayers=1) |
Create a texture view. | |
virtual void | bind ()=0 |
Activate context. | |
virtual void | unbind ()=0 |
Deactivate context. | |
void | mode (const TextureMode mode) |
Set texture mode. | |
TextureMode | mode () const |
Get texture mode. | |
void | filter (const TextureFilter filter) |
Set filter when texture is (up/down)scaled in OpenGL. | |
TextureFilter | filter () const |
Get texture filter. | |
void | anisotropy (const int level) |
Set ansiotropic filtering level. | |
int | anisotropy () const |
Get current anisotropy level. | |
float | width () const |
Get texture width. | |
float | height () const |
Get texture height. | |
unsigned int | id () const |
Gets opengl handle. | |
Protected Member Functions | |
Texture () | |
Constructor. | |
Protected Attributes | |
unsigned int | m_id |
OpenGL id. | |
int | m_width |
Cached width. | |
int | m_height |
Cached height. | |
TextureMode | m_mode |
Mode. | |
TextureFilter | m_filter |
Filter. | |
int | m_anisotropy |
Ansiotrophy level. | |
Private Member Functions | |
Texture (const Texture &)=delete | |
Copy constructor. | |
Texture & | operator= (const Texture &)=delete |
Copy assignment operator. | |
OpenGL 2D Texture.
Definition at line 25 of file Texture.hpp.
galaxy::graphics::Texture::Texture | ( | Texture && | t | ) |
Move constructor.
Definition at line 32 of file Texture.cpp.
|
virtual |
Destructor.
Definition at line 71 of file Texture.cpp.
|
protected |
Constructor.
Definition at line 22 of file Texture.cpp.
|
privatedelete |
Copy constructor.
Move assignment operator.
Definition at line 49 of file Texture.cpp.
|
nodiscard |
Create a texture view.
parent | Texture id of which to create a view from. |
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 79 of file Texture.cpp.
|
pure virtual |
Activate context.
Implemented in galaxy::graphics::Texture2D, galaxy::graphics::TextureArray, and galaxy::graphics::TextureView.
|
pure virtual |
Deactivate context.
Implemented in galaxy::graphics::Texture2D, galaxy::graphics::TextureArray, and galaxy::graphics::TextureView.
void galaxy::graphics::Texture::mode | ( | const TextureMode | mode | ) |
Set texture mode.
mode | I.e. GL_REPEAT, GL_CLAMP_TO_EDGE, etc. |
Definition at line 91 of file Texture.cpp.
|
nodiscard |
Get texture mode.
Definition at line 97 of file Texture.cpp.
void galaxy::graphics::Texture::filter | ( | const TextureFilter | filter | ) |
Set filter when texture is (up/down)scaled in OpenGL.
filter | Filtering to use for min/mag. |
Definition at line 102 of file Texture.cpp.
|
nodiscard |
Get texture filter.
Definition at line 120 of file Texture.cpp.
void galaxy::graphics::Texture::anisotropy | ( | const int | level | ) |
Set ansiotropic filtering level.
level | 0 to 16. Must be 0/2/4/8/16. |
Definition at line 125 of file Texture.cpp.
|
nodiscard |
Get current anisotropy level.
Definition at line 152 of file Texture.cpp.
|
nodiscard |
Get texture width.
Is cached for performance.
Definition at line 157 of file Texture.cpp.
|
nodiscard |
Get texture height.
Is cached for performance.
Definition at line 162 of file Texture.cpp.
|
nodiscard |
Gets opengl handle.
Definition at line 167 of file Texture.cpp.
Copy assignment operator.
|
protected |
OpenGL id.
Definition at line 161 of file Texture.hpp.
|
protected |
Cached width.
Definition at line 166 of file Texture.hpp.
|
protected |
Cached height.
Definition at line 171 of file Texture.hpp.
|
protected |
Mode.
Definition at line 176 of file Texture.hpp.
|
protected |
Filter.
Definition at line 181 of file Texture.hpp.
|
protected |
Ansiotrophy level.
Definition at line 186 of file Texture.hpp.