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
12namespace globjects
13{
14
15
16class GLOBJECTS_API LocationIdentity
17{
18public:
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
36protected:
38
39 gl::GLint m_location;
40
41 std::string m_name;
43};
44
45} // namespace globjects
46
47
48namespace std
49{
50
51template <>
52struct 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
Definition: LocationIdentity.h:17
bool operator!=(const LocationIdentity &identity) const
bool m_hasName
Definition: LocationIdentity.h:42
gl::GLint m_location
Definition: LocationIdentity.h:39
std::size_t hash() const
gl::GLint location() const
LocationIdentity(gl::GLint location)
bool operator<(const LocationIdentity &identity) const
const std::string & name() const
LocationIdentity(const std::string &name)
std::string m_name
Definition: LocationIdentity.h:41
bool operator==(const LocationIdentity &identity) const
bool m_invalid
Definition: LocationIdentity.h:37
Contains all the classes that wrap OpenGL functionality.
Definition: LocationIdentity.h:49
std::size_t operator()(const globjects::LocationIdentity &identity) const
Definition: LocationIdentity.h:54