From 317457096901d45f69937bb95ed71327428be0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 26 Jan 2012 19:41:05 +0100 Subject: [PATCH] Moved ColorFormat enum back to AbstractTexture. --- src/AbstractTexture.h | 11 ++++++++++- src/Image.h | 19 +++++-------------- src/Texture.h | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/AbstractTexture.h b/src/AbstractTexture.h index 16766a682..17c08030e 100644 --- a/src/AbstractTexture.h +++ b/src/AbstractTexture.h @@ -21,7 +21,6 @@ #include "Magnum.h" #include "TypeTraits.h" -#include "Image.h" namespace Magnum { @@ -108,6 +107,16 @@ class AbstractTexture { CompressedRGBA = GL_COMPRESSED_RGBA }; + /** @brief Color format */ + enum class ColorFormat: GLenum { + Red = GL_RED, + RedGreen = GL_RG, + RGB = GL_RGB, + RGBA = GL_RGBA, + BGR = GL_BGR, + BGRA = GL_BGRA + }; + /** * @brief Constructor * @param layer %Texture layer (number between 0 and 31) diff --git a/src/Image.h b/src/Image.h index 6cdac5066..e1e2abffa 100644 --- a/src/Image.h +++ b/src/Image.h @@ -16,24 +16,15 @@ */ /** @file - * @brief Enum Magnum::ColorFormat, class Magnum::Image + * @brief Class Magnum::Image */ #include "Magnum.h" #include "TypeTraits.h" +#include "AbstractTexture.h" namespace Magnum { -/** @brief Color format */ -enum class ColorFormat: GLenum { - Red = GL_RED, - RedGreen = GL_RG, - RGB = GL_RGB, - RGBA = GL_RGBA, - BGR = GL_BGR, - BGRA = GL_BGRA -}; - /** @brief %Image @@ -60,7 +51,7 @@ template class Image { * @attention Note that the image data are not copied on construction, * but they are deleted on class destruction. */ - template Image(const Math::Vector& dimensions, ColorFormat colorFormat, const T* data): _dimensions(dimensions), _colorFormat(colorFormat), _type(TypeTraits::TextureType>::glType()), _data(reinterpret_cast(data)) {} + template Image(const Math::Vector& dimensions, AbstractTexture::ColorFormat colorFormat, const T* data): _dimensions(dimensions), _colorFormat(colorFormat), _type(TypeTraits::TextureType>::glType()), _data(reinterpret_cast(data)) {} /** @brief Destructor */ virtual ~Image() { delete[] _data; } @@ -69,7 +60,7 @@ template class Image { inline const Math::Vector& dimensions() const { return _dimensions; } /** @brief Color format */ - inline ColorFormat colorFormat() const { return _colorFormat; } + inline AbstractTexture::ColorFormat colorFormat() const { return _colorFormat; } /** @brief Data type */ GLenum type() const { return _type; } @@ -79,7 +70,7 @@ template class Image { private: Math::Vector _dimensions; - ColorFormat _colorFormat; + AbstractTexture::ColorFormat _colorFormat; GLenum _type; const char* _data; }; diff --git a/src/Texture.h b/src/Texture.h index 4ce9d925a..53de3a0aa 100644 --- a/src/Texture.h +++ b/src/Texture.h @@ -19,7 +19,7 @@ * @brief Class Magnum::Texture */ -#include "AbstractTexture.h" +#include "Image.h" namespace Magnum {