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
13namespace globjects
14{
15
16
17class AbstractFunctionCall;
18
19class GLOBJECTS_API StateSettingType
20{
21public:
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
30protected:
32 std::set<gl::GLenum> m_subtypes;
33};
34
35
36class GLOBJECTS_API StateSetting
37{
38public:
39 template <typename... Arguments>
40 StateSetting(void (*function)(Arguments...), Arguments... arguments);
41
42 virtual ~StateSetting();
43
44 void apply();
45
47 const StateSettingType & type() const;
48
49protected:
50 std::unique_ptr<AbstractFunctionCall> m_functionCall;
52
53protected:
54 StateSetting(std::unique_ptr<AbstractFunctionCall> && functionCall);
55};
56
57} // namespace globjects
58
59
60namespace std
61{
62
63template <>
64struct 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>
Definition: StateSetting.h:37
std::unique_ptr< AbstractFunctionCall > m_functionCall
Definition: StateSetting.h:50
StateSettingType m_type
Definition: StateSetting.h:51
StateSettingType & type()
StateSetting(void(*function)(Arguments...), Arguments... arguments)
StateSetting(std::unique_ptr< AbstractFunctionCall > &&functionCall)
const StateSettingType & type() const
Definition: StateSetting.h:20
std::set< gl::GLenum > m_subtypes
Definition: StateSetting.h:32
std::size_t hash() const
void * m_functionIdentifier
Definition: StateSetting.h:31
StateSettingType(void *functionIdentifier)
bool operator==(const StateSettingType &other) const
void specializeType(gl::GLenum subtype)
Contains all the classes that wrap OpenGL functionality.
Definition: LocationIdentity.h:49
size_t operator()(const globjects::StateSettingType &type) const