globjects  1.0.0.000000000000
Strict OpenGL objects wrapper.
Loading...
Searching...
No Matches
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
14
15namespace globjects
16{
17
18
19class AbstractStringSource;
20
27class GLOBJECTS_API ProgramBinary : public Referenced, public Changeable, protected ChangeListener
28{
29public:
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
39protected:
40 virtual ~ProgramBinary();
41
42 void validate() const;
43
44protected:
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
Superclass for all types of static and dynamic strings, e.g. for the use as Shader code.
Definition AbstractStringSource.h:26
Allows listening to any Changeable.
Definition ChangeListener.h:23
Superclass of all objects that want others to signal that they have changed.
Definition Changeable.h:23
The ProgramBinary class is used for directly setting binary sources for a Program.
Definition ProgramBinary.h:28
gl::GLenum m_binaryFormat
Definition ProgramBinary.h:45
const void * data() const
ProgramBinary(gl::GLenum binaryFormat, const std::vector< char > &binaryData)
virtual void notifyChanged(const Changeable *sender) override
std::vector< unsigned char > m_binaryData
Definition ProgramBinary.h:49
bool m_valid
Definition ProgramBinary.h:48
gl::GLsizei length() const
ProgramBinary(gl::GLenum binaryFormat, AbstractStringSource *dataSource)
ref_ptr< AbstractStringSource > m_dataSource
Definition ProgramBinary.h:46
gl::GLenum format() const
Superclass for all classes that use reference counting in globjects.
Definition Referenced.h:23
The ref_ptr class provides the interface for a reference pointer.
Definition ref_ptr.h:33
Contains all the classes that wrap OpenGL functionality.