From db5618c3258415f9a42aee96e49672836b0d11f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 27 Nov 2013 14:44:22 +0100 Subject: [PATCH] OpenGL ES 2.0 and 3.0 share the same extension list. Until recently (or maybe not too recently) ES3 extension header was "currently empty", now the extension header is shared with ES2. It's nice to finally get rid of all the weird ifndefs. --- src/AbstractFramebuffer.cpp | 6 ------ src/AbstractFramebuffer.h | 2 -- src/AbstractImage.cpp | 8 -------- src/AbstractTexture.cpp | 14 -------------- src/AbstractTexture.h | 2 -- src/Buffer.cpp | 4 ---- src/Buffer.h | 10 +--------- src/ColorFormat.cpp | 8 -------- src/ColorFormat.h | 8 -------- src/Context.h | 2 -- src/CubeMapTexture.h | 2 -- src/CubeMapTextureArray.h | 2 -- src/Implementation/RendererState.h | 8 +------- src/OpenGL.h | 2 +- src/Platform/magnum-info.cpp | 2 -- src/Query.cpp | 8 +++----- src/Query.h | 4 ---- src/RenderbufferFormat.h | 4 ---- src/Renderer.cpp | 14 -------------- src/Renderer.h | 12 ++---------- src/Sampler.cpp | 4 ---- src/Sampler.h | 4 ---- src/Test/BufferGLTest.cpp | 2 -- src/Test/RendererTest.cpp | 4 ---- src/Texture.h | 2 -- src/TextureFormat.h | 18 +++--------------- 26 files changed, 11 insertions(+), 145 deletions(-) diff --git a/src/AbstractFramebuffer.cpp b/src/AbstractFramebuffer.cpp index f9bb9c33d..d6bbb95f4 100644 --- a/src/AbstractFramebuffer.cpp +++ b/src/AbstractFramebuffer.cpp @@ -277,7 +277,6 @@ void AbstractFramebuffer::initializeContextBasedFunctionality(Context& context) else readTarget = drawTarget = FramebufferTarget::ReadDraw; #endif - #ifndef MAGNUM_TARGET_GLES3 #ifndef MAGNUM_TARGET_GLES if(context.isExtensionSupported()) #else @@ -295,9 +294,6 @@ void AbstractFramebuffer::initializeContextBasedFunctionality(Context& context) readImplementation = &AbstractFramebuffer::readImplementationRobustness; #endif } - #else - static_cast(context); - #endif } GLenum AbstractFramebuffer::checkStatusImplementationDefault(const FramebufferTarget target) { @@ -380,7 +376,6 @@ void AbstractFramebuffer::readImplementationDefault(const Vector2i& offset, cons glReadPixels(offset.x(), offset.y(), size.x(), size.y(), GLenum(format), GLenum(type), data); } -#ifndef MAGNUM_TARGET_GLES3 void AbstractFramebuffer::readImplementationRobustness(const Vector2i& offset, const Vector2i& size, const ColorFormat format, const ColorType type, const std::size_t dataSize, GLvoid* const data) { /** @todo Enable when extension wrangler for ES is available */ #ifndef MAGNUM_TARGET_GLES @@ -396,6 +391,5 @@ void AbstractFramebuffer::readImplementationRobustness(const Vector2i& offset, c static_cast(data); #endif } -#endif } diff --git a/src/AbstractFramebuffer.h b/src/AbstractFramebuffer.h index 00781be99..ac7272622 100644 --- a/src/AbstractFramebuffer.h +++ b/src/AbstractFramebuffer.h @@ -360,9 +360,7 @@ class MAGNUM_EXPORT AbstractFramebuffer { typedef void(*ReadImplementation)(const Vector2i&, const Vector2i&, ColorFormat, ColorType, std::size_t, GLvoid*); static void MAGNUM_LOCAL readImplementationDefault(const Vector2i& offset, const Vector2i& size, ColorFormat format, ColorType type, std::size_t dataSize, GLvoid* data); - #ifndef MAGNUM_TARGET_GLES3 static void MAGNUM_LOCAL readImplementationRobustness(const Vector2i& offset, const Vector2i& size, ColorFormat format, ColorType type, std::size_t dataSize, GLvoid* data); - #endif static ReadImplementation MAGNUM_LOCAL readImplementation; }; diff --git a/src/AbstractImage.cpp b/src/AbstractImage.cpp index bde23f196..d593752a7 100644 --- a/src/AbstractImage.cpp +++ b/src/AbstractImage.cpp @@ -61,13 +61,9 @@ std::size_t AbstractImage::pixelSize(ColorFormat format, ColorType type) { case ColorType::UnsignedShort565Rev: #endif case ColorType::UnsignedShort4444: - #ifndef MAGNUM_TARGET_GLES3 case ColorType::UnsignedShort4444Rev: - #endif case ColorType::UnsignedShort5551: - #ifndef MAGNUM_TARGET_GLES3 case ColorType::UnsignedShort1555Rev: - #endif return 2; #ifndef MAGNUM_TARGET_GLES case ColorType::UnsignedInt8888: @@ -123,9 +119,7 @@ std::size_t AbstractImage::pixelSize(ColorFormat format, ColorType type) { #ifndef MAGNUM_TARGET_GLES2 case ColorFormat::RGBAInteger: #endif - #ifndef MAGNUM_TARGET_GLES3 case ColorFormat::BGRA: - #endif #ifndef MAGNUM_TARGET_GLES case ColorFormat::BGRAInteger: #endif @@ -133,9 +127,7 @@ std::size_t AbstractImage::pixelSize(ColorFormat format, ColorType type) { /* Handled above */ case ColorFormat::DepthComponent: - #ifndef MAGNUM_TARGET_GLES3 case ColorFormat::StencilIndex: - #endif case ColorFormat::DepthStencil: CORRADE_ASSERT_UNREACHABLE(); } diff --git a/src/AbstractTexture.cpp b/src/AbstractTexture.cpp index a7dd1c781..3402ee414 100644 --- a/src/AbstractTexture.cpp +++ b/src/AbstractTexture.cpp @@ -366,9 +366,7 @@ ColorFormat AbstractTexture::imageFormatForInternalFormat(const TextureFormat in case TextureFormat::RGB5: #endif case TextureFormat::RGB565: - #ifndef MAGNUM_TARGET_GLES3 case TextureFormat::RGB10: - #endif #ifndef MAGNUM_TARGET_GLES case TextureFormat::RGB12: #endif @@ -376,9 +374,7 @@ ColorFormat AbstractTexture::imageFormatForInternalFormat(const TextureFormat in case TextureFormat::R11FG11FB10F: case TextureFormat::RGB9E5: #endif - #ifndef MAGNUM_TARGET_GLES3 case TextureFormat::SRGB: - #endif #ifndef MAGNUM_TARGET_GLES2 case TextureFormat::SRGB8: #endif @@ -421,9 +417,7 @@ ColorFormat AbstractTexture::imageFormatForInternalFormat(const TextureFormat in #ifndef MAGNUM_TARGET_GLES case TextureFormat::RGBA12: #endif - #ifndef MAGNUM_TARGET_GLES3 case TextureFormat::SRGBAlpha: - #endif #ifndef MAGNUM_TARGET_GLES2 case TextureFormat::SRGB8Alpha8: #endif @@ -455,9 +449,7 @@ ColorFormat AbstractTexture::imageFormatForInternalFormat(const TextureFormat in case TextureFormat::DepthComponent: case TextureFormat::DepthComponent16: case TextureFormat::DepthComponent24: - #ifndef MAGNUM_TARGET_GLES3 case TextureFormat::DepthComponent32: - #endif #ifndef MAGNUM_TARGET_GLES2 case TextureFormat::DepthComponent32F: #endif @@ -501,10 +493,8 @@ ColorType AbstractTexture::imageTypeForInternalFormat(const TextureFormat intern case TextureFormat::Luminance: case TextureFormat::LuminanceAlpha: #endif - #ifndef MAGNUM_TARGET_GLES3 case TextureFormat::SRGB: case TextureFormat::SRGBAlpha: - #endif #ifndef MAGNUM_TARGET_GLES2 case TextureFormat::SRGB8: case TextureFormat::SRGB8Alpha8: @@ -619,9 +609,7 @@ ColorType AbstractTexture::imageTypeForInternalFormat(const TextureFormat intern case TextureFormat::RGB565: return ColorType::UnsignedShort565; - #ifndef MAGNUM_TARGET_GLES3 case TextureFormat::RGB10: - #endif case TextureFormat::RGB10A2: #ifndef MAGNUM_TARGET_GLES2 case TextureFormat::RGB10A2UI: @@ -640,9 +628,7 @@ ColorType AbstractTexture::imageTypeForInternalFormat(const TextureFormat intern case TextureFormat::DepthComponent: case TextureFormat::DepthComponent24: - #ifndef MAGNUM_TARGET_GLES3 case TextureFormat::DepthComponent32: - #endif return ColorType::UnsignedInt; #ifndef MAGNUM_TARGET_GLES2 diff --git a/src/AbstractTexture.h b/src/AbstractTexture.h index c26bd4eee..81121b703 100644 --- a/src/AbstractTexture.h +++ b/src/AbstractTexture.h @@ -217,7 +217,6 @@ class MAGNUM_EXPORT AbstractTexture { return *this; } - #ifndef MAGNUM_TARGET_GLES3 /** * @brief Set border color * @return Reference to self (for method chaining) @@ -259,7 +258,6 @@ class MAGNUM_EXPORT AbstractTexture { (this->*parameterfImplementation)(GL_TEXTURE_MAX_ANISOTROPY_EXT, anisotropy); return *this; } - #endif /** * @brief Invalidate texture image diff --git a/src/Buffer.cpp b/src/Buffer.cpp index c445d38dd..a0638faa7 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -44,9 +44,7 @@ Buffer::DataImplementation Buffer::dataImplementation = &Buffer::dataImplementat Buffer::SubDataImplementation Buffer::subDataImplementation = &Buffer::subDataImplementationDefault; Buffer::InvalidateImplementation Buffer::invalidateImplementation = &Buffer::invalidateImplementationNoOp; Buffer::InvalidateSubImplementation Buffer::invalidateSubImplementation = &Buffer::invalidateSubImplementationNoOp; -#ifndef MAGNUM_TARGET_GLES3 Buffer::MapImplementation Buffer::mapImplementation = &Buffer::mapImplementationDefault; -#endif Buffer::MapRangeImplementation Buffer::mapRangeImplementation = &Buffer::mapRangeImplementationDefault; Buffer::FlushMappedRangeImplementation Buffer::flushMappedRangeImplementation = &Buffer::flushMappedRangeImplementationDefault; Buffer::UnmapImplementation Buffer::unmapImplementation = &Buffer::unmapImplementationDefault; @@ -294,7 +292,6 @@ void Buffer::invalidateSubImplementationARB(GLintptr offset, GLsizeiptr length) } #endif -#ifndef MAGNUM_TARGET_GLES3 void* Buffer::mapImplementationDefault(MapAccess access) { /** @todo Re-enable when extension wrangler is available for ES */ #ifndef MAGNUM_TARGET_GLES @@ -310,7 +307,6 @@ void* Buffer::mapImplementationDSA(MapAccess access) { return glMapNamedBufferEXT(_id, GLenum(access)); } #endif -#endif void* Buffer::mapRangeImplementationDefault(GLintptr offset, GLsizeiptr length, MapFlags access) { /** @todo Re-enable when extension wrangler is available for ES */ diff --git a/src/Buffer.h b/src/Buffer.h index 0c7384777..3dfb0d479 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -314,7 +314,6 @@ class MAGNUM_EXPORT Buffer { typedef BufferUsage Usage; #endif - #ifndef MAGNUM_TARGET_GLES3 /** * @brief Memory mapping access * @@ -322,9 +321,7 @@ class MAGNUM_EXPORT Buffer { * instead, as it has more complete set of features. * @see map(MapAccess), mapSub() * @requires_es_extension %Extension @es_extension{OES,mapbuffer} or - * @es_extension{CHROMIUM,map_sub} in OpenGL ES 2.0, use - * @ref Magnum::Buffer::map(GLintptr, GLsizeiptr, MapFlags) "map(GLintptr, GLsizeiptr, MapFlags)" - * in OpenGL ES 3.0 instead. + * @es_extension{CHROMIUM,map_sub} */ enum class MapAccess: GLenum { #ifndef MAGNUM_TARGET_GLES @@ -352,7 +349,6 @@ class MAGNUM_EXPORT Buffer { ReadWrite = GL_READ_WRITE #endif }; - #endif /** * @brief Memory mapping flag @@ -763,7 +759,6 @@ class MAGNUM_EXPORT Buffer { } #endif - #ifndef MAGNUM_TARGET_GLES3 /** * @brief Map buffer to client memory * @param access Access @@ -784,7 +779,6 @@ class MAGNUM_EXPORT Buffer { void* map(MapAccess access) { return (this->*mapImplementation)(access); } - #endif #if defined(MAGNUM_TARGET_GLES2) || defined(DOXYGEN_GENERATING_OUTPUT) /** @@ -941,14 +935,12 @@ class MAGNUM_EXPORT Buffer { #endif static InvalidateSubImplementation invalidateSubImplementation; - #ifndef MAGNUM_TARGET_GLES3 typedef void*(Buffer::*MapImplementation)(MapAccess); void MAGNUM_LOCAL * mapImplementationDefault(MapAccess access); #ifndef MAGNUM_TARGET_GLES void MAGNUM_LOCAL * mapImplementationDSA(MapAccess access); #endif static MapImplementation mapImplementation; - #endif typedef void*(Buffer::*MapRangeImplementation)(GLintptr, GLsizeiptr, MapFlags); void MAGNUM_LOCAL * mapRangeImplementationDefault(GLintptr offset, GLsizeiptr length, MapFlags access); diff --git a/src/ColorFormat.cpp b/src/ColorFormat.cpp index 235e95f16..7b3403ec2 100644 --- a/src/ColorFormat.cpp +++ b/src/ColorFormat.cpp @@ -49,9 +49,7 @@ Debug operator<<(Debug debug, const ColorFormat value) { #ifndef MAGNUM_TARGET_GLES _c(BGR) #endif - #ifndef MAGNUM_TARGET_GLES3 _c(BGRA) - #endif #ifndef MAGNUM_TARGET_GLES2 _c(RedInteger) #ifndef MAGNUM_TARGET_GLES @@ -67,9 +65,7 @@ Debug operator<<(Debug debug, const ColorFormat value) { #endif #endif _c(DepthComponent) - #ifndef MAGNUM_TARGET_GLES3 _c(StencilIndex) - #endif _c(DepthStencil) #undef _c } @@ -103,13 +99,9 @@ Debug operator<<(Debug debug, const ColorType value) { _c(UnsignedShort565Rev) #endif _c(UnsignedShort4444) - #ifndef MAGNUM_TARGET_GLES3 _c(UnsignedShort4444Rev) - #endif _c(UnsignedShort5551) - #ifndef MAGNUM_TARGET_GLES3 _c(UnsignedShort1555Rev) - #endif #ifndef MAGNUM_TARGET_GLES _c(UnsignedInt8888) _c(UnsignedInt8888Rev) diff --git a/src/ColorFormat.h b/src/ColorFormat.h index 918ff0d42..54c014d7f 100644 --- a/src/ColorFormat.h +++ b/src/ColorFormat.h @@ -123,7 +123,6 @@ enum class ColorFormat: GLenum { BGR = GL_BGR, #endif - #ifndef MAGNUM_TARGET_GLES3 /** * Floating-point BGRA. * @requires_es_extension %Extension @es_extension{EXT,read_format_bgra} @@ -135,7 +134,6 @@ enum class ColorFormat: GLenum { #else BGRA = GL_BGRA_EXT, #endif - #endif #ifndef MAGNUM_TARGET_GLES2 /** @@ -221,7 +219,6 @@ enum class ColorFormat: GLenum { */ DepthComponent = GL_DEPTH_COMPONENT, - #ifndef MAGNUM_TARGET_GLES3 /** * Stencil index. * @requires_gl44 %Extension @extension{ARB,texture_stencil8} for texture @@ -235,7 +232,6 @@ enum class ColorFormat: GLenum { #else StencilIndex = 0x1901, #endif - #endif /** * Depth and stencil. @@ -361,7 +357,6 @@ enum class ColorType: GLenum { */ UnsignedShort4444 = GL_UNSIGNED_SHORT_4_4_4_4, - #ifndef MAGNUM_TARGET_GLES3 /** * ABGR, unsigned short, each component 4bit. * @requires_es_extension For framebuffer reading only, extension @@ -372,7 +367,6 @@ enum class ColorType: GLenum { #else UnsignedShort4444Rev = GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, #endif - #endif /** * RGBA, unsigned short, each RGB component 5bit, alpha component 1bit. @@ -380,7 +374,6 @@ enum class ColorType: GLenum { */ UnsignedShort5551 = GL_UNSIGNED_SHORT_5_5_5_1, - #ifndef MAGNUM_TARGET_GLES3 /** * ABGR, unsigned short, each RGB component 5bit, alpha component 1bit. * @requires_es_extension For framebuffer reading only, extension @@ -391,7 +384,6 @@ enum class ColorType: GLenum { #else UnsignedShort1555Rev = GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT, #endif - #endif #ifndef MAGNUM_TARGET_GLES /** diff --git a/src/Context.h b/src/Context.h index b76878f77..f2aa1903a 100644 --- a/src/Context.h +++ b/src/Context.h @@ -154,7 +154,6 @@ class MAGNUM_EXPORT Context { * @see Flags, flags() */ enum class Flag: GLint { - #ifndef MAGNUM_TARGET_GLES3 /** * Debug context * @requires_gl43 %Extension @es_extension{KHR,debug} @@ -165,7 +164,6 @@ class MAGNUM_EXPORT Context { #else Debug = GL_CONTEXT_FLAG_DEBUG_BIT_KHR, #endif - #endif #ifndef MAGNUM_TARGET_GLES /** diff --git a/src/CubeMapTexture.h b/src/CubeMapTexture.h index aff742119..410b6125f 100644 --- a/src/CubeMapTexture.h +++ b/src/CubeMapTexture.h @@ -232,7 +232,6 @@ class CubeMapTexture: public AbstractTexture { AbstractTexture::setMagnificationFilter(filter); return *this; } - #ifndef MAGNUM_TARGET_GLES3 CubeMapTexture& setBorderColor(const Color4& color) { AbstractTexture::setBorderColor(color); return *this; @@ -241,7 +240,6 @@ class CubeMapTexture: public AbstractTexture { AbstractTexture::setMaxAnisotropy(anisotropy); return *this; } - #endif CubeMapTexture& generateMipmap() { AbstractTexture::generateMipmap(); return *this; diff --git a/src/CubeMapTextureArray.h b/src/CubeMapTextureArray.h index feeccd090..99d72f2ae 100644 --- a/src/CubeMapTextureArray.h +++ b/src/CubeMapTextureArray.h @@ -242,7 +242,6 @@ class CubeMapTextureArray: public AbstractTexture { AbstractTexture::setMagnificationFilter(filter); return *this; } - #ifndef MAGNUM_TARGET_GLES3 CubeMapTextureArray& setBorderColor(const Color4& color) { AbstractTexture::setBorderColor(color); return *this; @@ -251,7 +250,6 @@ class CubeMapTextureArray: public AbstractTexture { AbstractTexture::setMaxAnisotropy(anisotropy); return *this; } - #endif CubeMapTextureArray& generateMipmap() { AbstractTexture::generateMipmap(); return *this; diff --git a/src/Implementation/RendererState.h b/src/Implementation/RendererState.h index 3092f9165..e356c2e82 100644 --- a/src/Implementation/RendererState.h +++ b/src/Implementation/RendererState.h @@ -29,15 +29,9 @@ namespace Magnum { namespace Implementation { struct RendererState { - constexpr RendererState() - #ifndef MAGNUM_TARGET_GLES3 - : resetNotificationStrategy() - #endif - {} + constexpr RendererState(): resetNotificationStrategy() {} - #ifndef MAGNUM_TARGET_GLES3 Renderer::ResetNotificationStrategy resetNotificationStrategy; - #endif }; }} diff --git a/src/OpenGL.h b/src/OpenGL.h index 70b7d3a5c..534cc43d2 100644 --- a/src/OpenGL.h +++ b/src/OpenGL.h @@ -56,8 +56,8 @@ #else #include #include - #include #endif + #include #endif #endif diff --git a/src/Platform/magnum-info.cpp b/src/Platform/magnum-info.cpp index 228e4d164..c2e66e982 100644 --- a/src/Platform/magnum-info.cpp +++ b/src/Platform/magnum-info.cpp @@ -344,13 +344,11 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat } #endif - #ifndef MAGNUM_TARGET_GLES3 if(c->isExtensionSupported()) { _h(EXT::texture_filter_anisotropic) _l(Sampler::maxAnisotropy()) } - #endif #undef _l #undef _h diff --git a/src/Query.cpp b/src/Query.cpp index ac0f251fa..79203c0d7 100644 --- a/src/Query.cpp +++ b/src/Query.cpp @@ -91,13 +91,12 @@ template<> UnsignedInt AbstractQuery::result() { return result; } -#ifndef MAGNUM_TARGET_GLES3 template<> Int AbstractQuery::result() { CORRADE_ASSERT(!target, "AbstractQuery::result(): the query is currently running", {}); /** @todo Re-enable when extension wrangler is available for ES */ Int result; - #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_GLES glGetQueryObjectiv(_id, GL_QUERY_RESULT, &result); #else CORRADE_INTERNAL_ASSERT(false); @@ -111,7 +110,7 @@ template<> UnsignedLong AbstractQuery::result() { /** @todo Re-enable when extension wrangler is available for ES */ UnsignedLong result; - #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_GLES glGetQueryObjectui64v(_id, GL_QUERY_RESULT, &result); #else CORRADE_INTERNAL_ASSERT(false); @@ -125,7 +124,7 @@ template<> Long AbstractQuery::result() { /** @todo Re-enable when extension wrangler is available for ES */ Long result; - #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_GLES glGetQueryObjecti64v(_id, GL_QUERY_RESULT, &result); #else CORRADE_INTERNAL_ASSERT(false); @@ -134,7 +133,6 @@ template<> Long AbstractQuery::result() { return result; } #endif -#endif void AbstractQuery::begin(GLenum target) { CORRADE_ASSERT(!this->target, "AbstractQuery::begin(): the query is already running", ); diff --git a/src/Query.h b/src/Query.h index 624d33969..9e4f8fad0 100644 --- a/src/Query.h +++ b/src/Query.h @@ -110,12 +110,10 @@ class MAGNUM_EXPORT AbstractQuery { #ifndef DOXYGEN_GENERATING_OUTPUT template<> bool MAGNUM_EXPORT AbstractQuery::result(); template<> UnsignedInt MAGNUM_EXPORT AbstractQuery::result(); -#ifndef MAGNUM_TARGET_GLES3 template<> Int MAGNUM_EXPORT AbstractQuery::result(); template<> UnsignedLong MAGNUM_EXPORT AbstractQuery::result(); template<> Long MAGNUM_EXPORT AbstractQuery::result(); #endif -#endif #ifndef MAGNUM_TARGET_GLES2 /** @@ -307,7 +305,6 @@ class SampleQuery: public AbstractQuery { #endif }; -#ifndef MAGNUM_TARGET_GLES3 /** @brief Query for elapsed time @@ -374,7 +371,6 @@ class TimeQuery: public AbstractQuery { AbstractQuery::begin(GLenum(target)); } }; -#endif } diff --git a/src/RenderbufferFormat.h b/src/RenderbufferFormat.h index 9397bab46..9ba15e5eb 100644 --- a/src/RenderbufferFormat.h +++ b/src/RenderbufferFormat.h @@ -403,7 +403,6 @@ enum class RenderbufferFormat: GLenum { DepthComponent24 = GL_DEPTH_COMPONENT24_OES, #endif - #ifndef MAGNUM_TARGET_GLES3 /** * Depth component, 32bit. * @requires_es_extension %Extension @es_extension{OES,depth32} @@ -413,7 +412,6 @@ enum class RenderbufferFormat: GLenum { #else DepthComponent32 = GL_DEPTH_COMPONENT32_OES, #endif - #endif #ifndef MAGNUM_TARGET_GLES2 /** @@ -435,7 +433,6 @@ enum class RenderbufferFormat: GLenum { StencilIndex = GL_STENCIL_INDEX, #endif - #ifndef MAGNUM_TARGET_GLES3 /** * 1-bit stencil index. * @requires_es_extension %Extension @es_extension{OES,stencil1} @@ -455,7 +452,6 @@ enum class RenderbufferFormat: GLenum { #else StencilIndex4 = GL_STENCIL_INDEX4_OES, #endif - #endif /** 8-bit stencil index. */ StencilIndex8 = GL_STENCIL_INDEX8, diff --git a/src/Renderer.cpp b/src/Renderer.cpp index 88eb14fbd..9addf07b6 100644 --- a/src/Renderer.cpp +++ b/src/Renderer.cpp @@ -38,9 +38,7 @@ Renderer::ClearDepthfImplementation Renderer::clearDepthfImplementation = &Rende #else Renderer::ClearDepthfImplementation Renderer::clearDepthfImplementation = &Renderer::clearDepthfImplementationES; #endif -#ifndef MAGNUM_TARGET_GLES3 Renderer::GraphicsResetStatusImplementation Renderer::graphicsResetStatusImplementation = &Renderer::graphicsResetStatusImplementationDefault; -#endif void Renderer::setFeature(const Feature feature, const bool enabled) { enabled ? glEnable(GLenum(feature)) : glDisable(GLenum(feature)); @@ -162,7 +160,6 @@ void Renderer::setLogicOperation(const LogicOperation operation) { } #endif -#ifndef MAGNUM_TARGET_GLES3 Renderer::ResetNotificationStrategy Renderer::resetNotificationStrategy() { ResetNotificationStrategy& strategy = Context::current()->state().renderer->resetNotificationStrategy; @@ -176,7 +173,6 @@ Renderer::ResetNotificationStrategy Renderer::resetNotificationStrategy() { return strategy; } -#endif void Renderer::initializeContextBasedFunctionality(Context& context) { #ifndef MAGNUM_TARGET_GLES @@ -187,7 +183,6 @@ void Renderer::initializeContextBasedFunctionality(Context& context) { } #endif - #ifndef MAGNUM_TARGET_GLES3 #ifndef MAGNUM_TARGET_GLES if(context.isExtensionSupported()) #else @@ -202,9 +197,6 @@ void Renderer::initializeContextBasedFunctionality(Context& context) { graphicsResetStatusImplementation = &Renderer::graphicsResetStatusImplementationRobustness; } - #else - static_cast(context); - #endif /* Set some "corporate identity" */ setClearColor(Color3(0.125f)); @@ -220,7 +212,6 @@ void Renderer::clearDepthfImplementationES(const GLfloat depth) { glClearDepthf(depth); } -#ifndef MAGNUM_TARGET_GLES3 Renderer::GraphicsResetStatus Renderer::graphicsResetStatusImplementationDefault() { return GraphicsResetStatus::NoError; } @@ -234,7 +225,6 @@ Renderer::GraphicsResetStatus Renderer::graphicsResetStatusImplementationRobustn CORRADE_INTERNAL_ASSERT(false); #endif } -#endif #ifndef DOXYGEN_GENERATING_OUTPUT Debug operator<<(Debug debug, const Renderer::Error value) { @@ -246,17 +236,14 @@ Debug operator<<(Debug debug, const Renderer::Error value) { _c(InvalidOperation) _c(InvalidFramebufferOperation) _c(OutOfMemory) - #ifndef MAGNUM_TARGET_GLES3 _c(StackUnderflow) _c(StackOverflow) - #endif #undef _c } return debug << "Renderer::Error::(invalid)"; } -#ifndef MAGNUM_TARGET_GLES3 Debug operator<<(Debug debug, const Renderer::ResetNotificationStrategy value) { switch(value) { #define _c(value) case Renderer::ResetNotificationStrategy::value: return debug << "Renderer::ResetNotificationStrategy::" #value; @@ -281,6 +268,5 @@ Debug operator<<(Debug debug, const Renderer::GraphicsResetStatus value) { return debug << "Renderer::ResetNotificationStrategy::(invalid)"; } #endif -#endif } diff --git a/src/Renderer.h b/src/Renderer.h index 5c772e4e9..394fd2300 100644 --- a/src/Renderer.h +++ b/src/Renderer.h @@ -895,13 +895,12 @@ class MAGNUM_EXPORT Renderer { /** There is not enough memory left to execute the command. */ OutOfMemory = GL_OUT_OF_MEMORY, - #ifndef MAGNUM_TARGET_GLES3 /** * Given operation would cause an internal stack to underflow. * @requires_gl43 %Extension @extension{KHR,debug} * @requires_es_extension %Extension @es_extension2{KHR,debug,debug} */ - #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_GLES StackUnderflow = GL_STACK_UNDERFLOW, #else StackUnderflow = GL_STACK_UNDERFLOW_KHR, @@ -912,12 +911,11 @@ class MAGNUM_EXPORT Renderer { * @requires_gl43 %Extension @extension{KHR,debug} * @requires_es_extension %Extension @es_extension2{KHR,debug,debug} */ - #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_GLES StackOverflow = GL_STACK_OVERFLOW #else StackOverflow = GL_STACK_OVERFLOW_KHR #endif - #endif }; /** @@ -930,7 +928,6 @@ class MAGNUM_EXPORT Renderer { */ static Error error() { return static_cast(glGetError()); } - #ifndef MAGNUM_TARGET_GLES3 /** * @brief Graphics reset notification strategy * @@ -1016,7 +1013,6 @@ class MAGNUM_EXPORT Renderer { static GraphicsResetStatus graphicsResetStatus() { return graphicsResetStatusImplementation(); } - #endif /*@}*/ @@ -1030,24 +1026,20 @@ class MAGNUM_EXPORT Renderer { static void MAGNUM_LOCAL clearDepthfImplementationES(GLfloat depth); static ClearDepthfImplementation clearDepthfImplementation; - #ifndef MAGNUM_TARGET_GLES3 typedef GraphicsResetStatus(*GraphicsResetStatusImplementation)(); static GraphicsResetStatus MAGNUM_LOCAL graphicsResetStatusImplementationDefault(); static GraphicsResetStatus MAGNUM_LOCAL graphicsResetStatusImplementationRobustness(); static GraphicsResetStatusImplementation graphicsResetStatusImplementation; - #endif }; /** @debugoperator{Renderer} */ Debug MAGNUM_EXPORT operator<<(Debug debug, Renderer::Error value); -#ifndef MAGNUM_TARGET_GLES3 /** @debugoperator{Renderer} */ Debug MAGNUM_EXPORT operator<<(Debug debug, Renderer::ResetNotificationStrategy value); /** @debugoperator{Renderer} */ Debug MAGNUM_EXPORT operator<<(Debug debug, Renderer::GraphicsResetStatus value); -#endif } diff --git a/src/Sampler.cpp b/src/Sampler.cpp index 4aa722741..15bfd75d0 100644 --- a/src/Sampler.cpp +++ b/src/Sampler.cpp @@ -45,7 +45,6 @@ static_assert((filter_or(Nearest, Base) == GL_NEAREST) && "Unsupported constants for GL texture filtering"); #undef filter_or -#ifndef MAGNUM_TARGET_GLES3 Float Sampler::maxAnisotropy() { GLfloat& value = Context::current()->state().texture->maxAnisotropy; @@ -58,7 +57,6 @@ Float Sampler::maxAnisotropy() { return value; } -#endif #ifndef DOXYGEN_GENERATING_OUTPUT Debug operator<<(Debug debug, const Sampler::Filter value) { @@ -90,9 +88,7 @@ Debug operator<<(Debug debug, const Sampler::Wrapping value) { _c(Repeat) _c(MirroredRepeat) _c(ClampToEdge) - #ifndef MAGNUM_TARGET_GLES3 _c(ClampToBorder) - #endif #ifndef MAGNUM_TARGET_GLES _c(MirrorClampToEdge) #endif diff --git a/src/Sampler.h b/src/Sampler.h index a19249ab8..43d507720 100644 --- a/src/Sampler.h +++ b/src/Sampler.h @@ -107,7 +107,6 @@ class MAGNUM_EXPORT Sampler { */ ClampToEdge = GL_CLAMP_TO_EDGE, - #ifndef MAGNUM_TARGET_GLES3 /** * Clamp to border color. Coordinates out of range will be clamped * to border color (set with setBorderColor()). @@ -118,7 +117,6 @@ class MAGNUM_EXPORT Sampler { #else ClampToBorder = GL_CLAMP_TO_BORDER_NV, #endif - #endif #ifndef MAGNUM_TARGET_GLES /** @@ -134,7 +132,6 @@ class MAGNUM_EXPORT Sampler { #endif }; - #ifndef MAGNUM_TARGET_GLES3 /** * @brief Max supported anisotropy * @@ -154,7 +151,6 @@ class MAGNUM_EXPORT Sampler { */ static Float maxSupportedAnisotropy() { return maxAnisotropy(); } #endif - #endif }; /** @debugoperator{Magnum::Sampler} */ diff --git a/src/Test/BufferGLTest.cpp b/src/Test/BufferGLTest.cpp index 9c066b604..48029b5a8 100644 --- a/src/Test/BufferGLTest.cpp +++ b/src/Test/BufferGLTest.cpp @@ -143,7 +143,6 @@ void BufferGLTest::data() { #endif } -#ifndef MAGNUM_TARGET_GLES3 void BufferGLTest::map() { #ifdef MAGNUM_TARGET_GLES2 if(!Context::current()->isExtensionSupported()) @@ -177,7 +176,6 @@ void BufferGLTest::map() { CORRADE_COMPARE(changedContents[3], 107); #endif } -#endif #ifdef MAGNUM_TARGET_GLES2 void BufferGLTest::mapSub() { diff --git a/src/Test/RendererTest.cpp b/src/Test/RendererTest.cpp index 07a386634..7e784dc11 100644 --- a/src/Test/RendererTest.cpp +++ b/src/Test/RendererTest.cpp @@ -34,10 +34,8 @@ class RendererTest: public TestSuite::Tester { explicit RendererTest(); void debugError(); - #ifndef MAGNUM_TARGET_GLES3 void debugResetNotificationStrategy(); void debugGraphicsResetStatus(); - #endif }; RendererTest::RendererTest() { @@ -51,7 +49,6 @@ void RendererTest::debugError() { CORRADE_COMPARE(out.str(), "Renderer::Error::InvalidOperation\n"); } -#ifndef MAGNUM_TARGET_GLES3 void RendererTest::debugResetNotificationStrategy() { std::ostringstream out; @@ -65,7 +62,6 @@ void RendererTest::debugGraphicsResetStatus() { Debug(&out) << Renderer::GraphicsResetStatus::GuiltyContextReset; CORRADE_COMPARE(out.str(), "Renderer::GraphicsResetStatus::GuiltyContextReset\n"); } -#endif }} diff --git a/src/Texture.h b/src/Texture.h index b189c4d47..ed47fede3 100644 --- a/src/Texture.h +++ b/src/Texture.h @@ -428,7 +428,6 @@ template class Texture: public AbstractTexture { AbstractTexture::setMagnificationFilter(filter); return *this; } - #ifndef MAGNUM_TARGET_GLES3 Texture& setBorderColor(const Color4& color) { AbstractTexture::setBorderColor(color); return *this; @@ -437,7 +436,6 @@ template class Texture: public AbstractTexture { AbstractTexture::setMaxAnisotropy(anisotropy); return *this; } - #endif Texture& generateMipmap() { AbstractTexture::generateMipmap(); return *this; diff --git a/src/TextureFormat.h b/src/TextureFormat.h index c5be28182..57e16f9b8 100644 --- a/src/TextureFormat.h +++ b/src/TextureFormat.h @@ -521,7 +521,6 @@ enum class TextureFormat: GLenum { */ RGB565 = GL_RGB565, - #ifndef MAGNUM_TARGET_GLES3 /** * RGB, each component normalized unsigned 10bit. * @requires_es_extension %Extension @es_extension{OES,required_internalformat} @@ -532,7 +531,6 @@ enum class TextureFormat: GLenum { #else RGB10 = GL_RGB10_EXT, #endif - #endif #ifndef MAGNUM_TARGET_GLES /** @@ -560,22 +558,18 @@ enum class TextureFormat: GLenum { RGB9E5 = GL_RGB9_E5, #endif - #ifndef MAGNUM_TARGET_GLES3 /** * sRGB, normalized unsigned, size implementation-dependent. * @todo is this allowed in core? * @deprecated_gl Prefer to use the exactly specified version of this * format, i.e. @ref Magnum::TextureFormat "TextureFormat::SRGB8". - * @requires_es_extension %Extension @es_extension{EXT,sRGB} in OpenGL ES - * 2.0, use @ref Magnum::TextureFormat "TextureFormat::SRGB8" in - * OpenGL ES 3.0 instead. + * @requires_es_extension %Extension @es_extension{EXT,sRGB} */ #ifndef MAGNUM_TARGET_GLES SRGB = GL_SRGB, #else SRGB = GL_SRGB_EXT, #endif - #endif #ifndef MAGNUM_TARGET_GLES2 /** @@ -635,22 +629,18 @@ enum class TextureFormat: GLenum { RGBA12 = GL_RGBA12, #endif - #ifndef MAGNUM_TARGET_GLES3 /** * sRGBA, normalized unsigned, size implementation-dependent. * @todo is this allowed in core? * @deprecated_gl Prefer to use the exactly specified version of this * format, i.e. @ref Magnum::TextureFormat "TextureFormat::SRGB8Alpha8". - * @requires_es_extension %Extension @es_extension{EXT,sRGB} in OpenGL ES - * 2.0, use @ref Magnum::TextureFormat "TextureFormat::SRGB8Alpha8" in - * OpenGL ES 3.0 instead. + * @requires_es_extension %Extension @es_extension{EXT,sRGB} */ #ifndef MAGNUM_TARGET_GLES SRGBAlpha = GL_SRGB_ALPHA, #else SRGBAlpha = GL_SRGB_ALPHA_EXT, #endif - #endif #ifndef MAGNUM_TARGET_GLES2 /** @@ -777,19 +767,17 @@ enum class TextureFormat: GLenum { DepthComponent24 = GL_DEPTH_COMPONENT24_OES, #endif - #ifndef MAGNUM_TARGET_GLES3 /** * Depth component, 32bit. * @requires_es_extension %Extension (@es_extension{OES,required_internalformat}, * @es_extension{OES,depth_texture} and @es_extension{OES,depth32}) or * (@es_extension{EXT,texture_storage} and @es_extension{ANGLE,depth_texture}) */ - #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_GLES DepthComponent32 = GL_DEPTH_COMPONENT32, #else DepthComponent32 = GL_DEPTH_COMPONENT32_OES, #endif - #endif #ifndef MAGNUM_TARGET_GLES2 /**