| globjects 1.0.0.000000000000 Strict OpenGL objects wrapper.

Uniform.h
Go to the documentation of this file.
1
2 #pragma once
3
4 #include <glbinding/gl/types.h>
5
6 #include <globjects/globjects_api.h>
7 #include <globjects/AbstractUniform.h>
8
9
10 namespace globjects
11 {
12
13
35 template<typename T>
36 class Uniform : public AbstractUniform
37 {
38 public:
39 Uniform(gl::GLint location);
40 Uniform(gl::GLint location, const T & value);
41 Uniform(const std::string & name);
42 Uniform(const std::string & name, const T & value);
43
44 void set(const T & value);
45
46 const T & value() const;
47
48 protected:
49 virtual ~Uniform();
50
51 virtual void updateAt(const Program * program, gl::GLint location) const override;
52
53 protected:
54 T m_value;
55 };
56
57
58 } // namespace globjects
59
60
61 #include <globjects/Uniform.inl>
globjects
Contains all the classes that wrap OpenGL functionality.
globjects::Uniform::m_value
T m_value
The uniforms value, explictly required when relinking programs.
Definition: Uniform.h:54
globjects::AbstractUniform::name
const std::string & name() const
globjects::Uniform::~Uniform
virtual ~Uniform()
globjects::Uniform::value
const T & value() const
globjects::AbstractUniform::Program
friend class Program
Programs (de)register themselves.
Definition: AbstractUniform.h:36
globjects::AbstractUniform::location
gl::GLint location() const
globjects::Uniform::updateAt
virtual void updateAt(const Program *program, gl::GLint location) const override
AbstractUniform.h
globjects::Uniform::Uniform
Uniform(gl::GLint location)