Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
shadermanager.h
Go to the documentation of this file.
1 
18 #ifndef ION_GFXUTILS_SHADERMANAGER_H_
19 #define ION_GFXUTILS_SHADERMANAGER_H_
20 
21 #include <memory>
22 #include <string>
23 #include <vector>
24 
25 #include "base/macros.h"
26 #include "ion/base/referent.h"
27 #include "ion/gfx/renderer.h"
29 #include "ion/gfx/shaderprogram.h"
31 #include "ion/port/mutex.h"
32 
33 namespace ion {
34 namespace gfxutils {
35 
38 class ION_API ShaderManager : public base::Referent {
39  public:
40  ShaderManager();
41 
44  const gfx::ShaderProgramPtr CreateShaderProgram(
45  const std::string& name, const ion::gfx::ShaderInputRegistryPtr& registry,
46  const ShaderSourceComposerPtr& vertex_source_composer,
47  const ShaderSourceComposerPtr& fragment_source_composer);
48 
51  const gfx::ShaderProgramPtr GetShaderProgram(const std::string& name);
52 
55  const std::vector<std::string> GetShaderProgramNames();
56 
60  void GetShaderProgramComposers(
61  const std::string& name,
62  ShaderSourceComposerPtr* vertex_source_composer,
63  ShaderSourceComposerPtr* fragment_source_composer);
64 
66  void RecreateAllShaderPrograms();
67 
71  void RecreateShaderProgramsThatDependOn(const std::string& dependency);
72 
73  private:
75  class ShaderManagerData;
76 
78  ~ShaderManager() override;
79 
80  std::unique_ptr<ShaderManagerData> data_;
81 
82  DISALLOW_COPY_AND_ASSIGN(ShaderManager);
83 };
84 
86 
87 
88 } // namespace gfxutils
89 } // namespace ion
90 
91 #endif // ION_GFXUTILS_SHADERMANAGER_H_
base::ReferentPtr< ShaderManager >::Type ShaderManagerPtr
Definition: shadermanager.h:85
ShaderManager contains an association between shader programs, their names, and any source dependenci...
Definition: shadermanager.h:38
Thread-safe abstract base class.
Definition: referent.h:49
std::string name
Definition: printer.cc:324
A SharedPtr is a smart shared pointer to an instance of some class that implements reference counting...
Definition: sharedptr.h:60