globjects  1.0.0.000000000000
Strict OpenGL objects wrapper.
LocationIdentity.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <string>
5 #include <functional>
6 
7 #include <glbinding/gl/types.h>
8 
9 #include <globjects/globjects_api.h>
10 
11 
12 namespace globjects
13 {
14 
15 
16 class GLOBJECTS_API LocationIdentity
17 {
18 public:
20  LocationIdentity(gl::GLint location);
21  LocationIdentity(const std::string & name);
22 
23  bool isLocation() const;
24  bool isName() const;
25 
26  gl::GLint location() const;
27  const std::string & name() const;
28 
29  bool operator==(const LocationIdentity & identity) const;
30  bool operator!=(const LocationIdentity & identity) const;
31 
32  bool operator<(const LocationIdentity & identity) const;
33 
34  std::size_t hash() const;
35 
36 protected:
37  bool m_invalid;
38 
39  gl::GLint m_location;
40 
41  std::string m_name;
42  bool m_hasName;
43 };
44 
45 } // namespace globjects
46 
47 
48 namespace std
49 {
50 
51 template <>
52 struct hash<globjects::LocationIdentity>
53 {
54  std::size_t operator()(const globjects::LocationIdentity & identity) const
55  {
56  return identity.hash();
57  }
58 };
59 
60 
61 } // namespace globjects
gl::GLint m_location
Definition: LocationIdentity.h:39
std::size_t hash() const
std::size_t operator()(const globjects::LocationIdentity &identity) const
Definition: LocationIdentity.h:54
std::string m_name
Definition: LocationIdentity.h:41
Contains all the classes that wrap OpenGL functionality.
bool m_invalid
Definition: LocationIdentity.h:37
Definition: LocationIdentity.h:48
Definition: LocationIdentity.h:16
bool m_hasName
Definition: LocationIdentity.h:42