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