From a5e8d4535cab1faeac6ae5baa8bdfd6f9809eda5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 22 Nov 2012 01:31:00 +0100 Subject: [PATCH] Debug output operator for Version enum. --- src/Context.cpp | 24 ++++++++++++++++++++++++ src/Context.h | 3 +++ 2 files changed, 27 insertions(+) diff --git a/src/Context.cpp b/src/Context.cpp index df6b751af..8809955b5 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -33,6 +33,30 @@ using namespace std; namespace Magnum { +Debug operator<<(Debug debug, Version value) { + switch(value) { + #define _c(value) case Version::value: return debug << "Version::" #value; + _c(None) + #ifndef MAGNUM_TARGET_GLES + _c(GL210) + _c(GL300) + _c(GL310) + _c(GL320) + _c(GL330) + _c(GL400) + _c(GL410) + _c(GL420) + _c(GL430) + #else + _c(GLES200) + _c(GLES300) + #endif + #undef _c + } + + return debug << "Version::(invalid)"; +} + const std::vector& Extension::extensions(Version version) { #define _extension(prefix, vendor, extension) \ {Extensions::prefix::vendor::extension::Index, Extensions::prefix::vendor::extension::requiredVersion(), Extensions::prefix::vendor::extension::coreVersion(), Extensions::prefix::vendor::extension::string()} diff --git a/src/Context.h b/src/Context.h index b34db7072..959a3ad6a 100644 --- a/src/Context.h +++ b/src/Context.h @@ -76,6 +76,9 @@ enum class Version: GLint { #endif }; +/** @debugoperator{Magnum::Context} */ +Debug MAGNUM_EXPORT operator<<(Debug debug, Version value); + /** @brief Run-time information about OpenGL extension