globjects  1.0.0.000000000000
Strict OpenGL objects wrapper.
ProgramPipeline.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <set>
5 
6 #include <glbinding/gl/types.h>
7 
8 #include <globjects/globjects_api.h>
9 
10 #include <globjects/base/ref_ptr.h>
12 #include <globjects/Object.h>
13 
14 
15 namespace globjects
16 {
17 
18 
19 class Program;
20 
21 class GLOBJECTS_API ProgramPipeline : public Object, protected ChangeListener
22 {
23 public:
25  virtual ~ProgramPipeline();
26 
27  virtual void accept(ObjectVisitor & visitor) override;
28 
29  void use() const;
30  static void release();
31 
32  void useStages(Program * program, gl::UseProgramStageMask stages);
33  void releaseStages(gl::UseProgramStageMask stages);
34  void releaseProgram(Program * program);
35 
36  bool isValid() const;
37  void validate() const;
38 
39  bool checkUseStatus() const;
40 
41  std::string infoLog() const;
42  gl::GLint get(gl::GLenum pname) const;
43 
44  virtual void notifyChanged(const Changeable * sender) override;
45 
46  virtual gl::GLenum objectType() const override;
47 
48 protected:
49  void invalidate();
50 
51 protected:
52  bool m_dirty;
53  std::set<ref_ptr<Program>> m_programs;
54 };
55 
56 
57 } // namespace globjects
Wraps an OpenGL program.
Definition: Program.h:78
Contains all the classes that wrap OpenGL functionality.
Allows listening to any Changeable.
Definition: ChangeListener.h:22
std::set< ref_ptr< Program > > m_programs
Definition: ProgramPipeline.h:53
Superclass of all wrapped OpenGL objects.
Definition: Object.h:26
bool m_dirty
Definition: ProgramPipeline.h:52
Definition: ProgramPipeline.h:21
Superclass of all objects that want others to signal that they have changed.
Definition: Changeable.h:22
Implements a Visitor Pattern to iterate over all tracked globjects objects.
Definition: ObjectVisitor.h:29