From c71e9b953bc539e22024b58f98b5e0e2502ceafe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Apr 2025 14:41:01 +0200 Subject: [PATCH] Text: drop also the Vector2 include in GlyphCacheGL.h. Now it's finally as it should be. --- src/Magnum/Text/GlyphCacheGL.cpp | 9 +++++++++ src/Magnum/Text/GlyphCacheGL.h | 28 +++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Text/GlyphCacheGL.cpp b/src/Magnum/Text/GlyphCacheGL.cpp index 911f0a8cb..91ba59a86 100644 --- a/src/Magnum/Text/GlyphCacheGL.cpp +++ b/src/Magnum/Text/GlyphCacheGL.cpp @@ -35,6 +35,7 @@ #if (!defined(MAGNUM_TARGET_GLES) || (defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL))) || defined(MAGNUM_BUILD_DEPRECATED) #include "Magnum/PixelFormat.h" #endif +#include "Magnum/Math/Vector2.h" #if !defined(MAGNUM_TARGET_GLES) || (defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)) #include "Magnum/GL/Context.h" #include "Magnum/GL/Extensions.h" @@ -91,8 +92,12 @@ GlyphCacheGL::State::State(const PixelFormat format, const Vector2i& size, const GlyphCacheGL::GlyphCacheGL(PixelFormat format, const Vector2i& size, PixelFormat processedFormat, const Vector2i& processedSize, const Vector2i& padding): AbstractGlyphCache{Containers::pointer(format, size, processedFormat, processedSize, padding)} {} +GlyphCacheGL::GlyphCacheGL(PixelFormat format, const Vector2i& size, PixelFormat processedFormat, const Vector2i& processedSize): GlyphCacheGL{format, size, processedFormat, processedSize, Vector2i{1}} {} + GlyphCacheGL::GlyphCacheGL(const PixelFormat format, const Vector2i& size, const Vector2i& padding): GlyphCacheGL{format, size, format, size, padding} {} +GlyphCacheGL::GlyphCacheGL(const PixelFormat format, const Vector2i& size): GlyphCacheGL{format, size, Vector2i{1}} {} + #ifdef MAGNUM_BUILD_DEPRECATED /* The unconditional Optional unwrap in these two may assert in rare cases. Let's hope it doesn't in practice. */ @@ -208,8 +213,12 @@ GlyphCacheArrayGL::State::State(const PixelFormat format, const Vector3i& size, GlyphCacheArrayGL::GlyphCacheArrayGL(PixelFormat format, const Vector3i& size, PixelFormat processedFormat, const Vector2i& processedSize, const Vector2i& padding): AbstractGlyphCache{Containers::pointer(format, size, processedFormat, processedSize, padding)} {} +GlyphCacheArrayGL::GlyphCacheArrayGL(PixelFormat format, const Vector3i& size, PixelFormat processedFormat, const Vector2i& processedSize): GlyphCacheArrayGL{format, size, processedFormat, processedSize, Vector2i{1}} {} + GlyphCacheArrayGL::GlyphCacheArrayGL(const PixelFormat format, const Vector3i& size, const Vector2i& padding): GlyphCacheArrayGL{format, size, format, size.xy(), padding} {} +GlyphCacheArrayGL::GlyphCacheArrayGL(const PixelFormat format, const Vector3i& size): GlyphCacheArrayGL{format, size, Vector2i{1}} {} + GlyphCacheArrayGL::GlyphCacheArrayGL(NoCreateT) noexcept: AbstractGlyphCache{NoCreate} {} GL::Texture2DArray& GlyphCacheArrayGL::texture() { diff --git a/src/Magnum/Text/GlyphCacheGL.h b/src/Magnum/Text/GlyphCacheGL.h index 6e5754212..b604ef621 100644 --- a/src/Magnum/Text/GlyphCacheGL.h +++ b/src/Magnum/Text/GlyphCacheGL.h @@ -34,7 +34,9 @@ #include "Magnum/configure.h" #ifdef MAGNUM_TARGET_GL -#include "Magnum/Math/Vector2.h" +#ifdef MAGNUM_BUILD_DEPRECATED +#include "Magnum/Math/Vector2.h" /* default argument in deprecated APIs */ +#endif #include "Magnum/GL/GL.h" #include "Magnum/Text/AbstractGlyphCache.h" @@ -96,7 +98,13 @@ class MAGNUM_TEXT_EXPORT GlyphCacheGL: public AbstractGlyphCache { * @p format and @p size, use @ref AbstractGlyphCache(PixelFormat, const Vector3i&, PixelFormat, const Vector2i&, const Vector2i&) * to specify different values. */ + #ifdef DOXYGEN_GENERATING_OUTPUT explicit GlyphCacheGL(PixelFormat format, const Vector2i& size, const Vector2i& padding = Vector2i{1}); + #else + /* To avoid a Vector2 include */ + explicit GlyphCacheGL(PixelFormat format, const Vector2i& size, const Vector2i& padding); + explicit GlyphCacheGL(PixelFormat format, const Vector2i& size); + #endif #ifdef MAGNUM_BUILD_DEPRECATED /** @@ -179,7 +187,13 @@ class MAGNUM_TEXT_EXPORT GlyphCacheGL: public AbstractGlyphCache { * into account. * @see @ref AbstractGlyphCache(PixelFormat, const Vector2i&, const Vector2i&) */ + #ifdef DOXYGEN_GENERATING_OUTPUT explicit GlyphCacheGL(PixelFormat format, const Vector2i& size, PixelFormat processedFormat, const Vector2i& processedSize, const Vector2i& padding = Vector2i{1}); + #else + /* To avoid a Vector2 include */ + explicit GlyphCacheGL(PixelFormat format, const Vector2i& size, PixelFormat processedFormat, const Vector2i& processedSize, const Vector2i& padding); + explicit GlyphCacheGL(PixelFormat format, const Vector2i& size, PixelFormat processedFormat, const Vector2i& processedSize); + #endif #ifdef DOXYGEN_GENERATING_OUTPUT private: @@ -247,7 +261,13 @@ class MAGNUM_TEXT_EXPORT GlyphCacheArrayGL: public AbstractGlyphCache { * @p format and @p size, use @ref AbstractGlyphCache(PixelFormat, const Vector3i&, PixelFormat, const Vector2i&, const Vector2i&) * to specify different values. */ + #ifdef DOXYGEN_GENERATING_OUTPUT explicit GlyphCacheArrayGL(PixelFormat format, const Vector3i& size, const Vector2i& padding = Vector2i{1}); + #else + /* To avoid a Vector2 include */ + explicit GlyphCacheArrayGL(PixelFormat format, const Vector3i& size, const Vector2i& padding); + explicit GlyphCacheArrayGL(PixelFormat format, const Vector3i& size); + #endif /** * @brief Construct with a specific processed format and size @@ -268,7 +288,13 @@ class MAGNUM_TEXT_EXPORT GlyphCacheArrayGL: public AbstractGlyphCache { * has @p processedSize. * @see @ref AbstractGlyphCache(PixelFormat, const Vector2i&, const Vector2i&) */ + #ifdef DOXYGEN_GENERATING_OUTPUT explicit GlyphCacheArrayGL(PixelFormat format, const Vector3i& size, PixelFormat processedFormat, const Vector2i& processedSize, const Vector2i& padding = Vector2i{1}); + #else + /* To avoid a Vector2 include */ + explicit GlyphCacheArrayGL(PixelFormat format, const Vector3i& size, PixelFormat processedFormat, const Vector2i& processedSize, const Vector2i& padding); + explicit GlyphCacheArrayGL(PixelFormat format, const Vector3i& size, PixelFormat processedFormat, const Vector2i& processedSize); + #endif /** * @brief Construct without creating the internal state and the OpenGL texture object