| globjects 1.0.0.000000000000 Strict OpenGL objects wrapper.

StateSetting.h
Go to the documentation of this file.
1
2 #pragma once
3
4 #include <functional>
5 #include <set>
6 #include <memory>
7
8 #include <glbinding/gl/types.h>
9
10 #include <globjects/globjects_api.h>
11
12
13 namespace globjects
14 {
15
16
17 class AbstractFunctionCall;
18
19 class GLOBJECTS_API StateSettingType
20 {
21 public:
22 StateSettingType();
23 StateSettingType(void * functionIdentifier);
24
25 bool operator==(const StateSettingType & other) const;
26 std::size_t hash() const;
27
28 void specializeType(gl::GLenum subtype);
29
30 protected:
31 void * m_functionIdentifier;
32 std::set<gl::GLenum> m_subtypes;
33 };
34
35
36 class GLOBJECTS_API StateSetting
37 {
38 public:
39 template <typename... Arguments>
40 StateSetting(void (*function)(Arguments...), Arguments... arguments);
41
42 virtual ~StateSetting();
43
44 void apply();
45
46 StateSettingType & type();
47 const StateSettingType & type() const;
48
49 protected:
50 std::unique_ptr<AbstractFunctionCall> m_functionCall;
51 StateSettingType m_type;
52
53 protected:
54 StateSetting(std::unique_ptr<AbstractFunctionCall> && functionCall);
55 };
56
57 } // namespace globjects
58
59
60 namespace std
61 {
62
63 template <>
64 struct GLOBJECTS_API hash<globjects::StateSettingType>
65 {
66 size_t operator()(const globjects::StateSettingType & type) const;
67 };
68
69 } // namespace globjects
70
71
72 #include <globjects/StateSetting.inl>
globjects::StateSetting
Definition: StateSetting.h:36
globjects
Contains all the classes that wrap OpenGL functionality.
std
Definition: LocationIdentity.h:48
globjects::StateSettingType
Definition: StateSetting.h:19
globjects::StateSetting::m_functionCall
std::unique_ptr< AbstractFunctionCall > m_functionCall
Definition: StateSetting.h:50
globjects::StateSetting::m_type
StateSettingType m_type
Definition: StateSetting.h:51
globjects::StateSettingType::m_functionIdentifier
void * m_functionIdentifier
Definition: StateSetting.h:31
globjects::StateSettingType::m_subtypes
std::set< gl::GLenum > m_subtypes
Definition: StateSetting.h:32