StateSetting.h
Go to the documentation of this file.
#pragma once
#include <functional>
#include <set>
#include <memory>
#include <glbinding/gl/types.h>
#include <globjects/globjects_api.h>
namespace globjects
{
class AbstractFunctionCall;
class GLOBJECTS_API StateSettingType
{
public:
StateSettingType();
StateSettingType(void * functionIdentifier);
bool operator==(const StateSettingType & other) const;
std::size_t hash() const;
void specializeType(gl::GLenum subtype);
protected:
void * m_functionIdentifier;
std::set<gl::GLenum> m_subtypes;
};
class GLOBJECTS_API StateSetting
{
public:
template <typename... Arguments>
StateSetting(void (*function)(Arguments...), Arguments... arguments);
virtual ~StateSetting();
void apply();
StateSettingType & type();
const StateSettingType & type() const;
protected:
std::unique_ptr<AbstractFunctionCall> m_functionCall;
StateSettingType m_type;
protected:
StateSetting(std::unique_ptr<AbstractFunctionCall> && functionCall);
};
} // namespace globjects
namespace std
{
template <>
struct GLOBJECTS_API hash<globjects::StateSettingType>
{
size_t operator()(const globjects::StateSettingType & type) const;
};
} // namespace globjects
#include <globjects/StateSetting.inl>
globjects::StateSettingType::m_subtypes
std::set< gl::GLenum > m_subtypes
Definition: StateSetting.h:32
globjects::StateSetting::m_type
StateSettingType m_type
Definition: StateSetting.h:51
globjects::StateSetting
Definition: StateSetting.h:36
globjects::StateSettingType::m_functionIdentifier
void * m_functionIdentifier
Definition: StateSetting.h:31
globjects::StateSetting::m_functionCall
std::unique_ptr< AbstractFunctionCall > m_functionCall
Definition: StateSetting.h:50
globjects
Contains all the classes that wrap OpenGL functionality.
globjects::StateSettingType
Definition: StateSetting.h:19
std
Definition: LocationIdentity.h:48