jGL
Loading...
Searching...
No Matches
uniform.h
Go to the documentation of this file.
1#ifndef UNIFORM
2#define UNIFORM
3
4#include <cmath>
5#include <string>
6
7namespace jGL
8{
10 {
11 AbstractjGLUniform(std::string n)
12 : name(n)
13 {}
14
15 virtual ~AbstractjGLUniform() = default;
16
17 std::string name;
18 };
19
20 template <class T>
22 {
23 jGLUniform(std::string n, T v)
25 {}
26
28 };
29
30 template <class T>
31 const jGLUniform NULL_UNIFORM("", static_cast<T>(NAN));
32
33 struct Sampler2D {
34
35 Sampler2D(int t)
36 : texture(t)
37 {}
38
39 Sampler2D(unsigned t)
40 : texture(t)
41 {}
42
43 Sampler2D(float t)
44 : texture(int(t))
45 {}
46
47 int texture;
48 };
49}
50
51#endif /* UNIFORM */
A drawable graphic.
Definition id.h:10
const jGLUniform NULL_UNIFORM("", static_cast< T >(NAN))
Definition uniform.h:10
std::string name
Definition uniform.h:17
AbstractjGLUniform(std::string n)
Definition uniform.h:11
virtual ~AbstractjGLUniform()=default
Definition uniform.h:33
Sampler2D(float t)
Definition uniform.h:43
Sampler2D(unsigned t)
Definition uniform.h:39
Sampler2D(int t)
Definition uniform.h:35
int texture
Definition uniform.h:47
Definition uniform.h:22
T value
Definition uniform.h:27
jGLUniform(std::string n, T v)
Definition uniform.h:23