Manages a collection of shaders for efficient reuse and lookup. More...
#include <Shader.h>
Inherits Raven::RefCounted.
Public Member Functions | |
| ILLUMINE_API void | Shutdown () |
| ILLUMINE_API void | Add (const std::string &name, const Ref< Shader > &shader) |
| Add a shader to the library with a custom name. | |
| ILLUMINE_API void | Add (const Ref< Shader > &shader) |
| Add a shader to the library using its internal name. | |
| ILLUMINE_API Ref< Shader > | Load (const std::string &filepath) |
| Load and add a shader by file path, using its internal name. | |
| ILLUMINE_API Ref< Shader > | Load (const std::string &name, const std::string &filepath) |
| Load and add a shader by file path with a custom name. | |
| ILLUMINE_API Ref< Shader > | Get (const std::string &name) |
| Retrieve a shader by name. | |
| ILLUMINE_API bool | Exists (const std::string &name) const |
| Checks if a shader exists in the library. | |
| NodeStrMap< Ref< Shader > > & | GetShaders () |
| Public Member Functions inherited from Raven::RefCounted | |
| RefCounted () | |
| virtual | ~RefCounted () |
| void | IncRefCount () |
| void | DecRefCount () |
| u32 | GetRefCount () const |
Static Public Member Functions | |
| static ILLUMINE_API Ref< ShaderLibrary > | Create () |
| Factory method to create a new ShaderLibrary instance. | |
Manages a collection of shaders for efficient reuse and lookup.
Allows adding, loading, and retrieving shaders by name, preventing duplicate loads. Acts as a cache and centralized management point.
Add a shader to the library using its internal name.
| shader | Shader reference to add. |
Add a shader to the library with a custom name.
| name | Name to associate with the shader. |
| shader | Shader reference to add. |
|
static |
Factory method to create a new ShaderLibrary instance.
| bool Raven::ShaderLibrary::Exists | ( | const std::string & | name | ) | const |
Checks if a shader exists in the library.
| name | Shader name to check. |
|
inline |
Load and add a shader by file path, using its internal name.
| filepath | Path to the shader file. |
Load and add a shader by file path with a custom name.
| name | Name to associate with the shader. |
| filepath | Path to the shader file. |
| void Raven::ShaderLibrary::Shutdown | ( | ) |