Nameless Engine
Loading...
Searching...
No Matches
ShaderUser.h
1#pragma once
2
3// Standard.
4#include <unordered_map>
5
6// Custom.
7#include "shader/general/ShaderPack.h"
8#include "shader/ShaderDescription.h"
9
10namespace ne {
11 class ShaderManager;
12
20 class ShaderUser {
21 public:
22 ShaderUser() = delete;
23 ShaderUser(const ShaderUser&) = delete;
24 ShaderUser& operator=(const ShaderUser&) = delete;
25
26 protected:
33
35 virtual ~ShaderUser();
36
48 [[nodiscard]] bool addShader(const std::string& sShaderName);
49
61 ShaderPack* findShader(ShaderType shaderType);
62
63 private:
70 void releaseShader(const std::string& sShaderName) const;
71
76 std::pair<std::mutex, std::unordered_map<ShaderType, std::shared_ptr<ShaderPack>>> mtxAssignedShaders;
77
80 };
81} // namespace ne
Definition: ShaderManager.h:25
Definition: ShaderPack.h:22
Definition: ShaderUser.h:20
bool addShader(const std::string &sShaderName)
Definition: ShaderUser.cpp:9
ShaderPack * findShader(ShaderType shaderType)
Definition: ShaderUser.cpp:43
void releaseShader(const std::string &sShaderName) const
Definition: ShaderUser.cpp:54
std::pair< std::mutex, std::unordered_map< ShaderType, std::shared_ptr< ShaderPack > > > mtxAssignedShaders
Definition: ShaderUser.h:76
ShaderManager * pShaderManager
Definition: ShaderUser.h:79
virtual ~ShaderUser()
Definition: ShaderUser.cpp:59