Euphoria
shaderuniform.cc
Go to the documentation of this file.
1 #include "render/shaderuniform.h"
2 
3 #include "assert/assert.h"
4 
5 #include <utility>
6 
7 namespace eu::render
8 {
9  ShaderUniform::ShaderUniform(std::string aname, gl::Int aid, render::ShaderProgram* ashader)
10  : name(std::move(aname))
11  , id(aid)
12  , shader(ashader)
13  {
14  }
15 
16 
17  const ShaderUniform&
19  {
20  static const auto null_uniform = ShaderUniform{};
21  ASSERT(null_uniform.is_null());
22  return null_uniform;
23  }
24 
25 
26  bool
28  {
29  return shader == nullptr && id == 0;
30  }
31 
32 
33  bool
34  operator==(const ShaderUniform& lhs, const ShaderUniform& rhs)
35  {
36  return
37  lhs.id == rhs.id &&
38  lhs.name == rhs.name &&
39  lhs.shader == rhs.shader;
40  }
41 
42  ShaderUniform::ShaderUniform()
43  : id(0)
44  , shader(nullptr)
45  {
46  }
47 }
#define ASSERT(x)
Definition: assert.h:29
bool operator==(const ShaderAttribute &lhs, const ShaderAttribute &rhs)
render::ShaderProgram * shader
Definition: shaderuniform.h:29
static const ShaderUniform & create_null()