Browse Source

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.
pull/34/head
Vladimír Vondruš 13 years ago
parent
commit
db5618c325
  1. 6
      src/AbstractFramebuffer.cpp
  2. 2
      src/AbstractFramebuffer.h
  3. 8
      src/AbstractImage.cpp
  4. 14
      src/AbstractTexture.cpp
  5. 2
      src/AbstractTexture.h
  6. 4
      src/Buffer.cpp
  7. 10
      src/Buffer.h
  8. 8
      src/ColorFormat.cpp
  9. 8
      src/ColorFormat.h
  10. 2
      src/Context.h
  11. 2
      src/CubeMapTexture.h
  12. 2
      src/CubeMapTextureArray.h
  13. 8
      src/Implementation/RendererState.h
  14. 2
      src/OpenGL.h
  15. 2
      src/Platform/magnum-info.cpp
  16. 8
      src/Query.cpp
  17. 4
      src/Query.h
  18. 4
      src/RenderbufferFormat.h
  19. 14
      src/Renderer.cpp
  20. 12
      src/Renderer.h
  21. 4
      src/Sampler.cpp
  22. 4
      src/Sampler.h
  23. 2
      src/Test/BufferGLTest.cpp
  24. 4
      src/Test/RendererTest.cpp
  25. 2
      src/Texture.h
  26. 18
      src/TextureFormat.h

6
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<Extensions::GL::ARB::robustness>())
#else
@ -295,9 +294,6 @@ void AbstractFramebuffer::initializeContextBasedFunctionality(Context& context)
readImplementation = &AbstractFramebuffer::readImplementationRobustness;
#endif
}
#else
static_cast<void>(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<void>(data);
#endif
}
#endif
}

2
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;
};

8
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();
}

14
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

2
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

4
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 */

10
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);

8
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)

8
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
/**

2
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
/**

2
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;

2
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;

8
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
};
}}

2
src/OpenGL.h

@ -56,8 +56,8 @@
#else
#include <OpenGL/GLES2/gl2platform.h>
#include <OpenGL/GLES2/gl2.h>
#include <OpenGL/GLES2/gl2ext.h>
#endif
#include <OpenGL/GLES2/gl2ext.h>
#endif
#endif

2
src/Platform/magnum-info.cpp

@ -344,13 +344,11 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
}
#endif
#ifndef MAGNUM_TARGET_GLES3
if(c->isExtensionSupported<Extensions::GL::EXT::texture_filter_anisotropic>()) {
_h(EXT::texture_filter_anisotropic)
_l(Sampler::maxAnisotropy())
}
#endif
#undef _l
#undef _h

8
src/Query.cpp

@ -91,13 +91,12 @@ template<> UnsignedInt AbstractQuery::result<UnsignedInt>() {
return result;
}
#ifndef MAGNUM_TARGET_GLES3
template<> Int AbstractQuery::result<Int>() {
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<UnsignedLong>() {
/** @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<Long>() {
/** @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<Long>() {
return result;
}
#endif
#endif
void AbstractQuery::begin(GLenum target) {
CORRADE_ASSERT(!this->target, "AbstractQuery::begin(): the query is already running", );

4
src/Query.h

@ -110,12 +110,10 @@ class MAGNUM_EXPORT AbstractQuery {
#ifndef DOXYGEN_GENERATING_OUTPUT
template<> bool MAGNUM_EXPORT AbstractQuery::result<bool>();
template<> UnsignedInt MAGNUM_EXPORT AbstractQuery::result<UnsignedInt>();
#ifndef MAGNUM_TARGET_GLES3
template<> Int MAGNUM_EXPORT AbstractQuery::result<Int>();
template<> UnsignedLong MAGNUM_EXPORT AbstractQuery::result<UnsignedLong>();
template<> Long MAGNUM_EXPORT AbstractQuery::result<Long>();
#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
}

4
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,

14
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<Extensions::GL::ARB::robustness>())
#else
@ -202,9 +197,6 @@ void Renderer::initializeContextBasedFunctionality(Context& context) {
graphicsResetStatusImplementation = &Renderer::graphicsResetStatusImplementationRobustness;
}
#else
static_cast<void>(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
}

12
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<Error>(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
}

4
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

4
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} */

2
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<Extensions::GL::OES::mapbuffer>())
@ -177,7 +176,6 @@ void BufferGLTest::map() {
CORRADE_COMPARE(changedContents[3], 107);
#endif
}
#endif
#ifdef MAGNUM_TARGET_GLES2
void BufferGLTest::mapSub() {

4
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
}}

2
src/Texture.h

@ -428,7 +428,6 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
AbstractTexture::setMagnificationFilter(filter);
return *this;
}
#ifndef MAGNUM_TARGET_GLES3
Texture<Dimensions>& setBorderColor(const Color4& color) {
AbstractTexture::setBorderColor(color);
return *this;
@ -437,7 +436,6 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
AbstractTexture::setMaxAnisotropy(anisotropy);
return *this;
}
#endif
Texture<Dimensions>& generateMipmap() {
AbstractTexture::generateMipmap();
return *this;

18
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
/**

Loading…
Cancel
Save