![]() |
Raven Engine v0.1
|
Manages a collection of shaders for efficient reuse and lookup. More...
#include <Shader.h>
Public Member Functions | |
| void | Add (const std::string &name, const Ref< Shader > &shader) |
| Add a shader to the library with a custom name. | |
| void | Add (const Ref< Shader > &shader) |
| Add a shader to the library using its internal name. | |
| Ref< Shader > | Load (const std::string &filepath) |
| Load and add a shader by file path, using its internal name. | |
| Ref< Shader > | Load (const std::string &name, const std::string &filepath) |
| Load and add a shader by file path with a custom name. | |
| Ref< Shader > | Get (const std::string &name) |
| Retrieve a shader by name. | |
| bool | Exists (const std::string &name) const |
| Checks if a shader exists in the library. | |
| std::unordered_map< std::string, Ref< Shader > > & | GetShaders () |
Static Public Member Functions | |
| static 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. |
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. |