|
|
|
|
@ -340,32 +340,97 @@ Double-buffered OpenGL context.
|
|
|
|
|
*/ |
|
|
|
|
class AbstractXApplication::GLConfiguration: public GL::Context::Configuration { |
|
|
|
|
public: |
|
|
|
|
/**
|
|
|
|
|
* @brief Context flag |
|
|
|
|
* |
|
|
|
|
* Includes also everything from @ref GL::Context::Configuration::Flag. |
|
|
|
|
* @see @ref Flags, @ref setFlags(), @ref GL::Context::Flag |
|
|
|
|
*/ |
|
|
|
|
enum class Flag: UnsignedLong { |
|
|
|
|
/**
|
|
|
|
|
* @copydoc GL::Context::Configuration::Flag::QuietLog |
|
|
|
|
* @m_since_latest |
|
|
|
|
*/ |
|
|
|
|
QuietLog = UnsignedLong(GL::Context::Configuration::Flag::QuietLog), |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @copydoc GL::Context::Configuration::Flag::VerboseLog |
|
|
|
|
* @m_since_latest |
|
|
|
|
*/ |
|
|
|
|
VerboseLog = UnsignedLong(GL::Context::Configuration::Flag::VerboseLog), |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @copydoc GL::Context::Configuration::Flag::GpuValidation |
|
|
|
|
* @m_since_latest |
|
|
|
|
*/ |
|
|
|
|
GpuValidation = UnsignedLong(GL::Context::Configuration::Flag::GpuValidation) |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Context flags |
|
|
|
|
* |
|
|
|
|
* @see @ref setFlags(), @ref Context::Flags |
|
|
|
|
*/ |
|
|
|
|
typedef Containers::EnumSet<Flag> Flags; |
|
|
|
|
|
|
|
|
|
explicit GLConfiguration(); |
|
|
|
|
~GLConfiguration(); |
|
|
|
|
|
|
|
|
|
/** @copydoc Sdl2Application::GLConfiguration::version() */ |
|
|
|
|
GL::Version version() const { return _version; } |
|
|
|
|
|
|
|
|
|
/** @copydoc Sdl2Application::GLConfiguration::setVersion() */ |
|
|
|
|
GLConfiguration& setVersion(GL::Version version) { |
|
|
|
|
_version = version; |
|
|
|
|
return *this; |
|
|
|
|
/** @brief Context flags */ |
|
|
|
|
Flags flags() const { |
|
|
|
|
return Flag(UnsignedLong(GL::Context::Configuration::flags())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Overloads to remove WTF-factor from method chaining order */ |
|
|
|
|
#ifndef DOXYGEN_GENERATING_OUTPUT |
|
|
|
|
/**
|
|
|
|
|
* @brief Set context flags |
|
|
|
|
* @return Reference to self (for method chaining) |
|
|
|
|
* |
|
|
|
|
* Default is no flag. To avoid clearing default flags by accident, |
|
|
|
|
* prefer to use @ref addFlags() and @ref clearFlags() instead. |
|
|
|
|
* @see @ref GL::Context::flags() |
|
|
|
|
*/ |
|
|
|
|
GLConfiguration& setFlags(Flags flags) { |
|
|
|
|
GL::Context::Configuration::setFlags(flags); |
|
|
|
|
GL::Context::Configuration::setFlags(GL::Context::Configuration::Flag(UnsignedLong(flags))); |
|
|
|
|
return *this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Add context flags |
|
|
|
|
* @return Reference to self (for method chaining) |
|
|
|
|
* |
|
|
|
|
* Unlike @ref setFlags(), ORs the flags with existing instead of |
|
|
|
|
* replacing them. Useful for preserving the defaults. |
|
|
|
|
* @see @ref clearFlags() |
|
|
|
|
*/ |
|
|
|
|
GLConfiguration& addFlags(Flags flags) { |
|
|
|
|
GL::Context::Configuration::addFlags(flags); |
|
|
|
|
GL::Context::Configuration::addFlags(GL::Context::Configuration::Flag(UnsignedLong(flags))); |
|
|
|
|
return *this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Clear context flags |
|
|
|
|
* @return Reference to self (for method chaining) |
|
|
|
|
* |
|
|
|
|
* Unlike @ref setFlags(), ANDs the inverse of @p flags with existing |
|
|
|
|
* instead of replacing them. Useful for removing default flags. |
|
|
|
|
* @see @ref addFlags() |
|
|
|
|
*/ |
|
|
|
|
GLConfiguration& clearFlags(Flags flags) { |
|
|
|
|
GL::Context::Configuration::clearFlags(flags); |
|
|
|
|
GL::Context::Configuration::clearFlags(GL::Context::Configuration::Flag(UnsignedLong(flags))); |
|
|
|
|
return *this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** @copydoc Sdl2Application::GLConfiguration::version() */ |
|
|
|
|
GL::Version version() const { return _version; } |
|
|
|
|
|
|
|
|
|
/** @copydoc Sdl2Application::GLConfiguration::setVersion() */ |
|
|
|
|
GLConfiguration& setVersion(GL::Version version) { |
|
|
|
|
_version = version; |
|
|
|
|
return *this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Overloads to remove WTF-factor from method chaining order */ |
|
|
|
|
#ifndef DOXYGEN_GENERATING_OUTPUT |
|
|
|
|
MAGNUM_GL_CONTEXT_CONFIGURATION_SUBCLASS_IMPLEMENTATION(GLConfiguration) |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|