|
SleakEngine 1.0.0
C++23 multi-backend game engine
|
#include <Texture.hpp>
Public Member Functions | |
| virtual | ~Texture ()=default |
| virtual void | Bind (uint32_t slot=0) const =0 |
| virtual TextureFormat | GetFormat () const =0 |
| virtual uint32_t | GetHeight () const =0 |
| virtual uint64_t | GetImGuiTextureID () const |
| virtual float | GetLodBias () const |
| virtual TextureType | GetType () const =0 |
| virtual uint32_t | GetWidth () const =0 |
| virtual bool | LoadFromFile (const std::string &filePath)=0 |
| Loads and uploads an image file from disk. | |
| virtual bool | LoadFromMemory (const void *data, uint32_t width, uint32_t height, TextureFormat format)=0 |
| Uploads raw pixel data as the texture's contents, replacing any existing image. | |
| virtual void | SetFilter (TextureFilter filter)=0 |
| virtual void | SetLodBias (float bias) |
| virtual void | SetWrapMode (TextureWrapMode wrapMode)=0 |
| virtual void | Unbind () const =0 |
Backend-agnostic GPU texture interface; each renderer backend supplies its own implementation.
You rarely construct one directly. Materials create and own their textures when you call a Set...Texture(path) setter, ModelLoader creates them while importing, and Sleak::UI::CreateTextureFromPixels makes one from raw pixel data for UI use. The concrete type is whatever the active backend provides, which is why every method here is virtual.
Filtering and wrap mode are set per texture, not per material, so change them on the object a material hands back. Reach for TextureFilter::Nearest on pixel art and atlases where bleeding between neighboring tiles would show, and an anisotropic mode on ground planes viewed at glancing angles.
Definition at line 78 of file Texture.hpp.
|
virtualdefault |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
inlinevirtual |
Reimplemented in Sleak::RenderEngine::DirectX11Texture, Sleak::RenderEngine::OpenGLTexture, and Sleak::RenderEngine::VulkanTexture.
Definition at line 107 of file Texture.hpp.
|
inlinevirtual |
Reimplemented in Sleak::RenderEngine::DirectX11Texture, Sleak::RenderEngine::OpenGLTexture, and Sleak::RenderEngine::VulkanTexture.
Definition at line 105 of file Texture.hpp.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Loads and uploads an image file from disk.
Implemented in Sleak::RenderEngine::DirectX11CubemapTexture, Sleak::RenderEngine::DirectX11Texture, Sleak::RenderEngine::OpenGLCubemapTexture, Sleak::RenderEngine::OpenGLTexture, Sleak::RenderEngine::VulkanCubemapTexture, and Sleak::RenderEngine::VulkanTexture.
|
pure virtual |
Uploads raw pixel data as the texture's contents, replacing any existing image.
Implemented in Sleak::RenderEngine::DirectX11CubemapTexture, Sleak::RenderEngine::DirectX11Texture, Sleak::RenderEngine::OpenGLCubemapTexture, Sleak::RenderEngine::OpenGLTexture, Sleak::RenderEngine::VulkanCubemapTexture, and Sleak::RenderEngine::VulkanTexture.
|
pure virtual |
|
inlinevirtual |
Reimplemented in Sleak::RenderEngine::DirectX11Texture, Sleak::RenderEngine::OpenGLTexture, and Sleak::RenderEngine::VulkanTexture.
Definition at line 104 of file Texture.hpp.
|
pure virtual |
|
pure virtual |