| 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
10 #include <globjects/base/Referenced.h>
11 #include <globjects/base/ChangeListener.h>
12 #include <globjects/base/Changeable.h>
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;
46 ref_ptr<AbstractStringSource> m_dataSource;
47
48 mutable bool m_valid;
49 mutable std::vector<unsigned char> m_binaryData;
50 };
51
52
53 } // namespace globjects
Referenced.h
globjects::ProgramBinary::m_binaryFormat
gl::GLenum m_binaryFormat
Definition: ProgramBinary.h:45
ChangeListener.h
globjects::ref_ptr
The ref_ptr class provides the interface for a reference pointer.
Definition: LogMessageBuilder.h:20
globjects
Contains all the classes that wrap OpenGL functionality.
ref_ptr.h
Changeable.h
globjects::Changeable
Superclass of all objects that want others to signal that they have changed.
Definition: Changeable.h:22
globjects::ProgramBinary::m_binaryData
std::vector< unsigned char > m_binaryData
Definition: ProgramBinary.h:49
globjects::ProgramBinary::m_valid
bool m_valid
Definition: ProgramBinary.h:48
globjects::ProgramBinary
The ProgramBinary class is used for directly setting binary sources for a Program.
Definition: ProgramBinary.h:27
globjects::ProgramBinary::m_dataSource
ref_ptr< AbstractStringSource > m_dataSource
Definition: ProgramBinary.h:46
globjects::ChangeListener
Allows listening to any Changeable.
Definition: ChangeListener.h:22
globjects::AbstractStringSource
Superclass for all types of static and dynamic strings, e.g. for the use as Shader code...
Definition: AbstractStringSource.h:25
globjects::Referenced
Superclass for all classes that use reference counting in globjects.
Definition: Referenced.h:22