globjects  1.0.0.000000000000
Strict OpenGL objects wrapper.
ProgramBinary.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <vector>
5 
6 #include <glbinding/gl/types.h>
7 
8 #include <globjects/globjects_api.h>
9 
13 #include <globjects/base/ref_ptr.h>
14 
15 namespace globjects
16 {
17 
18 
19 class AbstractStringSource;
20 
27 class GLOBJECTS_API ProgramBinary : public Referenced, public Changeable, protected ChangeListener
28 {
29 public:
30  ProgramBinary(gl::GLenum binaryFormat, const std::vector<char> & binaryData);
31  ProgramBinary(gl::GLenum binaryFormat, AbstractStringSource * dataSource);
32 
33  gl::GLenum format() const;
34  const void * data() const;
35  gl::GLsizei length() const;
36 
37  virtual void notifyChanged(const Changeable* sender) override;
38 
39 protected:
40  virtual ~ProgramBinary();
41 
42  void validate() const;
43 
44 protected:
45  gl::GLenum m_binaryFormat;
47 
48  mutable bool m_valid;
49  mutable std::vector<unsigned char> m_binaryData;
50 };
51 
52 
53 } // namespace globjects
The ref_ptr class provides the interface for a reference pointer.
Definition: LogMessageBuilder.h:20
std::vector< unsigned char > m_binaryData
Definition: ProgramBinary.h:49
Contains all the classes that wrap OpenGL functionality.
Allows listening to any Changeable.
Definition: ChangeListener.h:22
bool m_valid
Definition: ProgramBinary.h:48
gl::GLenum m_binaryFormat
Definition: ProgramBinary.h:45
ref_ptr< AbstractStringSource > m_dataSource
Definition: ProgramBinary.h:46
The ProgramBinary class is used for directly setting binary sources for a Program.
Definition: ProgramBinary.h:27
Superclass for all classes that use reference counting in globjects.
Definition: Referenced.h:22
Superclass for all types of static and dynamic strings, e.g. for the use as Shader code.
Definition: AbstractStringSource.h:25
Superclass of all objects that want others to signal that they have changed.
Definition: Changeable.h:22