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