Browse Source

Context::current() now returns reference instead of pointer.

103% of use cases use the returned value directly without checking, so
we might as well do the check ourselves. Added new function hasCurrent()
and added deprecated backward-compatibility conversion and -> operators.

Wow, that creeped to a lot of places.

Last dinosaur from the pointer age.
pull/132/head
Vladimír Vondruš 10 years ago
parent
commit
d1714bfd1e
  1. 36
      src/Magnum/AbstractFramebuffer.cpp
  2. 4
      src/Magnum/AbstractObject.cpp
  3. 10
      src/Magnum/AbstractQuery.cpp
  4. 140
      src/Magnum/AbstractShaderProgram.cpp
  5. 170
      src/Magnum/AbstractTexture.cpp
  6. 2
      src/Magnum/Audio/Context.h
  7. 74
      src/Magnum/Buffer.cpp
  8. 16
      src/Magnum/BufferTexture.cpp
  9. 7
      src/Magnum/Context.cpp
  10. 33
      src/Magnum/Context.h
  11. 38
      src/Magnum/CubeMapTexture.cpp
  12. 4
      src/Magnum/CubeMapTextureArray.cpp
  13. 28
      src/Magnum/DebugOutput.cpp
  14. 14
      src/Magnum/DefaultFramebuffer.cpp
  15. 66
      src/Magnum/Framebuffer.cpp
  16. 4
      src/Magnum/Implementation/driverSpecific.cpp
  17. 8
      src/Magnum/Implementation/maxTextureSize.cpp
  18. 36
      src/Magnum/Mesh.cpp
  19. 2
      src/Magnum/MeshTools/FullScreenTriangle.cpp
  20. 4
      src/Magnum/MeshView.cpp
  21. 8
      src/Magnum/MultisampleTexture.cpp
  22. 10
      src/Magnum/PixelStorage.cpp
  23. 66
      src/Magnum/Platform/magnum-info.cpp
  24. 4
      src/Magnum/RectangleTexture.cpp
  25. 20
      src/Magnum/Renderbuffer.cpp
  26. 10
      src/Magnum/Renderer.cpp
  27. 4
      src/Magnum/Sampler.cpp
  28. 142
      src/Magnum/Shader.cpp
  29. 12
      src/Magnum/Shaders/DistanceFieldVector.cpp
  30. 12
      src/Magnum/Shaders/Flat.cpp
  31. 6
      src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h
  32. 16
      src/Magnum/Shaders/MeshVisualizer.cpp
  33. 12
      src/Magnum/Shaders/Phong.cpp
  34. 6
      src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp
  35. 12
      src/Magnum/Shaders/Vector.cpp
  36. 10
      src/Magnum/Shaders/VertexColor.cpp
  37. 2
      src/Magnum/Test/AbstractObjectGLTest.cpp
  38. 2
      src/Magnum/Test/AbstractOpenGLTester.h
  39. 12
      src/Magnum/Test/AbstractQueryGLTest.cpp
  40. 4
      src/Magnum/Test/AbstractShaderProgramGLTest.cpp
  41. 4
      src/Magnum/Test/AbstractTextureGLTest.cpp
  42. 20
      src/Magnum/Test/BufferGLTest.cpp
  43. 22
      src/Magnum/Test/BufferTextureGLTest.cpp
  44. 36
      src/Magnum/Test/ContextGLTest.cpp
  45. 130
      src/Magnum/Test/CubeMapTextureArrayGLTest.cpp
  46. 92
      src/Magnum/Test/CubeMapTextureGLTest.cpp
  47. 28
      src/Magnum/Test/DebugOutputGLTest.cpp
  48. 154
      src/Magnum/Test/FramebufferGLTest.cpp
  49. 120
      src/Magnum/Test/MeshGLTest.cpp
  50. 48
      src/Magnum/Test/MultisampleTextureGLTest.cpp
  51. 12
      src/Magnum/Test/PixelStorageGLTest.cpp
  52. 6
      src/Magnum/Test/PrimitiveQueryGLTest.cpp
  53. 46
      src/Magnum/Test/RectangleTextureGLTest.cpp
  54. 20
      src/Magnum/Test/RenderbufferGLTest.cpp
  55. 6
      src/Magnum/Test/SampleQueryGLTest.cpp
  56. 4
      src/Magnum/Test/ShaderGLTest.cpp
  57. 162
      src/Magnum/Test/TextureArrayGLTest.cpp
  58. 154
      src/Magnum/Test/TextureGLTest.cpp
  59. 10
      src/Magnum/Test/TimeQueryGLTest.cpp
  60. 22
      src/Magnum/Test/TransformFeedbackGLTest.cpp
  61. 8
      src/Magnum/Text/DistanceFieldGlyphCache.cpp
  62. 4
      src/Magnum/Text/GlyphCache.cpp
  63. 4
      src/Magnum/Text/Renderer.cpp
  64. 8
      src/Magnum/Text/Test/RendererGLTest.cpp
  65. 2
      src/Magnum/Texture.cpp
  66. 2
      src/Magnum/TextureArray.cpp
  67. 24
      src/Magnum/TextureTools/DistanceField.cpp
  68. 34
      src/Magnum/TransformFeedback.cpp
  69. 2
      src/MagnumPlugins/TgaImporter/TgaImporter.cpp

36
src/Magnum/AbstractFramebuffer.cpp

@ -38,7 +38,7 @@
namespace Magnum {
Vector2i AbstractFramebuffer::maxViewportSize() {
Vector2i& value = Context::current()->state().framebuffer->maxViewportSize;
Vector2i& value = Context::current().state().framebuffer->maxViewportSize;
/* Get the value, if not already cached */
if(value == Vector2i())
@ -50,16 +50,16 @@ Vector2i AbstractFramebuffer::maxViewportSize() {
Int AbstractFramebuffer::maxDrawBuffers() {
#ifdef MAGNUM_TARGET_GLES2
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::draw_buffers>() &&
!Context::current()->isExtensionSupported<Extensions::GL::NV::draw_buffers>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::draw_buffers>() &&
!Context::current().isExtensionSupported<Extensions::GL::NV::draw_buffers>())
return 0;
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::WEBGL::draw_buffers>())
if(!Context::current().isExtensionSupported<Extensions::GL::WEBGL::draw_buffers>())
return 0;
#endif
#endif
GLint& value = Context::current()->state().framebuffer->maxDrawBuffers;
GLint& value = Context::current().state().framebuffer->maxDrawBuffers;
/* Get the value, if not already cached */
if(value == 0) {
@ -75,10 +75,10 @@ Int AbstractFramebuffer::maxDrawBuffers() {
#ifndef MAGNUM_TARGET_GLES
Int AbstractFramebuffer::maxDualSourceDrawBuffers() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::blend_func_extended>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::blend_func_extended>())
return 0;
GLint& value = Context::current()->state().framebuffer->maxDualSourceDrawBuffers;
GLint& value = Context::current().state().framebuffer->maxDualSourceDrawBuffers;
/* Get the value, if not already cached */
if(value == 0)
@ -106,7 +106,7 @@ void AbstractFramebuffer::bind() {
void AbstractFramebuffer::bindInternal(FramebufferTarget target) {
#if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
(this->*Context::current()->state().framebuffer->bindImplementation)(target);
(this->*Context::current().state().framebuffer->bindImplementation)(target);
#else
bindImplementationDefault(target);
#endif
@ -114,7 +114,7 @@ void AbstractFramebuffer::bindInternal(FramebufferTarget target) {
#ifdef MAGNUM_TARGET_GLES2
void AbstractFramebuffer::bindImplementationSingle(FramebufferTarget) {
Implementation::FramebufferState& state = *Context::current()->state().framebuffer;
Implementation::FramebufferState& state = *Context::current().state().framebuffer;
CORRADE_INTERNAL_ASSERT(state.readBinding == state.drawBinding);
if(state.readBinding == _id) return;
@ -130,7 +130,7 @@ void AbstractFramebuffer::bindImplementationSingle(FramebufferTarget) {
inline
#endif
void AbstractFramebuffer::bindImplementationDefault(FramebufferTarget target) {
Implementation::FramebufferState& state = *Context::current()->state().framebuffer;
Implementation::FramebufferState& state = *Context::current().state().framebuffer;
if(target == FramebufferTarget::Read) {
if(state.readBinding == _id) return;
@ -147,7 +147,7 @@ void AbstractFramebuffer::bindImplementationDefault(FramebufferTarget target) {
FramebufferTarget AbstractFramebuffer::bindInternal() {
#if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
return (this->*Context::current()->state().framebuffer->bindInternalImplementation)();
return (this->*Context::current().state().framebuffer->bindInternalImplementation)();
#else
return bindImplementationDefault();
#endif
@ -155,7 +155,7 @@ FramebufferTarget AbstractFramebuffer::bindInternal() {
#ifdef MAGNUM_TARGET_GLES2
FramebufferTarget AbstractFramebuffer::bindImplementationSingle() {
Implementation::FramebufferState& state = *Context::current()->state().framebuffer;
Implementation::FramebufferState& state = *Context::current().state().framebuffer;
CORRADE_INTERNAL_ASSERT(state.readBinding == state.drawBinding);
/* Bind the framebuffer, if not already */
@ -175,7 +175,7 @@ FramebufferTarget AbstractFramebuffer::bindImplementationSingle() {
inline
#endif
FramebufferTarget AbstractFramebuffer::bindImplementationDefault() {
Implementation::FramebufferState& state = *Context::current()->state().framebuffer;
Implementation::FramebufferState& state = *Context::current().state().framebuffer;
/* Return target to which the framebuffer is already bound */
if(state.readBinding == _id)
@ -194,7 +194,7 @@ FramebufferTarget AbstractFramebuffer::bindImplementationDefault() {
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
void AbstractFramebuffer::blit(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Range2Di& sourceRectangle, const Range2Di& destinationRectangle, const FramebufferBlitMask mask, const FramebufferBlitFilter filter) {
Context::current()->state().framebuffer->blitImplementation(source, destination, sourceRectangle, destinationRectangle, mask, filter);
Context::current().state().framebuffer->blitImplementation(source, destination, sourceRectangle, destinationRectangle, mask, filter);
}
#endif
@ -250,14 +250,14 @@ AbstractFramebuffer& AbstractFramebuffer::setViewport(const Range2Di& rectangle)
_viewport = rectangle;
/* Update the viewport if the framebuffer is currently bound */
if(Context::current()->state().framebuffer->drawBinding == _id)
if(Context::current().state().framebuffer->drawBinding == _id)
setViewportInternal();
return *this;
}
void AbstractFramebuffer::setViewportInternal() {
Implementation::FramebufferState& state = *Context::current()->state().framebuffer;
Implementation::FramebufferState& state = *Context::current().state().framebuffer;
CORRADE_INTERNAL_ASSERT(_viewport != Implementation::FramebufferState::DisengagedViewport);
CORRADE_INTERNAL_ASSERT(state.drawBinding == _id);
@ -291,7 +291,7 @@ void AbstractFramebuffer::read(const Range2Di& rectangle, Image2D& image) {
Buffer::unbindInternal(Buffer::TargetHint::PixelPack);
#endif
image.storage().applyPack();
(Context::current()->state().framebuffer->readImplementation)(rectangle, image.format(), image.type(), data.size(), data
(Context::current().state().framebuffer->readImplementation)(rectangle, image.format(), image.type(), data.size(), data
#ifdef MAGNUM_TARGET_GLES2
+ Implementation::pixelStorageSkipOffsetFor(image, rectangle.size())
#endif
@ -317,7 +317,7 @@ void AbstractFramebuffer::read(const Range2Di& rectangle, BufferImage2D& image,
image.buffer().bindInternal(Buffer::TargetHint::PixelPack);
image.storage().applyPack();
(Context::current()->state().framebuffer->readImplementation)(rectangle, image.format(), image.type(), dataSize, nullptr);
(Context::current().state().framebuffer->readImplementation)(rectangle, image.format(), image.type(), dataSize, nullptr);
}
BufferImage2D AbstractFramebuffer::read(const Range2Di& rectangle, BufferImage2D&& image, BufferUsage usage) {

4
src/Magnum/AbstractObject.cpp

@ -113,10 +113,10 @@ namespace {
#endif
Int AbstractObject::maxLabelLength() {
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>())
return 0;
GLint& value = Context::current()->state().debug->maxLabelLength;
GLint& value = Context::current().state().debug->maxLabelLength;
if(value == 0) {
#ifndef MAGNUM_TARGET_GLES

10
src/Magnum/AbstractQuery.cpp

@ -37,7 +37,7 @@
namespace Magnum {
AbstractQuery::AbstractQuery(GLenum target): _target{target}, _flags{ObjectFlag::DeleteOnDestruction} {
(this->*Context::current()->state().query->createImplementation)();
(this->*Context::current().state().query->createImplementation)();
}
#ifdef MAGNUM_BUILD_DEPRECATED
@ -79,17 +79,17 @@ void AbstractQuery::createImplementationDSA() {
#ifndef MAGNUM_TARGET_WEBGL
std::string AbstractQuery::label() const {
#ifndef MAGNUM_TARGET_GLES
return Context::current()->state().debug->getLabelImplementation(GL_QUERY, _id);
return Context::current().state().debug->getLabelImplementation(GL_QUERY, _id);
#else
return Context::current()->state().debug->getLabelImplementation(GL_QUERY_KHR, _id);
return Context::current().state().debug->getLabelImplementation(GL_QUERY_KHR, _id);
#endif
}
AbstractQuery& AbstractQuery::setLabelInternal(const Containers::ArrayView<const char> label) {
#ifndef MAGNUM_TARGET_GLES
Context::current()->state().debug->labelImplementation(GL_QUERY, _id, label);
Context::current().state().debug->labelImplementation(GL_QUERY, _id, label);
#else
Context::current()->state().debug->labelImplementation(GL_QUERY_KHR, _id, label);
Context::current().state().debug->labelImplementation(GL_QUERY_KHR, _id, label);
#endif
return *this;
}

140
src/Magnum/AbstractShaderProgram.cpp

@ -50,7 +50,7 @@ namespace Implementation {
}
Int AbstractShaderProgram::maxVertexAttributes() {
GLint& value = Context::current()->state().shaderProgram->maxVertexAttributes;
GLint& value = Context::current().state().shaderProgram->maxVertexAttributes;
/* Get the value, if not already cached */
if(value == 0)
@ -62,13 +62,13 @@ Int AbstractShaderProgram::maxVertexAttributes() {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
Int AbstractShaderProgram::maxAtomicCounterBufferSize() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 0;
GLint& value = Context::current()->state().shaderProgram->maxAtomicCounterBufferSize;
GLint& value = Context::current().state().shaderProgram->maxAtomicCounterBufferSize;
if(value == 0)
glGetIntegerv(GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE, &value);
@ -78,13 +78,13 @@ Int AbstractShaderProgram::maxAtomicCounterBufferSize() {
Int AbstractShaderProgram::maxComputeSharedMemorySize() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::compute_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::compute_shader>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 0;
GLint& value = Context::current()->state().shaderProgram->maxComputeSharedMemorySize;
GLint& value = Context::current().state().shaderProgram->maxComputeSharedMemorySize;
if(value == 0)
glGetIntegerv(GL_MAX_COMPUTE_SHARED_MEMORY_SIZE, &value);
@ -94,13 +94,13 @@ Int AbstractShaderProgram::maxComputeSharedMemorySize() {
Int AbstractShaderProgram::maxComputeWorkGroupInvocations() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::compute_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::compute_shader>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 0;
GLint& value = Context::current()->state().shaderProgram->maxComputeWorkGroupInvocations;
GLint& value = Context::current().state().shaderProgram->maxComputeWorkGroupInvocations;
if(value == 0)
glGetIntegerv(GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS, &value);
@ -110,13 +110,13 @@ Int AbstractShaderProgram::maxComputeWorkGroupInvocations() {
Int AbstractShaderProgram::maxImageUnits() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_image_load_store>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::shader_image_load_store>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 0;
GLint& value = Context::current()->state().shaderProgram->maxImageUnits;
GLint& value = Context::current().state().shaderProgram->maxImageUnits;
if(value == 0)
glGetIntegerv(GL_MAX_IMAGE_UNITS, &value);
@ -127,10 +127,10 @@ Int AbstractShaderProgram::maxImageUnits() {
#ifndef MAGNUM_TARGET_GLES
Int AbstractShaderProgram::maxImageSamples() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_image_load_store>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::shader_image_load_store>())
return 0;
GLint& value = Context::current()->state().shaderProgram->maxImageSamples;
GLint& value = Context::current().state().shaderProgram->maxImageSamples;
if(value == 0)
glGetIntegerv(GL_MAX_IMAGE_SAMPLES, &value);
@ -143,13 +143,13 @@ Int AbstractShaderProgram::maxImageSamples() {
#ifndef MAGNUM_TARGET_WEBGL
Int AbstractShaderProgram::maxCombinedShaderOutputResources() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_storage_buffer_object>() || !Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_image_load_store>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::shader_storage_buffer_object>() || !Context::current().isExtensionSupported<Extensions::GL::ARB::shader_image_load_store>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 0;
GLint& value = Context::current()->state().shaderProgram->maxCombinedShaderOutputResources;
GLint& value = Context::current().state().shaderProgram->maxCombinedShaderOutputResources;
if(value == 0)
glGetIntegerv(GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES, &value);
@ -159,13 +159,13 @@ Int AbstractShaderProgram::maxCombinedShaderOutputResources() {
Long AbstractShaderProgram::maxShaderStorageBlockSize() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_storage_buffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::shader_storage_buffer_object>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 0;
GLint64& value = Context::current()->state().shaderProgram->maxShaderStorageBlockSize;
GLint64& value = Context::current().state().shaderProgram->maxShaderStorageBlockSize;
if(value == 0)
glGetInteger64v(GL_MAX_SHADER_STORAGE_BLOCK_SIZE, &value);
@ -176,11 +176,11 @@ Long AbstractShaderProgram::maxShaderStorageBlockSize() {
Int AbstractShaderProgram::maxUniformBlockSize() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>())
return 0;
#endif
GLint& value = Context::current()->state().shaderProgram->maxUniformBlockSize;
GLint& value = Context::current().state().shaderProgram->maxUniformBlockSize;
if(value == 0)
glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &value);
@ -191,13 +191,13 @@ Int AbstractShaderProgram::maxUniformBlockSize() {
#ifndef MAGNUM_TARGET_WEBGL
Int AbstractShaderProgram::maxUniformLocations() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 0;
GLint& value = Context::current()->state().shaderProgram->maxUniformLocations;
GLint& value = Context::current().state().shaderProgram->maxUniformLocations;
if(value == 0)
glGetIntegerv(GL_MAX_UNIFORM_LOCATIONS, &value);
@ -208,11 +208,11 @@ Int AbstractShaderProgram::maxUniformLocations() {
Int AbstractShaderProgram::minTexelOffset() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
return 0;
#endif
GLint& value = Context::current()->state().shaderProgram->minTexelOffset;
GLint& value = Context::current().state().shaderProgram->minTexelOffset;
if(value == 0)
glGetIntegerv(GL_MIN_PROGRAM_TEXEL_OFFSET, &value);
@ -222,11 +222,11 @@ Int AbstractShaderProgram::minTexelOffset() {
Int AbstractShaderProgram::maxTexelOffset() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
return 0;
#endif
GLint& value = Context::current()->state().shaderProgram->maxTexelOffset;
GLint& value = Context::current().state().shaderProgram->maxTexelOffset;
if(value == 0)
glGetIntegerv(GL_MAX_PROGRAM_TEXEL_OFFSET, &value);
@ -245,7 +245,7 @@ AbstractShaderProgram::AbstractShaderProgram(AbstractShaderProgram&& other) noex
AbstractShaderProgram::~AbstractShaderProgram() {
/* Remove current usage from the state */
GLuint& current = Context::current()->state().shaderProgram->current;
GLuint& current = Context::current().state().shaderProgram->current;
if(current == _id) current = 0;
if(_id) glDeleteProgram(_id);
@ -260,17 +260,17 @@ AbstractShaderProgram& AbstractShaderProgram::operator=(AbstractShaderProgram&&
#ifndef MAGNUM_TARGET_WEBGL
std::string AbstractShaderProgram::label() const {
#ifndef MAGNUM_TARGET_GLES
return Context::current()->state().debug->getLabelImplementation(GL_PROGRAM, _id);
return Context::current().state().debug->getLabelImplementation(GL_PROGRAM, _id);
#else
return Context::current()->state().debug->getLabelImplementation(GL_PROGRAM_KHR, _id);
return Context::current().state().debug->getLabelImplementation(GL_PROGRAM_KHR, _id);
#endif
}
AbstractShaderProgram& AbstractShaderProgram::setLabelInternal(const Containers::ArrayView<const char> label) {
#ifndef MAGNUM_TARGET_GLES
Context::current()->state().debug->labelImplementation(GL_PROGRAM, _id, label);
Context::current().state().debug->labelImplementation(GL_PROGRAM, _id, label);
#else
Context::current()->state().debug->labelImplementation(GL_PROGRAM_KHR, _id, label);
Context::current().state().debug->labelImplementation(GL_PROGRAM_KHR, _id, label);
#endif
return *this;
}
@ -296,7 +296,7 @@ std::pair<bool, std::string> AbstractShaderProgram::validate() {
void AbstractShaderProgram::use() {
/* Use only if the program isn't already in use */
GLuint& current = Context::current()->state().shaderProgram->current;
GLuint& current = Context::current().state().shaderProgram->current;
if(current != _id) glUseProgram(current = _id);
}
@ -402,7 +402,7 @@ Int AbstractShaderProgram::uniformLocationInternal(const Containers::ArrayView<c
}
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Float> values) {
(this->*Context::current()->state().shaderProgram->uniform1fvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniform1fvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const GLfloat* const values) {
@ -430,7 +430,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::Vector<2, Float>> values) {
(this->*Context::current()->state().shaderProgram->uniform2fvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniform2fvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<2, GLfloat>* const values) {
@ -458,7 +458,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::Vector<3, Float>> values) {
(this->*Context::current()->state().shaderProgram->uniform3fvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniform3fvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<3, GLfloat>* const values) {
@ -486,7 +486,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::Vector<4, Float>> values) {
(this->*Context::current()->state().shaderProgram->uniform4fvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniform4fvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<4, GLfloat>* const values) {
@ -514,7 +514,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Int> values) {
(this->*Context::current()->state().shaderProgram->uniform1ivImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniform1ivImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const GLint* values) {
@ -542,7 +542,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::Vector<2, Int>> values) {
(this->*Context::current()->state().shaderProgram->uniform2ivImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniform2ivImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<2, GLint>* const values) {
@ -570,7 +570,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::Vector<3, Int>> values) {
(this->*Context::current()->state().shaderProgram->uniform3ivImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniform3ivImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<3, GLint>* const values) {
@ -598,7 +598,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::Vector<4, Int>> values) {
(this->*Context::current()->state().shaderProgram->uniform4ivImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniform4ivImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<4, GLint>* const values) {
@ -627,7 +627,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#ifndef MAGNUM_TARGET_GLES2
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const UnsignedInt> values) {
(this->*Context::current()->state().shaderProgram->uniform1uivImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniform1uivImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const GLuint* const values) {
@ -646,7 +646,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::Vector<2, UnsignedInt>> values) {
(this->*Context::current()->state().shaderProgram->uniform2uivImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniform2uivImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<2, GLuint>* const values) {
@ -665,7 +665,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::Vector<3, UnsignedInt>> values) {
(this->*Context::current()->state().shaderProgram->uniform3uivImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniform3uivImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<3, GLuint>* const values) {
@ -684,7 +684,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::Vector<4, UnsignedInt>> values) {
(this->*Context::current()->state().shaderProgram->uniform4uivImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniform4uivImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<4, GLuint>* const values) {
@ -705,7 +705,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#ifndef MAGNUM_TARGET_GLES
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Double> values) {
(this->*Context::current()->state().shaderProgram->uniform1dvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniform1dvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const GLdouble* const values) {
@ -722,7 +722,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co
}
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::Vector<2, Double>> values) {
(this->*Context::current()->state().shaderProgram->uniform2dvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniform2dvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<2, GLdouble>* const values) {
@ -739,7 +739,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co
}
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::Vector<3, Double>> values) {
(this->*Context::current()->state().shaderProgram->uniform3dvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniform3dvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<3, GLdouble>* const values) {
@ -756,7 +756,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co
}
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::Vector<4, Double>> values) {
(this->*Context::current()->state().shaderProgram->uniform4dvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniform4dvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::Vector<4, GLdouble>* const values) {
@ -774,7 +774,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<2, 2, Float>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix2fvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix2fvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 2, GLfloat>* const values) {
@ -802,7 +802,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<3, 3, Float>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix3fvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix3fvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 3, GLfloat>* const values) {
@ -830,7 +830,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<4, 4, Float>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix4fvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix4fvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 4, GLfloat>* const values) {
@ -859,7 +859,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#ifndef MAGNUM_TARGET_GLES2
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<2, 3, Float>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix2x3fvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix2x3fvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 3, GLfloat>* const values) {
@ -878,7 +878,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<3, 2, Float>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix3x2fvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix3x2fvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 2, GLfloat>* const values) {
@ -897,7 +897,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<2, 4, Float>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix2x4fvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix2x4fvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 4, GLfloat>* const values) {
@ -916,7 +916,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<4, 2, Float>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix4x2fvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix4x2fvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 2, GLfloat>* const values) {
@ -935,7 +935,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<3, 4, Float>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix3x4fvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix3x4fvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 4, GLfloat>* const values) {
@ -954,7 +954,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#endif
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<4, 3, Float>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix4x3fvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix4x3fvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 3, GLfloat>* const values) {
@ -975,7 +975,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat
#ifndef MAGNUM_TARGET_GLES
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<2, 2, Double>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix2dvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix2dvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 2, GLdouble>* const values) {
@ -992,7 +992,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co
}
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<3, 3, Double>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix3dvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix3dvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 3, GLdouble>* const values) {
@ -1009,7 +1009,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co
}
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<4, 4, Double>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix4dvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix4dvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 4, GLdouble>* const values) {
@ -1026,7 +1026,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co
}
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<2, 3, Double>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix2x3dvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix2x3dvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 3, GLdouble>* const values) {
@ -1043,7 +1043,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co
}
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<3, 2, Double>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix3x2dvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix3x2dvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 2, GLdouble>* const values) {
@ -1060,7 +1060,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co
}
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<2, 4, Double>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix2x4dvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix2x4dvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 4, GLdouble>* const values) {
@ -1077,7 +1077,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co
}
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<4, 2, Double>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix4x2dvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix4x2dvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 2, GLdouble>* const values) {
@ -1094,7 +1094,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co
}
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<3, 4, Double>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix3x4dvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix3x4dvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 4, GLdouble>* const values) {
@ -1111,7 +1111,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT(const GLint location, co
}
void AbstractShaderProgram::setUniform(const Int location, const Containers::ArrayView<const Math::RectangularMatrix<4, 3, Double>> values) {
(this->*Context::current()->state().shaderProgram->uniformMatrix4x3dvImplementation)(location, values.size(), values);
(this->*Context::current().state().shaderProgram->uniformMatrix4x3dvImplementation)(location, values.size(), values);
}
void AbstractShaderProgram::uniformImplementationDefault(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 3, GLdouble>* const values) {

170
src/Magnum/AbstractTexture.cpp

@ -49,7 +49,7 @@ namespace Magnum {
#ifndef MAGNUM_TARGET_GLES2
Float AbstractTexture::maxLodBias() {
GLfloat& value = Context::current()->state().texture->maxLodBias;
GLfloat& value = Context::current().state().texture->maxLodBias;
/* Get the value, if not already cached */
if(value == 0.0f)
@ -62,13 +62,13 @@ Float AbstractTexture::maxLodBias() {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
Int AbstractTexture::maxColorSamples() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 0;
GLint& value = Context::current()->state().texture->maxColorSamples;
GLint& value = Context::current().state().texture->maxColorSamples;
/* Get the value, if not already cached */
if(value == 0)
@ -79,13 +79,13 @@ Int AbstractTexture::maxColorSamples() {
Int AbstractTexture::maxDepthSamples() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 0;
GLint& value = Context::current()->state().texture->maxDepthSamples;
GLint& value = Context::current().state().texture->maxDepthSamples;
/* Get the value, if not already cached */
if(value == 0)
@ -96,13 +96,13 @@ Int AbstractTexture::maxDepthSamples() {
Int AbstractTexture::maxIntegerSamples() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 0;
GLint& value = Context::current()->state().texture->maxIntegerSamples;
GLint& value = Context::current().state().texture->maxIntegerSamples;
/* Get the value, if not already cached */
if(value == 0)
@ -113,18 +113,18 @@ Int AbstractTexture::maxIntegerSamples() {
#endif
void AbstractTexture::unbind(const Int textureUnit) {
Implementation::TextureState& textureState = *Context::current()->state().texture;
Implementation::TextureState& textureState = *Context::current().state().texture;
/* If given texture unit is already unbound, nothing to do */
if(textureState.bindings[textureUnit].second == 0) return;
/* Unbind the texture, reset state tracker */
Context::current()->state().texture->unbindImplementation(textureUnit);
Context::current().state().texture->unbindImplementation(textureUnit);
textureState.bindings[textureUnit] = {};
}
void AbstractTexture::unbindImplementationDefault(const GLint textureUnit) {
Implementation::TextureState& textureState = *Context::current()->state().texture;
Implementation::TextureState& textureState = *Context::current().state().texture;
/* Activate given texture unit if not already active, update state tracker */
if(textureState.currentTextureUnit != textureUnit)
@ -141,12 +141,12 @@ void AbstractTexture::unbindImplementationMulti(const GLint textureUnit) {
}
void AbstractTexture::unbindImplementationDSA(const GLint textureUnit) {
CORRADE_INTERNAL_ASSERT(Context::current()->state().texture->bindings[textureUnit].first != 0);
CORRADE_INTERNAL_ASSERT(Context::current().state().texture->bindings[textureUnit].first != 0);
glBindTextureUnit(textureUnit, 0);
}
void AbstractTexture::unbindImplementationDSAEXT(const GLint textureUnit) {
Implementation::TextureState& textureState = *Context::current()->state().texture;
Implementation::TextureState& textureState = *Context::current().state().texture;
CORRADE_INTERNAL_ASSERT(textureState.bindings[textureUnit].first != 0);
glBindMultiTextureEXT(GL_TEXTURE0 + textureUnit, textureState.bindings[textureUnit].first, 0);
@ -155,13 +155,13 @@ void AbstractTexture::unbindImplementationDSAEXT(const GLint textureUnit) {
void AbstractTexture::unbind(const Int firstTextureUnit, const std::size_t count) {
/* State tracker is updated in the implementations */
Context::current()->state().texture->bindMultiImplementation(firstTextureUnit, {nullptr, count});
Context::current().state().texture->bindMultiImplementation(firstTextureUnit, {nullptr, count});
}
/** @todoc const std::initializer_list makes Doxygen grumpy */
void AbstractTexture::bind(const Int firstTextureUnit, std::initializer_list<AbstractTexture*> textures) {
/* State tracker is updated in the implementations */
Context::current()->state().texture->bindMultiImplementation(firstTextureUnit, {textures.begin(), textures.size()});
Context::current().state().texture->bindMultiImplementation(firstTextureUnit, {textures.begin(), textures.size()});
}
void AbstractTexture::bindImplementationFallback(const GLint firstTextureUnit, const Containers::ArrayView<AbstractTexture* const> textures) {
@ -172,7 +172,7 @@ void AbstractTexture::bindImplementationFallback(const GLint firstTextureUnit, c
#ifndef MAGNUM_TARGET_GLES
/** @todoc const Containers::ArrayView makes Doxygen grumpy */
void AbstractTexture::bindImplementationMulti(const GLint firstTextureUnit, Containers::ArrayView<AbstractTexture* const> textures) {
Implementation::TextureState& textureState = *Context::current()->state().texture;
Implementation::TextureState& textureState = *Context::current().state().texture;
/* Create array of IDs and also update bindings in state tracker */
/** @todo VLAs */
@ -199,7 +199,7 @@ void AbstractTexture::bindImplementationMulti(const GLint firstTextureUnit, Cont
#ifndef MAGNUM_TARGET_GLES
Int AbstractTexture::compressedBlockDataSize(const GLenum target, const TextureFormat format) {
return (Context::current()->state().texture->compressedBlockDataSizeImplementation)(target, format);
return (Context::current().state().texture->compressedBlockDataSizeImplementation)(target, format);
}
Int AbstractTexture::compressedBlockDataSizeImplementationDefault(const GLenum target, const TextureFormat format) {
@ -215,7 +215,7 @@ Int AbstractTexture::compressedBlockDataSizeImplementationBitsWorkaround(const G
#endif
AbstractTexture::AbstractTexture(GLenum target): _target{target}, _flags{ObjectFlag::DeleteOnDestruction} {
(this->*Context::current()->state().texture->createImplementation)();
(this->*Context::current().state().texture->createImplementation)();
CORRADE_INTERNAL_ASSERT(_id != Implementation::State::DisengagedBinding);
}
@ -235,7 +235,7 @@ AbstractTexture::~AbstractTexture() {
if(!_id || !(_flags & ObjectFlag::DeleteOnDestruction)) return;
/* Remove all bindings */
for(auto& binding: Context::current()->state().texture->bindings)
for(auto& binding: Context::current().state().texture->bindings)
{
/* MSVC 2015 needs the parentheses around */
if(binding.second == _id) binding = {};
@ -259,18 +259,18 @@ void AbstractTexture::createIfNotAlready() {
#ifndef MAGNUM_TARGET_WEBGL
std::string AbstractTexture::label() {
createIfNotAlready();
return Context::current()->state().debug->getLabelImplementation(GL_TEXTURE, _id);
return Context::current().state().debug->getLabelImplementation(GL_TEXTURE, _id);
}
AbstractTexture& AbstractTexture::setLabelInternal(const Containers::ArrayView<const char> label) {
createIfNotAlready();
Context::current()->state().debug->labelImplementation(GL_TEXTURE, _id, label);
Context::current().state().debug->labelImplementation(GL_TEXTURE, _id, label);
return *this;
}
#endif
void AbstractTexture::bind(Int textureUnit) {
Implementation::TextureState& textureState = *Context::current()->state().texture;
Implementation::TextureState& textureState = *Context::current().state().texture;
/* If already bound in given texture unit, nothing to do */
if(textureState.bindings[textureUnit].second == _id) return;
@ -281,7 +281,7 @@ void AbstractTexture::bind(Int textureUnit) {
}
void AbstractTexture::bindImplementationDefault(GLint textureUnit) {
Implementation::TextureState& textureState = *Context::current()->state().texture;
Implementation::TextureState& textureState = *Context::current().state().texture;
/* Activate given texture unit if not already active, update state tracker */
if(textureState.currentTextureUnit != textureUnit)
@ -310,13 +310,13 @@ void AbstractTexture::bindImplementationDSAEXT(GLint textureUnit) {
#ifndef MAGNUM_TARGET_GLES2
void AbstractTexture::setBaseLevel(Int level) {
(this->*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_BASE_LEVEL, level);
(this->*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_BASE_LEVEL, level);
}
#endif
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
void AbstractTexture::setMaxLevel(Int level) {
(this->*Context::current()->state().texture->parameteriImplementation)(
(this->*Context::current().state().texture->parameteriImplementation)(
#ifndef MAGNUM_TARGET_GLES2
GL_TEXTURE_MAX_LEVEL
#else
@ -327,32 +327,32 @@ void AbstractTexture::setMaxLevel(Int level) {
#endif
void AbstractTexture::setMinificationFilter(Sampler::Filter filter, Sampler::Mipmap mipmap) {
(this->*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_MIN_FILTER, GLint(filter)|GLint(mipmap));
(this->*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_MIN_FILTER, GLint(filter)|GLint(mipmap));
}
void AbstractTexture::setMagnificationFilter(const Sampler::Filter filter) {
(this->*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_MAG_FILTER, GLint(filter));
(this->*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_MAG_FILTER, GLint(filter));
}
#ifndef MAGNUM_TARGET_GLES2
void AbstractTexture::setMinLod(const Float lod) {
(this->*Context::current()->state().texture->parameterfImplementation)(GL_TEXTURE_MIN_LOD, lod);
(this->*Context::current().state().texture->parameterfImplementation)(GL_TEXTURE_MIN_LOD, lod);
}
void AbstractTexture::setMaxLod(const Float lod) {
(this->*Context::current()->state().texture->parameterfImplementation)(GL_TEXTURE_MAX_LOD, lod);
(this->*Context::current().state().texture->parameterfImplementation)(GL_TEXTURE_MAX_LOD, lod);
}
#endif
#ifndef MAGNUM_TARGET_GLES
void AbstractTexture::setLodBias(const Float bias) {
(this->*Context::current()->state().texture->parameterfImplementation)(GL_TEXTURE_LOD_BIAS, bias);
(this->*Context::current().state().texture->parameterfImplementation)(GL_TEXTURE_LOD_BIAS, bias);
}
#endif
#ifndef MAGNUM_TARGET_WEBGL
void AbstractTexture::setBorderColor(const Color4& color) {
(this->*Context::current()->state().texture->parameterfvImplementation)(
(this->*Context::current().state().texture->parameterfvImplementation)(
#ifndef MAGNUM_TARGET_GLES
GL_TEXTURE_BORDER_COLOR,
#else
@ -363,7 +363,7 @@ void AbstractTexture::setBorderColor(const Color4& color) {
#ifndef MAGNUM_TARGET_GLES2
void AbstractTexture::setBorderColor(const Vector4ui& color) {
(this->*Context::current()->state().texture->parameterIuivImplementation)(
(this->*Context::current().state().texture->parameterIuivImplementation)(
#ifndef MAGNUM_TARGET_GLES
GL_TEXTURE_BORDER_COLOR,
#else
@ -373,7 +373,7 @@ void AbstractTexture::setBorderColor(const Vector4ui& color) {
}
void AbstractTexture::setBorderColor(const Vector4i& color) {
(this->*Context::current()->state().texture->parameterIivImplementation)(
(this->*Context::current().state().texture->parameterIivImplementation)(
#ifndef MAGNUM_TARGET_GLES
GL_TEXTURE_BORDER_COLOR,
#else
@ -385,12 +385,12 @@ void AbstractTexture::setBorderColor(const Vector4i& color) {
#endif
void AbstractTexture::setMaxAnisotropy(const Float anisotropy) {
(this->*Context::current()->state().texture->setMaxAnisotropyImplementation)(anisotropy);
(this->*Context::current().state().texture->setMaxAnisotropyImplementation)(anisotropy);
}
#ifndef MAGNUM_TARGET_WEBGL
void AbstractTexture::setSRGBDecode(bool decode) {
(this->*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_SRGB_DECODE_EXT,
(this->*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_SRGB_DECODE_EXT,
decode ? GL_DECODE_EXT : GL_SKIP_DECODE_EXT);
}
#endif
@ -399,19 +399,19 @@ void AbstractTexture::setSRGBDecode(bool decode) {
void AbstractTexture::setSwizzleInternal(const GLint r, const GLint g, const GLint b, const GLint a) {
#ifndef MAGNUM_TARGET_GLES
const GLint rgba[] = {r, g, b, a};
(this->*Context::current()->state().texture->parameterivImplementation)(GL_TEXTURE_SWIZZLE_RGBA, rgba);
(this->*Context::current().state().texture->parameterivImplementation)(GL_TEXTURE_SWIZZLE_RGBA, rgba);
#else
(this->*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_SWIZZLE_R, r);
(this->*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_SWIZZLE_G, g);
(this->*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_SWIZZLE_B, b);
(this->*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_SWIZZLE_A, a);
(this->*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_SWIZZLE_R, r);
(this->*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_SWIZZLE_G, g);
(this->*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_SWIZZLE_B, b);
(this->*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_SWIZZLE_A, a);
#endif
}
#endif
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
void AbstractTexture::setCompareMode(const Sampler::CompareMode mode) {
(this->*Context::current()->state().texture->parameteriImplementation)(
(this->*Context::current().state().texture->parameteriImplementation)(
#ifndef MAGNUM_TARGET_GLES2
GL_TEXTURE_COMPARE_MODE
#else
@ -421,7 +421,7 @@ void AbstractTexture::setCompareMode(const Sampler::CompareMode mode) {
}
void AbstractTexture::setCompareFunction(const Sampler::CompareFunction function) {
(this->*Context::current()->state().texture->parameteriImplementation)(
(this->*Context::current().state().texture->parameteriImplementation)(
#ifndef MAGNUM_TARGET_GLES2
GL_TEXTURE_COMPARE_FUNC
#else
@ -433,16 +433,16 @@ void AbstractTexture::setCompareFunction(const Sampler::CompareFunction function
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void AbstractTexture::setDepthStencilMode(const Sampler::DepthStencilMode mode) {
(this->*Context::current()->state().texture->parameteriImplementation)(GL_DEPTH_STENCIL_TEXTURE_MODE, GLenum(mode));
(this->*Context::current().state().texture->parameteriImplementation)(GL_DEPTH_STENCIL_TEXTURE_MODE, GLenum(mode));
}
#endif
void AbstractTexture::invalidateImage(const Int level) {
(this->*Context::current()->state().texture->invalidateImageImplementation)(level);
(this->*Context::current().state().texture->invalidateImageImplementation)(level);
}
void AbstractTexture::generateMipmap() {
(this->*Context::current()->state().texture->mipmapImplementation)();
(this->*Context::current().state().texture->mipmapImplementation)();
}
void AbstractTexture::mipmapImplementationDefault() {
@ -466,7 +466,7 @@ void AbstractTexture::bindInternal() {
functions need to have the texture bound in *currently active* unit,
so we would need to call glActiveTexture() afterwards anyway. */
Implementation::TextureState& textureState = *Context::current()->state().texture;
Implementation::TextureState& textureState = *Context::current().state().texture;
/* If the texture is already bound in current unit, nothing to do */
if(textureState.bindings[textureState.currentTextureUnit].second == _id)
@ -1107,7 +1107,7 @@ void AbstractTexture::parameterIImplementationDSAEXT(GLenum parameter, const GLi
void AbstractTexture::setMaxAnisotropyImplementationNoOp(GLfloat) {}
void AbstractTexture::setMaxAnisotropyImplementationExt(GLfloat anisotropy) {
(this->*Context::current()->state().texture->parameterfImplementation)(GL_TEXTURE_MAX_ANISOTROPY_EXT, anisotropy);
(this->*Context::current().state().texture->parameterfImplementation)(GL_TEXTURE_MAX_ANISOTROPY_EXT, anisotropy);
}
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
@ -1520,7 +1520,7 @@ template<UnsignedInt dimensions> void AbstractTexture::image(GLint level, Image<
Buffer::unbindInternal(Buffer::TargetHint::PixelPack);
image.storage().applyPack();
(this->*Context::current()->state().texture->getImageImplementation)(level, image.format(), image.type(), data.size(), data);
(this->*Context::current().state().texture->getImageImplementation)(level, image.format(), image.type(), data.size(), data);
image.setData(image.storage(), image.format(), image.type(), size, std::move(data));
}
@ -1540,7 +1540,7 @@ template<UnsignedInt dimensions> void AbstractTexture::image(GLint level, Buffer
image.buffer().bindInternal(Buffer::TargetHint::PixelPack);
image.storage().applyPack();
(this->*Context::current()->state().texture->getImageImplementation)(level, image.format(), image.type(), dataSize, nullptr);
(this->*Context::current().state().texture->getImageImplementation)(level, image.format(), image.type(), dataSize, nullptr);
}
template void MAGNUM_EXPORT AbstractTexture::image<1>(GLint, BufferImage<1>&, BufferUsage);
@ -1550,10 +1550,10 @@ template void MAGNUM_EXPORT AbstractTexture::image<3>(GLint, BufferImage<3>&, Bu
template<UnsignedInt dimensions> void AbstractTexture::compressedImage(const GLint level, CompressedImage<dimensions>& image) {
const Math::Vector<dimensions, Int> size = DataHelper<dimensions>::imageSize(*this, level);
GLint textureDataSize;
(this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize);
(this->*Context::current().state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize);
const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize);
GLint format;
(this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
(this->*Context::current().state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
/* Reallocate only if needed */
Containers::Array<char> data{image.release()};
@ -1562,7 +1562,7 @@ template<UnsignedInt dimensions> void AbstractTexture::compressedImage(const GLi
Buffer::unbindInternal(Buffer::TargetHint::PixelPack);
image.storage().applyPack();
(this->*Context::current()->state().texture->getCompressedImageImplementation)(level, data.size(), data);
(this->*Context::current().state().texture->getCompressedImageImplementation)(level, data.size(), data);
image.setData(image.storage(), CompressedPixelFormat(format), size, std::move(data));
}
@ -1573,10 +1573,10 @@ template void MAGNUM_EXPORT AbstractTexture::compressedImage<3>(GLint, Compresse
template<UnsignedInt dimensions> void AbstractTexture::compressedImage(const GLint level, CompressedBufferImage<dimensions>& image, BufferUsage usage) {
const Math::Vector<dimensions, Int> size = DataHelper<dimensions>::imageSize(*this, level);
GLint textureDataSize;
(this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize);
(this->*Context::current().state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &textureDataSize);
const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize);
GLint format;
(this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
(this->*Context::current().state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
/* Reallocate only if needed */
if(image.dataSize() < dataSize)
@ -1586,7 +1586,7 @@ template<UnsignedInt dimensions> void AbstractTexture::compressedImage(const GLi
image.buffer().bindInternal(Buffer::TargetHint::PixelPack);
image.storage().applyPack();
(this->*Context::current()->state().texture->getCompressedImageImplementation)(level, dataSize, nullptr);
(this->*Context::current().state().texture->getCompressedImageImplementation)(level, dataSize, nullptr);
}
template void MAGNUM_EXPORT AbstractTexture::compressedImage<1>(GLint, CompressedBufferImage<1>&, BufferUsage);
@ -1654,7 +1654,7 @@ template<UnsignedInt dimensions> void AbstractTexture::compressedSubImage(const
const Vector3i paddedOffset = Vector3i::pad(range.min());
const Vector3i paddedSize = Vector3i::pad(size, 1);
GLint format;
(this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
(this->*Context::current().state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, compressedSubImageSize<dimensions>(TextureFormat(format), size));
/* Reallocate only if needed */
@ -1679,7 +1679,7 @@ template<UnsignedInt dimensions> void AbstractTexture::compressedSubImage(const
const Vector3i paddedOffset = Vector3i::pad(range.min());
const Vector3i paddedSize = Vector3i::pad(size, 1);
GLint format;
(this->*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
(this->*Context::current().state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, compressedSubImageSize<dimensions>(TextureFormat(format), size));
/* Reallocate only if needed */
@ -1723,14 +1723,14 @@ Vector3i AbstractTexture::DataHelper<3>::compressedBlockSize(const GLenum target
#ifndef MAGNUM_TARGET_GLES
Math::Vector<1, GLint> AbstractTexture::DataHelper<1>::imageSize(AbstractTexture& texture, const GLint level) {
Math::Vector<1, GLint> value;
(texture.*Context::current()->state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]);
(texture.*Context::current().state().texture->getLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]);
return value;
}
#endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
Vector2i AbstractTexture::DataHelper<2>::imageSize(AbstractTexture& texture, const GLint level) {
const Implementation::TextureState& state = *Context::current()->state().texture;
const Implementation::TextureState& state = *Context::current().state().texture;
Vector2i value;
(texture.*state.getLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]);
@ -1739,7 +1739,7 @@ Vector2i AbstractTexture::DataHelper<2>::imageSize(AbstractTexture& texture, con
}
Vector3i AbstractTexture::DataHelper<3>::imageSize(AbstractTexture& texture, const GLint level) {
const Implementation::TextureState& state = *Context::current()->state().texture;
const Implementation::TextureState& state = *Context::current().state().texture;
Vector3i value;
(texture.*state.getLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]);
@ -1751,27 +1751,27 @@ Vector3i AbstractTexture::DataHelper<3>::imageSize(AbstractTexture& texture, con
#ifndef MAGNUM_TARGET_GLES
void AbstractTexture::DataHelper<1>::setStorage(AbstractTexture& texture, const GLsizei levels, const TextureFormat internalFormat, const Math::Vector< 1, GLsizei >& size) {
(texture.*Context::current()->state().texture->storage1DImplementation)(levels, internalFormat, size);
(texture.*Context::current().state().texture->storage1DImplementation)(levels, internalFormat, size);
}
#endif
void AbstractTexture::DataHelper<2>::setStorage(AbstractTexture& texture, const GLsizei levels, const TextureFormat internalFormat, const Vector2i& size) {
(texture.*Context::current()->state().texture->storage2DImplementation)(levels, internalFormat, size);
(texture.*Context::current().state().texture->storage2DImplementation)(levels, internalFormat, size);
}
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
void AbstractTexture::DataHelper<3>::setStorage(AbstractTexture& texture, const GLsizei levels, const TextureFormat internalFormat, const Vector3i& size) {
(texture.*Context::current()->state().texture->storage3DImplementation)(levels, internalFormat, size);
(texture.*Context::current().state().texture->storage3DImplementation)(levels, internalFormat, size);
}
#endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void AbstractTexture::DataHelper<2>::setStorageMultisample(AbstractTexture& texture, const GLsizei samples, const TextureFormat internalFormat, const Vector2i& size, const GLboolean fixedSampleLocations) {
(texture.*Context::current()->state().texture->storage2DMultisampleImplementation)(samples, internalFormat, size, fixedSampleLocations);
(texture.*Context::current().state().texture->storage2DMultisampleImplementation)(samples, internalFormat, size, fixedSampleLocations);
}
void AbstractTexture::DataHelper<3>::setStorageMultisample(AbstractTexture& texture, const GLsizei samples, const TextureFormat internalFormat, const Vector3i& size, const GLboolean fixedSampleLocations) {
(texture.*Context::current()->state().texture->storage3DMultisampleImplementation)(samples, internalFormat, size, fixedSampleLocations);
(texture.*Context::current().state().texture->storage3DMultisampleImplementation)(samples, internalFormat, size, fixedSampleLocations);
}
#endif
@ -1807,25 +1807,25 @@ void AbstractTexture::DataHelper<1>::setCompressedImage(AbstractTexture& texture
void AbstractTexture::DataHelper<1>::setSubImage(AbstractTexture& texture, const GLint level, const Math::Vector<1, GLint>& offset, const ImageView1D& image) {
Buffer::unbindInternal(Buffer::TargetHint::PixelUnpack);
image.storage().applyUnpack();
(texture.*Context::current()->state().texture->subImage1DImplementation)(level, offset, image.size(), image.format(), image.type(), image.data());
(texture.*Context::current().state().texture->subImage1DImplementation)(level, offset, image.size(), image.format(), image.type(), image.data());
}
void AbstractTexture::DataHelper<1>::setCompressedSubImage(AbstractTexture& texture, const GLint level, const Math::Vector<1, GLint>& offset, const CompressedImageView1D& image) {
Buffer::unbindInternal(Buffer::TargetHint::PixelUnpack);
image.storage().applyUnpack();
(texture.*Context::current()->state().texture->compressedSubImage1DImplementation)(level, offset, image.size(), image.format(), image.data(), Implementation::occupiedCompressedImageDataSize(image, image.data().size()));
(texture.*Context::current().state().texture->compressedSubImage1DImplementation)(level, offset, image.size(), image.format(), image.data(), Implementation::occupiedCompressedImageDataSize(image, image.data().size()));
}
void AbstractTexture::DataHelper<1>::setSubImage(AbstractTexture& texture, const GLint level, const Math::Vector<1, GLint>& offset, BufferImage1D& image) {
image.buffer().bindInternal(Buffer::TargetHint::PixelUnpack);
image.storage().applyUnpack();
(texture.*Context::current()->state().texture->subImage1DImplementation)(level, offset, image.size(), image.format(), image.type(), nullptr);
(texture.*Context::current().state().texture->subImage1DImplementation)(level, offset, image.size(), image.format(), image.type(), nullptr);
}
void AbstractTexture::DataHelper<1>::setCompressedSubImage(AbstractTexture& texture, const GLint level, const Math::Vector<1, GLint>& offset, CompressedBufferImage1D& image) {
image.buffer().bindInternal(Buffer::TargetHint::PixelUnpack);
image.storage().applyUnpack();
(texture.*Context::current()->state().texture->compressedSubImage1DImplementation)(level, offset, image.size(), image.format(), nullptr, Implementation::occupiedCompressedImageDataSize(image, image.dataSize()));
(texture.*Context::current().state().texture->compressedSubImage1DImplementation)(level, offset, image.size(), image.format(), nullptr, Implementation::occupiedCompressedImageDataSize(image, image.dataSize()));
}
#endif
@ -1880,7 +1880,7 @@ void AbstractTexture::DataHelper<2>::setSubImage(AbstractTexture& texture, const
Buffer::unbindInternal(Buffer::TargetHint::PixelUnpack);
#endif
image.storage().applyUnpack();
(texture.*Context::current()->state().texture->subImage2DImplementation)(level, offset, image.size(), image.format(), image.type(), image.data()
(texture.*Context::current().state().texture->subImage2DImplementation)(level, offset, image.size(), image.format(), image.type(), image.data()
#ifdef MAGNUM_TARGET_GLES2
+ Implementation::pixelStorageSkipOffset(image)
#endif
@ -1896,14 +1896,14 @@ void AbstractTexture::DataHelper<2>::setCompressedSubImage(AbstractTexture& text
to reset anything */
image.storage().applyUnpack();
#endif
(texture.*Context::current()->state().texture->compressedSubImage2DImplementation)(level, offset, image.size(), image.format(), image.data(), Implementation::occupiedCompressedImageDataSize(image, image.data().size()));
(texture.*Context::current().state().texture->compressedSubImage2DImplementation)(level, offset, image.size(), image.format(), image.data(), Implementation::occupiedCompressedImageDataSize(image, image.data().size()));
}
#ifndef MAGNUM_TARGET_GLES2
void AbstractTexture::DataHelper<2>::setSubImage(AbstractTexture& texture, const GLint level, const Vector2i& offset, BufferImage2D& image) {
image.buffer().bindInternal(Buffer::TargetHint::PixelUnpack);
image.storage().applyUnpack();
(texture.*Context::current()->state().texture->subImage2DImplementation)(level, offset, image.size(), image.format(), image.type(), nullptr);
(texture.*Context::current().state().texture->subImage2DImplementation)(level, offset, image.size(), image.format(), image.type(), nullptr);
}
void AbstractTexture::DataHelper<2>::setCompressedSubImage(AbstractTexture& texture, const GLint level, const Vector2i& offset, CompressedBufferImage2D& image) {
@ -1913,7 +1913,7 @@ void AbstractTexture::DataHelper<2>::setCompressedSubImage(AbstractTexture& text
to reset anything */
image.storage().applyUnpack();
#endif
(texture.*Context::current()->state().texture->compressedSubImage2DImplementation)(level, offset, image.size(), image.format(), nullptr, Implementation::occupiedCompressedImageDataSize(image, image.dataSize()));
(texture.*Context::current().state().texture->compressedSubImage2DImplementation)(level, offset, image.size(), image.format(), nullptr, Implementation::occupiedCompressedImageDataSize(image, image.dataSize()));
}
#endif
@ -1984,7 +1984,7 @@ void AbstractTexture::DataHelper<3>::setSubImage(AbstractTexture& texture, const
Buffer::unbindInternal(Buffer::TargetHint::PixelUnpack);
#endif
image.storage().applyUnpack();
(texture.*Context::current()->state().texture->subImage3DImplementation)(level, offset, image.size(), image.format(), image.type(), image.data()
(texture.*Context::current().state().texture->subImage3DImplementation)(level, offset, image.size(), image.format(), image.type(), image.data()
#ifdef MAGNUM_TARGET_GLES2
+ Implementation::pixelStorageSkipOffset(image)
#endif
@ -2000,7 +2000,7 @@ void AbstractTexture::DataHelper<3>::setCompressedSubImage(AbstractTexture& text
to reset anything */
image.storage().applyUnpack();
#endif
(texture.*Context::current()->state().texture->compressedSubImage3DImplementation)(level, offset, image.size(), image.format(), image.data(), Implementation::occupiedCompressedImageDataSize(image, image.data().size()));
(texture.*Context::current().state().texture->compressedSubImage3DImplementation)(level, offset, image.size(), image.format(), image.data(), Implementation::occupiedCompressedImageDataSize(image, image.data().size()));
}
#endif
@ -2008,7 +2008,7 @@ void AbstractTexture::DataHelper<3>::setCompressedSubImage(AbstractTexture& text
void AbstractTexture::DataHelper<3>::setSubImage(AbstractTexture& texture, const GLint level, const Vector3i& offset, BufferImage3D& image) {
image.buffer().bindInternal(Buffer::TargetHint::PixelUnpack);
image.storage().applyUnpack();
(texture.*Context::current()->state().texture->subImage3DImplementation)(level, offset, image.size(), image.format(), image.type(), nullptr);
(texture.*Context::current().state().texture->subImage3DImplementation)(level, offset, image.size(), image.format(), image.type(), nullptr);
}
void AbstractTexture::DataHelper<3>::setCompressedSubImage(AbstractTexture& texture, const GLint level, const Vector3i& offset, CompressedBufferImage3D& image) {
@ -2018,32 +2018,32 @@ void AbstractTexture::DataHelper<3>::setCompressedSubImage(AbstractTexture& text
to reset anything */
image.storage().applyUnpack();
#endif
(texture.*Context::current()->state().texture->compressedSubImage3DImplementation)(level, offset, image.size(), image.format(), nullptr, Implementation::occupiedCompressedImageDataSize(image, image.dataSize()));
(texture.*Context::current().state().texture->compressedSubImage3DImplementation)(level, offset, image.size(), image.format(), nullptr, Implementation::occupiedCompressedImageDataSize(image, image.dataSize()));
}
#endif
#ifndef MAGNUM_TARGET_GLES
void AbstractTexture::DataHelper<1>::invalidateSubImage(AbstractTexture& texture, const GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLint>& size) {
(texture.*Context::current()->state().texture->invalidateSubImageImplementation)(level, {offset[0], 0, 0}, {size[0], 1, 1});
(texture.*Context::current().state().texture->invalidateSubImageImplementation)(level, {offset[0], 0, 0}, {size[0], 1, 1});
}
#endif
void AbstractTexture::DataHelper<2>::invalidateSubImage(AbstractTexture& texture, const GLint level, const Vector2i& offset, const Vector2i& size) {
(texture.*Context::current()->state().texture->invalidateSubImageImplementation)(level, {offset, 0}, {size, 1});
(texture.*Context::current().state().texture->invalidateSubImageImplementation)(level, {offset, 0}, {size, 1});
}
void AbstractTexture::DataHelper<3>::invalidateSubImage(AbstractTexture& texture, const GLint level, const Vector3i& offset, const Vector3i& size) {
(texture.*Context::current()->state().texture->invalidateSubImageImplementation)(level, offset, size);
(texture.*Context::current().state().texture->invalidateSubImageImplementation)(level, offset, size);
}
#ifndef MAGNUM_TARGET_GLES
void AbstractTexture::DataHelper<1>::setWrapping(AbstractTexture& texture, const Array1D<Sampler::Wrapping>& wrapping) {
(texture.*Context::current()->state().texture->parameteriImplementation)(GL_TEXTURE_WRAP_S, GLint(wrapping.x()));
(texture.*Context::current().state().texture->parameteriImplementation)(GL_TEXTURE_WRAP_S, GLint(wrapping.x()));
}
#endif
void AbstractTexture::DataHelper<2>::setWrapping(AbstractTexture& texture, const Array2D<Sampler::Wrapping>& wrapping) {
const Implementation::TextureState& state = *Context::current()->state().texture;
const Implementation::TextureState& state = *Context::current().state().texture;
(texture.*state.parameteriImplementation)(GL_TEXTURE_WRAP_S, GLint(wrapping.x()));
(texture.*state.parameteriImplementation)(GL_TEXTURE_WRAP_T, GLint(wrapping.y()));
@ -2051,7 +2051,7 @@ void AbstractTexture::DataHelper<2>::setWrapping(AbstractTexture& texture, const
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
void AbstractTexture::DataHelper<3>::setWrapping(AbstractTexture& texture, const Array3D<Sampler::Wrapping>& wrapping) {
const Implementation::TextureState& state = *Context::current()->state().texture;
const Implementation::TextureState& state = *Context::current().state().texture;
(texture.*state.parameteriImplementation)(GL_TEXTURE_WRAP_S, GLint(wrapping.x()));
(texture.*state.parameteriImplementation)(GL_TEXTURE_WRAP_T, GLint(wrapping.y()));

2
src/Magnum/Audio/Context.h

@ -237,7 +237,7 @@ class MAGNUM_AUDIO_EXPORT Context {
* Extensions usable with this function are listed in @ref Extensions
* namespace in header @ref Extensions.h. Example usage:
* @code
* if(Context::current()->isExtensionSupported<Extensions::ALC::SOFTX::HRTF>()) {
* if(Context::current().isExtensionSupported<Extensions::ALC::SOFTX::HRTF>()) {
* // amazing binaural audio
* } else {
* // probably left/right stereo only

74
src/Magnum/Buffer.cpp

@ -41,10 +41,10 @@ namespace Magnum {
#ifndef MAGNUM_TARGET_GLES
Int Buffer::minMapAlignment() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::map_buffer_alignment>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::map_buffer_alignment>())
return 1;
GLint& value = Context::current()->state().buffer->minMapAlignment;
GLint& value = Context::current().state().buffer->minMapAlignment;
if(value == 0)
glGetIntegerv(GL_MIN_MAP_BUFFER_ALIGNMENT, &value);
@ -57,13 +57,13 @@ Int Buffer::minMapAlignment() {
#ifndef MAGNUM_TARGET_WEBGL
Int Buffer::maxAtomicCounterBindings() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 0;
GLint& value = Context::current()->state().buffer->maxAtomicCounterBindings;
GLint& value = Context::current().state().buffer->maxAtomicCounterBindings;
if(value == 0)
glGetIntegerv(GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, &value);
@ -73,13 +73,13 @@ Int Buffer::maxAtomicCounterBindings() {
Int Buffer::maxShaderStorageBindings() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_storage_buffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::shader_storage_buffer_object>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 0;
GLint& value = Context::current()->state().buffer->maxShaderStorageBindings;
GLint& value = Context::current().state().buffer->maxShaderStorageBindings;
if(value == 0)
glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &value);
@ -90,11 +90,11 @@ Int Buffer::maxShaderStorageBindings() {
Int Buffer::uniformOffsetAlignment() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>())
return 1;
#endif
GLint& value = Context::current()->state().buffer->uniformOffsetAlignment;
GLint& value = Context::current().state().buffer->uniformOffsetAlignment;
if(value == 0)
glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &value);
@ -105,13 +105,13 @@ Int Buffer::uniformOffsetAlignment() {
#ifndef MAGNUM_TARGET_WEBGL
Int Buffer::shaderStorageOffsetAlignment() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_storage_buffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::shader_storage_buffer_object>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 1;
GLint& value = Context::current()->state().buffer->shaderStorageOffsetAlignment;
GLint& value = Context::current().state().buffer->shaderStorageOffsetAlignment;
if(value == 0)
glGetIntegerv(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, &value);
@ -122,11 +122,11 @@ Int Buffer::shaderStorageOffsetAlignment() {
Int Buffer::maxUniformBindings() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>())
return 0;
#endif
GLint& value = Context::current()->state().buffer->maxUniformBindings;
GLint& value = Context::current().state().buffer->maxUniformBindings;
if(value == 0)
glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &value);
@ -153,7 +153,7 @@ void Buffer::unbind(const Target target, const UnsignedInt firstIndex, const std
CORRADE_INTERNAL_ASSERT(target == Target::Uniform);
#endif
#endif
Context::current()->state().buffer->bindBasesImplementation(target, firstIndex, {nullptr, count});
Context::current().state().buffer->bindBasesImplementation(target, firstIndex, {nullptr, count});
}
/** @todoc const std::initializer_list makes Doxygen grumpy */
@ -165,7 +165,7 @@ void Buffer::bind(const Target target, const UnsignedInt firstIndex, std::initia
CORRADE_INTERNAL_ASSERT(target == Target::Uniform || GLenum(target) == GL_TRANSFORM_FEEDBACK_BUFFER);
#endif
#endif
Context::current()->state().buffer->bindRangesImplementation(target, firstIndex, {buffers.begin(), buffers.size()});
Context::current().state().buffer->bindRangesImplementation(target, firstIndex, {buffers.begin(), buffers.size()});
}
/** @todoc const std::initializer_list makes Doxygen grumpy */
@ -177,11 +177,11 @@ void Buffer::bind(const Target target, const UnsignedInt firstIndex, std::initia
CORRADE_INTERNAL_ASSERT(target == Target::Uniform || GLenum(target) == GL_TRANSFORM_FEEDBACK_BUFFER);
#endif
#endif
Context::current()->state().buffer->bindBasesImplementation(target, firstIndex, {buffers.begin(), buffers.size()});
Context::current().state().buffer->bindBasesImplementation(target, firstIndex, {buffers.begin(), buffers.size()});
}
void Buffer::copy(Buffer& read, Buffer& write, const GLintptr readOffset, const GLintptr writeOffset, const GLsizeiptr size) {
Context::current()->state().buffer->copyImplementation(read, write, readOffset, writeOffset, size);
Context::current().state().buffer->copyImplementation(read, write, readOffset, writeOffset, size);
}
#endif
@ -190,7 +190,7 @@ Buffer::Buffer(const TargetHint targetHint): _targetHint{targetHint}, _flags{Obj
, _mappedBuffer{nullptr}
#endif
{
(this->*Context::current()->state().buffer->createImplementation)();
(this->*Context::current().state().buffer->createImplementation)();
CORRADE_INTERNAL_ASSERT(_id != Implementation::State::DisengagedBinding);
}
@ -209,7 +209,7 @@ Buffer::~Buffer() {
/* Moved out or not deleting on destruction, nothing to do */
if(!_id || !(_flags & ObjectFlag::DeleteOnDestruction)) return;
GLuint* bindings = Context::current()->state().buffer->bindings;
GLuint* bindings = Context::current().state().buffer->bindings;
/* Remove all current bindings from the state */
for(std::size_t i = 1; i != Implementation::BufferState::TargetCount; ++i)
@ -234,18 +234,18 @@ inline void Buffer::createIfNotAlready() {
std::string Buffer::label() {
createIfNotAlready();
#ifndef MAGNUM_TARGET_GLES
return Context::current()->state().debug->getLabelImplementation(GL_BUFFER, _id);
return Context::current().state().debug->getLabelImplementation(GL_BUFFER, _id);
#else
return Context::current()->state().debug->getLabelImplementation(GL_BUFFER_KHR, _id);
return Context::current().state().debug->getLabelImplementation(GL_BUFFER_KHR, _id);
#endif
}
Buffer& Buffer::setLabelInternal(const Containers::ArrayView<const char> label) {
createIfNotAlready();
#ifndef MAGNUM_TARGET_GLES
Context::current()->state().debug->labelImplementation(GL_BUFFER, _id, label);
Context::current().state().debug->labelImplementation(GL_BUFFER, _id, label);
#else
Context::current()->state().debug->labelImplementation(GL_BUFFER_KHR, _id, label);
Context::current().state().debug->labelImplementation(GL_BUFFER_KHR, _id, label);
#endif
return *this;
}
@ -253,7 +253,7 @@ Buffer& Buffer::setLabelInternal(const Containers::ArrayView<const char> label)
void Buffer::bindInternal(const TargetHint target, Buffer* const buffer) {
const GLuint id = buffer ? buffer->_id : 0;
GLuint& bound = Context::current()->state().buffer->bindings[Implementation::BufferState::indexForTarget(target)];
GLuint& bound = Context::current().state().buffer->bindings[Implementation::BufferState::indexForTarget(target)];
/* Already bound, nothing to do */
if(bound == id) return;
@ -265,7 +265,7 @@ void Buffer::bindInternal(const TargetHint target, Buffer* const buffer) {
}
auto Buffer::bindSomewhereInternal(const TargetHint hint) -> TargetHint {
GLuint* bindings = Context::current()->state().buffer->bindings;
GLuint* bindings = Context::current().state().buffer->bindings;
GLuint& hintBinding = bindings[Implementation::BufferState::indexForTarget(hint)];
/* Shortcut - if already bound to hint, return */
@ -315,33 +315,33 @@ Int Buffer::size() {
* couldn't find any matching extension, though)
*/
GLint size;
(this->*Context::current()->state().buffer->getParameterImplementation)(GL_BUFFER_SIZE, &size);
(this->*Context::current().state().buffer->getParameterImplementation)(GL_BUFFER_SIZE, &size);
return size;
}
Buffer& Buffer::setData(const Containers::ArrayView<const void> data, const BufferUsage usage) {
(this->*Context::current()->state().buffer->dataImplementation)(data.size(), data, usage);
(this->*Context::current().state().buffer->dataImplementation)(data.size(), data, usage);
return *this;
}
Buffer& Buffer::setSubData(const GLintptr offset, const Containers::ArrayView<const void> data) {
(this->*Context::current()->state().buffer->subDataImplementation)(offset, data.size(), data);
(this->*Context::current().state().buffer->subDataImplementation)(offset, data.size(), data);
return *this;
}
Buffer& Buffer::invalidateData() {
(this->*Context::current()->state().buffer->invalidateImplementation)();
(this->*Context::current().state().buffer->invalidateImplementation)();
return *this;
}
Buffer& Buffer::invalidateSubData(const GLintptr offset, const GLsizeiptr length) {
(this->*Context::current()->state().buffer->invalidateSubImplementation)(offset, length);
(this->*Context::current().state().buffer->invalidateSubImplementation)(offset, length);
return *this;
}
#ifndef MAGNUM_TARGET_WEBGL
void* Buffer::map(const MapAccess access) {
return (this->*Context::current()->state().buffer->mapImplementation)(access);
return (this->*Context::current().state().buffer->mapImplementation)(access);
}
#if defined(DOXYGEN_GENERATING_OUTPUT) || defined(CORRADE_TARGET_NACL)
@ -352,15 +352,15 @@ void* Buffer::mapSub(const GLintptr offset, const GLsizeiptr length, const MapAc
#endif
void* Buffer::map(const GLintptr offset, const GLsizeiptr length, const MapFlags flags) {
return (this->*Context::current()->state().buffer->mapRangeImplementation)(offset, length, flags);
return (this->*Context::current().state().buffer->mapRangeImplementation)(offset, length, flags);
}
Buffer& Buffer::flushMappedRange(const GLintptr offset, const GLsizeiptr length) {
(this->*Context::current()->state().buffer->flushMappedRangeImplementation)(offset, length);
(this->*Context::current().state().buffer->flushMappedRangeImplementation)(offset, length);
return *this;
}
bool Buffer::unmap() { return (this->*Context::current()->state().buffer->unmapImplementation)(); }
bool Buffer::unmap() { return (this->*Context::current().state().buffer->unmapImplementation)(); }
#if defined(DOXYGEN_GENERATING_OUTPUT) || defined(CORRADE_TARGET_NACL)
void Buffer::unmapSub() {
@ -373,7 +373,7 @@ void Buffer::unmapSub() {
#ifndef MAGNUM_TARGET_GLES
void Buffer::subDataInternal(GLintptr offset, GLsizeiptr size, GLvoid* data) {
(this->*Context::current()->state().buffer->getSubDataImplementation)(offset, size, data);
(this->*Context::current().state().buffer->getSubDataImplementation)(offset, size, data);
}
#endif

16
src/Magnum/BufferTexture.cpp

@ -37,14 +37,14 @@ namespace Magnum {
Int BufferTexture::maxSize() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>())
return 0;
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
return 0;
#endif
GLint& value = Context::current()->state().texture->maxBufferSize;
GLint& value = Context::current().state().texture->maxBufferSize;
/* Get the value, if not already cached */
if(value == 0) glGetIntegerv(
@ -60,14 +60,14 @@ Int BufferTexture::maxSize() {
Int BufferTexture::offsetAlignment() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_buffer_range>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_buffer_range>())
return 1;
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
return 0;
#endif
GLint& value = Context::current()->state().texture->bufferOffsetAlignment;
GLint& value = Context::current().state().texture->bufferOffsetAlignment;
/* Get the value, if not already cached */
if(value == 0) glGetIntegerv(
@ -82,12 +82,12 @@ Int BufferTexture::offsetAlignment() {
}
BufferTexture& BufferTexture::setBuffer(const BufferTextureFormat internalFormat, Buffer& buffer) {
(this->*Context::current()->state().texture->setBufferImplementation)(internalFormat, buffer);
(this->*Context::current().state().texture->setBufferImplementation)(internalFormat, buffer);
return *this;
}
BufferTexture& BufferTexture::setBuffer(const BufferTextureFormat internalFormat, Buffer& buffer, const GLintptr offset, const GLsizeiptr size) {
(this->*Context::current()->state().texture->setBufferRangeImplementation)(internalFormat, buffer, offset, size);
(this->*Context::current().state().texture->setBufferRangeImplementation)(internalFormat, buffer, offset, size);
return *this;
}

7
src/Magnum/Context.cpp

@ -403,6 +403,13 @@ const std::vector<Extension>& Extension::extensions(Version version) {
Context* Context::_current = nullptr;
bool Context::hasCurrent() { return _current; }
Context& Context::current() {
CORRADE_ASSERT(_current, "Context::current(): no current context", *_current);
return *_current;
}
Context::Context(NoCreateT, Int argc, char** argv, void functionLoader()): _functionLoader{functionLoader}, _version{Version::None} {
/* Parse arguments */
Utility::Arguments args{"magnum"};

33
src/Magnum/Context.h

@ -234,6 +234,21 @@ class MAGNUM_EXPORT Context {
*/
typedef Containers::EnumSet<DetectedDriver> DetectedDrivers;
/**
* @brief Whether there is any current context
*
* @see @ref current()
*/
static bool hasCurrent();
/**
* @brief Current context
*
* Expect that there is current context.
* @see @ref hasCurrent()
*/
static Context& current();
/** @brief Copying is not allowed */
Context(const Context&) = delete;
@ -248,8 +263,10 @@ class MAGNUM_EXPORT Context {
/** @brief Move assignment is not allowed */
Context& operator=(Context&&) = delete;
/** @brief Current context */
static Context* current() { return _current; }
#if defined(MAGNUM_BUILD_DEPRECATED) && !defined(DOXYGEN_GENERATING_OUTPUT)
CORRADE_DEPRECATED("Context::current() returns reference now") Context* operator->() { return this; }
CORRADE_DEPRECATED("Context::current() returns reference now") operator Context*() { return this; }
#endif
/**
* @brief OpenGL version
@ -380,7 +397,7 @@ class MAGNUM_EXPORT Context {
* Extensions usable with this function are listed in @ref Extensions
* namespace in header @ref Extensions.h. Example usage:
* @code
* if(Context::current()->isExtensionSupported<Extensions::GL::ARB::tessellation_shader>()) {
* if(Context::current().isExtensionSupported<Extensions::GL::ARB::tessellation_shader>()) {
* // draw fancy detailed model
* } else {
* // texture fallback
@ -403,8 +420,8 @@ class MAGNUM_EXPORT Context {
* @p version. Useful mainly in shader compilation when the decisions
* depend on selected GLSL version, for example:
* @code
* const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL300, Version::GL210});
* if(Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(version)) {
* const Version version = Context::current()supportedVersion({Version::GL320, Version::GL300, Version::GL210});
* if(Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(version)) {
* // Called only if ARB_explicit_attrib_location is supported
* // *and* version is higher than GL 3.1
* }
@ -487,7 +504,7 @@ class MAGNUM_EXPORT Context {
Implementation::State& state() { return *_state; }
private:
static Context* _current;
MAGNUM_LOCAL static Context* _current;
explicit Context(NoCreateT, Int argc, char** argv, void functionLoader());
@ -544,7 +561,7 @@ MAGNUM_ASSERT_VERSION_SUPPORTED(Version::GL330);
#else
#define MAGNUM_ASSERT_VERSION_SUPPORTED(version) \
do { \
if(!Magnum::Context::current()->isVersionSupported(version)) { \
if(!Magnum::Context::current().isVersionSupported(version)) { \
Corrade::Utility::Error() << "Magnum: required version" << version << "is not supported"; \
std::abort(); \
} \
@ -574,7 +591,7 @@ MAGNUM_ASSERT_EXTENSION_SUPPORTED(Extensions::GL::ARB::geometry_shader4);
#else
#define MAGNUM_ASSERT_EXTENSION_SUPPORTED(extension) \
do { \
if(!Magnum::Context::current()->isExtensionSupported<extension>()) { \
if(!Magnum::Context::current().isExtensionSupported<extension>()) { \
Corrade::Utility::Error() << "Magnum: required extension" << extension::string() << "is not supported"; \
std::abort(); \
} \

38
src/Magnum/CubeMapTexture.cpp

@ -51,7 +51,7 @@ Vector2i CubeMapTexture::maxSize() {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
Vector2i CubeMapTexture::imageSize(const Int level) {
const Implementation::TextureState& state = *Context::current()->state().texture;
const Implementation::TextureState& state = *Context::current().state().texture;
Vector2i value;
(this->*state.getCubeLevelParameterivImplementation)(level, GL_TEXTURE_WIDTH, &value[0]);
@ -109,11 +109,11 @@ void CubeMapTexture::compressedImage(const Int level, CompressedImage3D& image)
createIfNotAlready();
const Vector3i size{imageSize(level), 6};
const GLint textureDataSize = (this->*Context::current()->state().texture->getCubeLevelCompressedImageSizeImplementation)(level);
const GLint textureDataSize = (this->*Context::current().state().texture->getCubeLevelCompressedImageSizeImplementation)(level);
std::size_t dataOffset, dataSize;
std::tie(dataOffset, dataSize) = Implementation::compressedImageDataOffsetSizeFor(image, size, textureDataSize);
GLint format;
(this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
(this->*Context::current().state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
/* Reallocate only if needed */
Containers::Array<char> data{image.release()};
@ -122,7 +122,7 @@ void CubeMapTexture::compressedImage(const Int level, CompressedImage3D& image)
Buffer::unbindInternal(Buffer::TargetHint::PixelPack);
image.storage().applyPack();
(this->*Context::current()->state().texture->getFullCompressedCubeImageImplementation)(level, size.xy(), dataOffset, dataSize, data);
(this->*Context::current().state().texture->getFullCompressedCubeImageImplementation)(level, size.xy(), dataOffset, dataSize, data);
image.setData(image.storage(), CompressedPixelFormat(format), size, std::move(data));
}
@ -135,11 +135,11 @@ void CubeMapTexture::compressedImage(const Int level, CompressedBufferImage3D& i
createIfNotAlready();
const Vector3i size{imageSize(level), 6};
const GLint textureDataSize = (this->*Context::current()->state().texture->getCubeLevelCompressedImageSizeImplementation)(level);
const GLint textureDataSize = (this->*Context::current().state().texture->getCubeLevelCompressedImageSizeImplementation)(level);
std::size_t dataOffset, dataSize;
std::tie(dataOffset, dataSize) = Implementation::compressedImageDataOffsetSizeFor(image, size, textureDataSize);
GLint format;
(this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
(this->*Context::current().state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
/* Reallocate only if needed */
if(image.dataSize() < dataOffset + dataSize)
@ -149,7 +149,7 @@ void CubeMapTexture::compressedImage(const Int level, CompressedBufferImage3D& i
image.buffer().bindInternal(Buffer::TargetHint::PixelPack);
image.storage().applyPack();
(this->*Context::current()->state().texture->getFullCompressedCubeImageImplementation)(level, size.xy(), dataOffset, dataSize, nullptr);
(this->*Context::current().state().texture->getFullCompressedCubeImageImplementation)(level, size.xy(), dataOffset, dataSize, nullptr);
}
CompressedBufferImage3D CubeMapTexture::compressedImage(const Int level, CompressedBufferImage3D&& image, const BufferUsage usage) {
@ -168,7 +168,7 @@ void CubeMapTexture::image(const Coordinate coordinate, const Int level, Image2D
Buffer::unbindInternal(Buffer::TargetHint::PixelPack);
image.storage().applyPack();
(this->*Context::current()->state().texture->getCubeImageImplementation)(coordinate, level, size, image.format(), image.type(), data.size(), data);
(this->*Context::current().state().texture->getCubeImageImplementation)(coordinate, level, size, image.format(), image.type(), data.size(), data);
image.setData(image.storage(), image.format(), image.type(), size, std::move(data));
}
@ -189,7 +189,7 @@ void CubeMapTexture::image(const Coordinate coordinate, const Int level, BufferI
image.buffer().bindInternal(Buffer::TargetHint::PixelPack);
image.storage().applyPack();
(this->*Context::current()->state().texture->getCubeImageImplementation)(coordinate, level, size, image.format(), image.type(), dataSize, nullptr);
(this->*Context::current().state().texture->getCubeImageImplementation)(coordinate, level, size, image.format(), image.type(), dataSize, nullptr);
}
BufferImage2D CubeMapTexture::image(const Coordinate coordinate, const Int level, BufferImage2D&& image, const BufferUsage usage) {
@ -201,10 +201,10 @@ void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int leve
const Vector2i size = imageSize(level);
/* The function returns size of all six faces, divide the result to get size
of one face */
const GLint textureDataSize = (this->*Context::current()->state().texture->getCubeLevelCompressedImageSizeImplementation)(level)/6;
const GLint textureDataSize = (this->*Context::current().state().texture->getCubeLevelCompressedImageSizeImplementation)(level)/6;
const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize);
GLint format;
(this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
(this->*Context::current().state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
/* Reallocate only if needed */
Containers::Array<char> data{image.release()};
@ -213,7 +213,7 @@ void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int leve
Buffer::unbindInternal(Buffer::TargetHint::PixelPack);
image.storage().applyPack();
(this->*Context::current()->state().texture->getCompressedCubeImageImplementation)(coordinate, level, size, data.size(), data);
(this->*Context::current().state().texture->getCompressedCubeImageImplementation)(coordinate, level, size, data.size(), data);
image.setData(image.storage(), CompressedPixelFormat(format), size, std::move(data));
}
@ -226,10 +226,10 @@ void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int leve
const Vector2i size = imageSize(level);
/* The function returns size of all six faces, divide the result to get size
of one face */
const GLint textureDataSize = (this->*Context::current()->state().texture->getCubeLevelCompressedImageSizeImplementation)(level)/6;
const GLint textureDataSize = (this->*Context::current().state().texture->getCubeLevelCompressedImageSizeImplementation)(level)/6;
const std::size_t dataSize = Implementation::compressedImageDataSizeFor(image, size, textureDataSize);
GLint format;
(this->*Context::current()->state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
(this->*Context::current().state().texture->getCubeLevelParameterivImplementation)(level, GL_TEXTURE_INTERNAL_FORMAT, &format);
/* Reallocate only if needed */
if(image.dataSize() < dataSize)
@ -239,7 +239,7 @@ void CubeMapTexture::compressedImage(const Coordinate coordinate, const Int leve
image.buffer().bindInternal(Buffer::TargetHint::PixelPack);
image.storage().applyPack();
(this->*Context::current()->state().texture->getCompressedCubeImageImplementation)(coordinate, level, size, dataSize, nullptr);
(this->*Context::current().state().texture->getCompressedCubeImageImplementation)(coordinate, level, size, dataSize, nullptr);
}
CompressedBufferImage2D CubeMapTexture::compressedImage(const Coordinate coordinate, const Int level, CompressedBufferImage2D&& image, const BufferUsage usage) {
@ -309,7 +309,7 @@ CubeMapTexture& CubeMapTexture::setSubImage(const Coordinate coordinate, const I
Buffer::unbindInternal(Buffer::TargetHint::PixelUnpack);
#endif
image.storage().applyUnpack();
(this->*Context::current()->state().texture->cubeSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), image.type(), image.data()
(this->*Context::current().state().texture->cubeSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), image.type(), image.data()
#ifdef MAGNUM_TARGET_GLES2
+ Implementation::pixelStorageSkipOffset(image)
#endif
@ -321,7 +321,7 @@ CubeMapTexture& CubeMapTexture::setSubImage(const Coordinate coordinate, const I
CubeMapTexture& CubeMapTexture::setSubImage(const Coordinate coordinate, const Int level, const Vector2i& offset, BufferImage2D& image) {
image.buffer().bindInternal(Buffer::TargetHint::PixelUnpack);
image.storage().applyUnpack();
(this->*Context::current()->state().texture->cubeSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), image.type(), nullptr);
(this->*Context::current().state().texture->cubeSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), image.type(), nullptr);
return *this;
}
#endif
@ -335,7 +335,7 @@ CubeMapTexture& CubeMapTexture::setCompressedSubImage(const Coordinate coordinat
to reset anything */
image.storage().applyUnpack();
#endif
(this->*Context::current()->state().texture->cubeCompressedSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), image.data(), Implementation::occupiedCompressedImageDataSize(image, image.data().size()));
(this->*Context::current().state().texture->cubeCompressedSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), image.data(), Implementation::occupiedCompressedImageDataSize(image, image.data().size()));
return *this;
}
@ -347,7 +347,7 @@ CubeMapTexture& CubeMapTexture::setCompressedSubImage(const Coordinate coordinat
to reset anything */
image.storage().applyUnpack();
#endif
(this->*Context::current()->state().texture->cubeCompressedSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), nullptr, Implementation::occupiedCompressedImageDataSize(image, image.dataSize()));
(this->*Context::current().state().texture->cubeCompressedSubImageImplementation)(coordinate, level, offset, image.size(), image.format(), nullptr, Implementation::occupiedCompressedImageDataSize(image, image.dataSize()));
return *this;
}
#endif

4
src/Magnum/CubeMapTextureArray.cpp

@ -37,10 +37,10 @@ namespace Magnum {
Vector3i CubeMapTextureArray::maxSize() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
return {};
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
return {};
#endif

28
src/Magnum/DebugOutput.cpp

@ -48,7 +48,7 @@ void
APIENTRY
#endif
callbackWrapper(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam) {
Context::current()->state().debug->messageCallback(DebugOutput::Source(source), DebugOutput::Type(type), id, DebugOutput::Severity(severity), std::string{message, std::size_t(length)}, userParam);
Context::current().state().debug->messageCallback(DebugOutput::Source(source), DebugOutput::Type(type), id, DebugOutput::Severity(severity), std::string{message, std::size_t(length)}, userParam);
}
#endif
@ -123,10 +123,10 @@ void defaultCallback(const DebugOutput::Source source, const DebugOutput::Type t
}
Int DebugOutput::maxLoggedMessages() {
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>())
return 0;
GLint& value = Context::current()->state().debug->maxLoggedMessages;
GLint& value = Context::current().state().debug->maxLoggedMessages;
if(value == 0) {
#ifndef MAGNUM_TARGET_GLES
@ -140,10 +140,10 @@ Int DebugOutput::maxLoggedMessages() {
}
Int DebugOutput::maxMessageLength() {
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>())
return 0;
GLint& value = Context::current()->state().debug->maxMessageLength;
GLint& value = Context::current().state().debug->maxMessageLength;
if(value == 0) {
#ifndef MAGNUM_TARGET_GLES
@ -157,7 +157,7 @@ Int DebugOutput::maxMessageLength() {
}
void DebugOutput::setCallback(const Callback callback, const void* userParam) {
Context::current()->state().debug->callbackImplementation(callback, userParam);
Context::current().state().debug->callbackImplementation(callback, userParam);
}
void DebugOutput::setDefaultCallback() {
@ -165,7 +165,7 @@ void DebugOutput::setDefaultCallback() {
}
void DebugOutput::setEnabledInternal(const GLenum source, const GLenum type, const GLenum severity, const std::initializer_list<UnsignedInt> ids, const bool enabled) {
Context::current()->state().debug->controlImplementation(source, type, severity, ids, enabled);
Context::current().state().debug->controlImplementation(source, type, severity, ids, enabled);
}
void DebugOutput::controlImplementationNoOp(GLenum, GLenum, GLenum, std::initializer_list<UnsignedInt>, bool) {}
@ -192,8 +192,8 @@ void DebugOutput::callbackImplementationNoOp(Callback, const void*) {}
void DebugOutput::callbackImplementationKhr(const Callback callback, const void* userParam) {
/* Replace the callback */
const Callback original = Context::current()->state().debug->messageCallback;
Context::current()->state().debug->messageCallback = callback;
const Callback original = Context::current().state().debug->messageCallback;
Context::current().state().debug->messageCallback = callback;
/* Adding callback */
if(!original && callback) {
@ -273,7 +273,7 @@ Debug& operator<<(Debug& debug, const DebugOutput::Severity value) {
#endif
void DebugMessage::insertInternal(const Source source, const Type type, const UnsignedInt id, const DebugOutput::Severity severity, const Containers::ArrayView<const char> string) {
Context::current()->state().debug->messageInsertImplementation(source, type, id, severity, string);
Context::current().state().debug->messageInsertImplementation(source, type, id, severity, string);
}
void DebugMessage::insertImplementationNoOp(Source, Type, UnsignedInt, DebugOutput::Severity, const Containers::ArrayView<const char>) {}
@ -348,10 +348,10 @@ Debug& operator<<(Debug& debug, const DebugMessage::Type value) {
#endif
Int DebugGroup::maxStackDepth() {
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>())
return 0;
GLint& value = Context::current()->state().debug->maxStackDepth;
GLint& value = Context::current().state().debug->maxStackDepth;
if(value == 0) {
#ifndef MAGNUM_TARGET_GLES
@ -366,13 +366,13 @@ Int DebugGroup::maxStackDepth() {
void DebugGroup::pushInternal(const Source source, const UnsignedInt id, const Containers::ArrayView<const char> message) {
CORRADE_ASSERT(!_active, "DebugGroup::push(): group is already active", );
Context::current()->state().debug->pushGroupImplementation(source, id, message);
Context::current().state().debug->pushGroupImplementation(source, id, message);
_active = true;
}
void DebugGroup::pop() {
CORRADE_ASSERT(_active, "DebugGroup::pop(): group is not active", );
Context::current()->state().debug->popGroupImplementation();
Context::current().state().debug->popGroupImplementation();
_active = false;
}

14
src/Magnum/DefaultFramebuffer.cpp

@ -42,7 +42,7 @@ DefaultFramebuffer::DefaultFramebuffer() {
}
DefaultFramebuffer::Status DefaultFramebuffer::checkStatus(const FramebufferTarget target) {
return Status((this->*Context::current()->state().framebuffer->checkStatusImplementation)(target));
return Status((this->*Context::current().state().framebuffer->checkStatusImplementation)(target));
}
DefaultFramebuffer& DefaultFramebuffer::mapForDraw(std::initializer_list<std::pair<UnsignedInt, DrawAttachment>> attachments) {
@ -58,22 +58,22 @@ DefaultFramebuffer& DefaultFramebuffer::mapForDraw(std::initializer_list<std::pa
for(const auto& attachment: attachments)
_attachments[attachment.first] = GLenum(attachment.second);
(this->*Context::current()->state().framebuffer->drawBuffersImplementation)(max+1, _attachments);
(this->*Context::current().state().framebuffer->drawBuffersImplementation)(max+1, _attachments);
return *this;
}
DefaultFramebuffer& DefaultFramebuffer::mapForDraw(const DrawAttachment attachment) {
#ifndef MAGNUM_TARGET_GLES
(this->*Context::current()->state().framebuffer->drawBufferImplementation)(GLenum(attachment));
(this->*Context::current().state().framebuffer->drawBufferImplementation)(GLenum(attachment));
#else
(this->*Context::current()->state().framebuffer->drawBuffersImplementation)(1, reinterpret_cast<const GLenum*>(&attachment));
(this->*Context::current().state().framebuffer->drawBuffersImplementation)(1, reinterpret_cast<const GLenum*>(&attachment));
#endif
return *this;
}
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
DefaultFramebuffer& DefaultFramebuffer::mapForRead(const ReadAttachment attachment) {
(this->*Context::current()->state().framebuffer->readBufferImplementation)(GLenum(attachment));
(this->*Context::current().state().framebuffer->readBufferImplementation)(GLenum(attachment));
return *this;
}
@ -83,7 +83,7 @@ void DefaultFramebuffer::invalidate(std::initializer_list<InvalidationAttachment
for(std::size_t i = 0; i != attachments.size(); ++i)
_attachments[i] = GLenum(*(attachments.begin()+i));
(this->*Context::current()->state().framebuffer->invalidateImplementation)(attachments.size(), _attachments);
(this->*Context::current().state().framebuffer->invalidateImplementation)(attachments.size(), _attachments);
}
#endif
@ -94,7 +94,7 @@ void DefaultFramebuffer::invalidate(std::initializer_list<InvalidationAttachment
for(std::size_t i = 0; i != attachments.size(); ++i)
_attachments[i] = GLenum(*(attachments.begin()+i));
(this->*Context::current()->state().framebuffer->invalidateSubImplementation)(attachments.size(), _attachments, rectangle);
(this->*Context::current().state().framebuffer->invalidateSubImplementation)(attachments.size(), _attachments, rectangle);
}
#endif

66
src/Magnum/Framebuffer.cpp

@ -73,16 +73,16 @@ const Framebuffer::InvalidationAttachment Framebuffer::InvalidationAttachment::S
Int Framebuffer::maxColorAttachments() {
#ifdef MAGNUM_TARGET_GLES2
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::draw_buffers>() &&
!Context::current()->isExtensionSupported<Extensions::GL::NV::fbo_color_attachments>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::draw_buffers>() &&
!Context::current().isExtensionSupported<Extensions::GL::NV::fbo_color_attachments>())
return 0;
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::WEBGL::draw_buffers>())
if(!Context::current().isExtensionSupported<Extensions::GL::WEBGL::draw_buffers>())
return 0;
#endif
#endif
GLint& value = Context::current()->state().framebuffer->maxColorAttachments;
GLint& value = Context::current().state().framebuffer->maxColorAttachments;
if(value == 0) {
#ifndef MAGNUM_TARGET_GLES2
@ -98,7 +98,7 @@ Int Framebuffer::maxColorAttachments() {
Framebuffer::Framebuffer(const Range2Di& viewport) {
CORRADE_INTERNAL_ASSERT(viewport != Implementation::FramebufferState::DisengagedViewport);
_viewport = viewport;
(this->*Context::current()->state().framebuffer->createImplementation)();
(this->*Context::current().state().framebuffer->createImplementation)();
CORRADE_INTERNAL_ASSERT(_id != Implementation::State::DisengagedBinding);
}
@ -118,7 +118,7 @@ Framebuffer::~Framebuffer() {
if(!_id || !(_flags & ObjectFlag::DeleteOnDestruction)) return;
/* If bound, remove itself from state */
Implementation::FramebufferState& state = *Context::current()->state().framebuffer;
Implementation::FramebufferState& state = *Context::current().state().framebuffer;
if(state.readBinding == _id) state.readBinding = 0;
/* For draw binding reset also viewport */
@ -138,18 +138,18 @@ Framebuffer::~Framebuffer() {
#ifndef MAGNUM_TARGET_WEBGL
std::string Framebuffer::label() {
createIfNotAlready();
return Context::current()->state().debug->getLabelImplementation(GL_FRAMEBUFFER, _id);
return Context::current().state().debug->getLabelImplementation(GL_FRAMEBUFFER, _id);
}
Framebuffer& Framebuffer::setLabelInternal(const Containers::ArrayView<const char> label) {
createIfNotAlready();
Context::current()->state().debug->labelImplementation(GL_FRAMEBUFFER, _id, label);
Context::current().state().debug->labelImplementation(GL_FRAMEBUFFER, _id, label);
return *this;
}
#endif
Framebuffer::Status Framebuffer::checkStatus(const FramebufferTarget target) {
return Status((this->*Context::current()->state().framebuffer->checkStatusImplementation)(target));
return Status((this->*Context::current().state().framebuffer->checkStatusImplementation)(target));
}
Framebuffer& Framebuffer::mapForDraw(std::initializer_list<std::pair<UnsignedInt, DrawAttachment>> attachments) {
@ -165,22 +165,22 @@ Framebuffer& Framebuffer::mapForDraw(std::initializer_list<std::pair<UnsignedInt
for(const auto& attachment: attachments)
_attachments[attachment.first] = GLenum(attachment.second);
(this->*Context::current()->state().framebuffer->drawBuffersImplementation)(max+1, _attachments);
(this->*Context::current().state().framebuffer->drawBuffersImplementation)(max+1, _attachments);
return *this;
}
Framebuffer& Framebuffer::mapForDraw(const DrawAttachment attachment) {
#ifndef MAGNUM_TARGET_GLES
(this->*Context::current()->state().framebuffer->drawBufferImplementation)(GLenum(attachment));
(this->*Context::current().state().framebuffer->drawBufferImplementation)(GLenum(attachment));
#else
(this->*Context::current()->state().framebuffer->drawBuffersImplementation)(1, reinterpret_cast<const GLenum*>(&attachment));
(this->*Context::current().state().framebuffer->drawBuffersImplementation)(1, reinterpret_cast<const GLenum*>(&attachment));
#endif
return *this;
}
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
Framebuffer& Framebuffer::mapForRead(const ColorAttachment attachment) {
(this->*Context::current()->state().framebuffer->readBufferImplementation)(GLenum(attachment));
(this->*Context::current().state().framebuffer->readBufferImplementation)(GLenum(attachment));
return *this;
}
@ -190,7 +190,7 @@ void Framebuffer::invalidate(std::initializer_list<InvalidationAttachment> attac
for(std::size_t i = 0; i != attachments.size(); ++i)
_attachments[i] = GLenum(*(attachments.begin()+i));
(this->*Context::current()->state().framebuffer->invalidateImplementation)(attachments.size(), _attachments);
(this->*Context::current().state().framebuffer->invalidateImplementation)(attachments.size(), _attachments);
}
#ifndef MAGNUM_TARGET_GLES2
@ -200,116 +200,116 @@ void Framebuffer::invalidate(std::initializer_list<InvalidationAttachment> attac
for(std::size_t i = 0; i != attachments.size(); ++i)
_attachments[i] = GLenum(*(attachments.begin()+i));
(this->*Context::current()->state().framebuffer->invalidateSubImplementation)(attachments.size(), _attachments, rectangle);
(this->*Context::current().state().framebuffer->invalidateSubImplementation)(attachments.size(), _attachments, rectangle);
}
#endif
#endif
Framebuffer& Framebuffer::attachRenderbuffer(const BufferAttachment attachment, Renderbuffer& renderbuffer) {
(this->*Context::current()->state().framebuffer->renderbufferImplementation)(attachment, renderbuffer.id());
(this->*Context::current().state().framebuffer->renderbufferImplementation)(attachment, renderbuffer.id());
return *this;
}
#ifndef MAGNUM_TARGET_GLES
Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, Texture1D& texture, const Int level) {
(this->*Context::current()->state().framebuffer->texture1DImplementation)(attachment, texture.id(), level);
(this->*Context::current().state().framebuffer->texture1DImplementation)(attachment, texture.id(), level);
return *this;
}
#endif
Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, Texture2D& texture, const Int level) {
(this->*Context::current()->state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_2D, texture.id(), level);
(this->*Context::current().state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_2D, texture.id(), level);
return *this;
}
#ifndef MAGNUM_TARGET_GLES
Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, RectangleTexture& texture) {
(this->*Context::current()->state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_RECTANGLE, texture.id(), 0);
(this->*Context::current().state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_RECTANGLE, texture.id(), 0);
return *this;
}
#endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
Framebuffer& Framebuffer::attachTexture(const BufferAttachment attachment, MultisampleTexture2D& texture) {
(this->*Context::current()->state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_2D_MULTISAMPLE, texture.id(), 0);
(this->*Context::current().state().framebuffer->texture2DImplementation)(attachment, GL_TEXTURE_2D_MULTISAMPLE, texture.id(), 0);
return *this;
}
#endif
Framebuffer& Framebuffer::attachCubeMapTexture(const BufferAttachment attachment, CubeMapTexture& texture, CubeMapTexture::Coordinate coordinate, const Int level) {
(this->*Context::current()->state().framebuffer->textureCubeMapImplementation)(attachment, GLenum(coordinate), texture.id(), level);
(this->*Context::current().state().framebuffer->textureCubeMapImplementation)(attachment, GLenum(coordinate), texture.id(), level);
return *this;
}
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
Framebuffer& Framebuffer::attachTextureLayer(const BufferAttachment attachment, Texture3D& texture, Int level, Int layer) {
(this->*Context::current()->state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer);
(this->*Context::current().state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer);
return *this;
}
#endif
#ifndef MAGNUM_TARGET_GLES
Framebuffer& Framebuffer::attachTextureLayer(const BufferAttachment attachment, Texture1DArray& texture, Int level, Int layer) {
(this->*Context::current()->state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer);
(this->*Context::current().state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer);
return *this;
}
#endif
#ifndef MAGNUM_TARGET_GLES2
Framebuffer& Framebuffer::attachTextureLayer(const BufferAttachment attachment, Texture2DArray& texture, Int level, Int layer) {
(this->*Context::current()->state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer);
(this->*Context::current().state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer);
return *this;
}
#endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
Framebuffer& Framebuffer::attachTextureLayer(const BufferAttachment attachment, CubeMapTextureArray& texture, Int level, Int layer) {
(this->*Context::current()->state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer);
(this->*Context::current().state().framebuffer->textureLayerImplementation)(attachment, texture.id(), level, layer);
return *this;
}
Framebuffer& Framebuffer::attachTextureLayer(const BufferAttachment attachment, MultisampleTexture2DArray& texture, Int layer) {
(this->*Context::current()->state().framebuffer->textureLayerImplementation)(attachment, texture.id(), 0, layer);
(this->*Context::current().state().framebuffer->textureLayerImplementation)(attachment, texture.id(), 0, layer);
return *this;
}
#endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
Framebuffer& Framebuffer::attachLayeredTexture(const BufferAttachment attachment, Texture3D& texture, const Int level) {
(this->*Context::current()->state().framebuffer->textureImplementation)(attachment, texture.id(), level);
(this->*Context::current().state().framebuffer->textureImplementation)(attachment, texture.id(), level);
return *this;
}
#ifndef MAGNUM_TARGET_GLES
Framebuffer& Framebuffer::attachLayeredTexture(const BufferAttachment attachment, Texture1DArray& texture, const Int level) {
(this->*Context::current()->state().framebuffer->textureImplementation)(attachment, texture.id(), level);
(this->*Context::current().state().framebuffer->textureImplementation)(attachment, texture.id(), level);
return *this;
}
#endif
Framebuffer& Framebuffer::attachLayeredTexture(const BufferAttachment attachment, Texture2DArray& texture, const Int level) {
(this->*Context::current()->state().framebuffer->textureImplementation)(attachment, texture.id(), level);
(this->*Context::current().state().framebuffer->textureImplementation)(attachment, texture.id(), level);
return *this;
}
Framebuffer& Framebuffer::attachLayeredTexture(const BufferAttachment attachment, CubeMapTexture& texture, const Int level) {
(this->*Context::current()->state().framebuffer->textureImplementation)(attachment, texture.id(), level);
(this->*Context::current().state().framebuffer->textureImplementation)(attachment, texture.id(), level);
return *this;
}
Framebuffer& Framebuffer::attachLayeredTexture(const BufferAttachment attachment, CubeMapTextureArray& texture, const Int level) {
(this->*Context::current()->state().framebuffer->textureImplementation)(attachment, texture.id(), level);
(this->*Context::current().state().framebuffer->textureImplementation)(attachment, texture.id(), level);
return *this;
}
Framebuffer& Framebuffer::attachLayeredTexture(const BufferAttachment attachment, MultisampleTexture2DArray& texture) {
(this->*Context::current()->state().framebuffer->textureImplementation)(attachment, texture.id(), 0);
(this->*Context::current().state().framebuffer->textureImplementation)(attachment, texture.id(), 0);
return *this;
}
#endif
Framebuffer& Framebuffer::detach(const BufferAttachment attachment) {
(this->*Context::current()->state().framebuffer->renderbufferImplementation)(attachment, 0);
(this->*Context::current().state().framebuffer->renderbufferImplementation)(attachment, 0);
return *this;
}

4
src/Magnum/Implementation/driverSpecific.cpp

@ -83,7 +83,7 @@ bool isShaderCompilationLogEmpty(const std::string&);
bool isShaderCompilationLogEmpty(const std::string& result) {
#if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_TARGET_GLES)
/* Intel Windows drivers are too chatty */
if((Context::current()->detectedDriver() & Context::DetectedDriver::IntelWindows) && result == "No errors.\n")
if((Context::current()detectedDriver() & Context::DetectedDriver::IntelWindows) && result == "No errors.\n")
return true;
#else
static_cast<void>(result);
@ -97,7 +97,7 @@ bool isProgramLinkLogEmpty(const std::string&);
bool isProgramLinkLogEmpty(const std::string& result) {
#if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_TARGET_GLES)
/* Intel Windows drivers are too chatty */
if((Context::current()->detectedDriver() & Context::DetectedDriver::IntelWindows) && result == "No errors.\n")
if((Context::current()detectedDriver() & Context::DetectedDriver::IntelWindows) && result == "No errors.\n")
return true;
#else
static_cast<void>(result);

8
src/Magnum/Implementation/maxTextureSize.cpp

@ -33,7 +33,7 @@
namespace Magnum { namespace Implementation {
GLint maxTextureSideSize() {
GLint& value = Context::current()->state().texture->maxSize;
GLint& value = Context::current().state().texture->maxSize;
if(value == 0)
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
@ -43,7 +43,7 @@ GLint maxTextureSideSize() {
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
GLint max3DTextureDepth() {
GLint& value = Context::current()->state().texture->max3DSize;
GLint& value = Context::current().state().texture->max3DSize;
if(value == 0)
#ifndef MAGNUM_TARGET_GLES2
@ -58,7 +58,7 @@ GLint max3DTextureDepth() {
#ifndef MAGNUM_TARGET_GLES2
GLint maxTextureArrayLayers() {
GLint& value = Context::current()->state().texture->maxArrayLayers;
GLint& value = Context::current().state().texture->maxArrayLayers;
if(value == 0)
glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &value);
@ -68,7 +68,7 @@ GLint maxTextureArrayLayers() {
#endif
GLint maxCubeMapTextureSideSize() {
GLint& value = Context::current()->state().texture->maxCubeMapSize;
GLint& value = Context::current().state().texture->maxCubeMapSize;
if(value == 0)
glGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &value);

36
src/Magnum/Mesh.cpp

@ -68,7 +68,7 @@ Int Mesh::maxElementIndex()
#endif
{
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::ES3_compatibility>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::ES3_compatibility>())
return 0xFFFFFFFFl;
#endif
@ -77,7 +77,7 @@ Int Mesh::maxElementIndex()
#else
GLint& value =
#endif
Context::current()->state().mesh->maxElementIndex;
Context::current().state().mesh->maxElementIndex;
/* Get the value, if not already cached */
if(value == 0) {
@ -92,7 +92,7 @@ Int Mesh::maxElementIndex()
}
Int Mesh::maxElementsIndices() {
GLint& value = Context::current()->state().mesh->maxElementsIndices;
GLint& value = Context::current().state().mesh->maxElementsIndices;
/* Get the value, if not already cached */
if(value == 0)
@ -102,7 +102,7 @@ Int Mesh::maxElementsIndices() {
}
Int Mesh::maxElementsVertices() {
GLint& value = Context::current()->state().mesh->maxElementsVertices;
GLint& value = Context::current().state().mesh->maxElementsVertices;
/* Get the value, if not already cached */
if(value == 0)
@ -131,7 +131,7 @@ Mesh::Mesh(const MeshPrimitive primitive): _primitive{primitive}, _flags{ObjectF
#endif
_indexOffset(0), _indexType(IndexType::UnsignedInt), _indexBuffer(nullptr)
{
(this->*Context::current()->state().mesh->createImplementation)();
(this->*Context::current().state().mesh->createImplementation)();
}
Mesh::Mesh(NoCreateT) noexcept: _id{0}, _primitive{MeshPrimitive::Triangles}, _flags{ObjectFlag::DeleteOnDestruction}, _count{0}, _baseVertex{0}, _instanceCount{1},
@ -148,10 +148,10 @@ Mesh::~Mesh() {
if(!_id || !(_flags & ObjectFlag::DeleteOnDestruction)) return;
/* Remove current vao from the state */
GLuint& current = Context::current()->state().mesh->currentVAO;
GLuint& current = Context::current().state().mesh->currentVAO;
if(current == _id) current = 0;
(this->*Context::current()->state().mesh->destroyImplementation)();
(this->*Context::current().state().mesh->destroyImplementation)();
}
Mesh::Mesh(Mesh&& other) noexcept: _id(other._id), _primitive(other._primitive), _flags{other._flags}, _count(other._count), _baseVertex{other._baseVertex}, _instanceCount{other._instanceCount},
@ -207,18 +207,18 @@ inline void Mesh::createIfNotAlready() {
std::string Mesh::label() {
createIfNotAlready();
#ifndef MAGNUM_TARGET_GLES
return Context::current()->state().debug->getLabelImplementation(GL_VERTEX_ARRAY, _id);
return Context::current().state().debug->getLabelImplementation(GL_VERTEX_ARRAY, _id);
#else
return Context::current()->state().debug->getLabelImplementation(GL_VERTEX_ARRAY_KHR, _id);
return Context::current().state().debug->getLabelImplementation(GL_VERTEX_ARRAY_KHR, _id);
#endif
}
Mesh& Mesh::setLabelInternal(const Containers::ArrayView<const char> label) {
createIfNotAlready();
#ifndef MAGNUM_TARGET_GLES
Context::current()->state().debug->labelImplementation(GL_VERTEX_ARRAY, _id, label);
Context::current().state().debug->labelImplementation(GL_VERTEX_ARRAY, _id, label);
#else
Context::current()->state().debug->labelImplementation(GL_VERTEX_ARRAY_KHR, _id, label);
Context::current().state().debug->labelImplementation(GL_VERTEX_ARRAY_KHR, _id, label);
#endif
return *this;
}
@ -240,7 +240,7 @@ Mesh& Mesh::setIndexBuffer(Buffer& buffer, GLintptr offset, IndexType type, Unsi
static_cast<void>(start);
static_cast<void>(end);
#endif
(this->*Context::current()->state().mesh->bindIndexBufferImplementation)(buffer);
(this->*Context::current().state().mesh->bindIndexBufferImplementation)(buffer);
return *this;
}
@ -264,7 +264,7 @@ void Mesh::drawInternal(Int count, Int baseVertex, Int instanceCount, GLintptr i
void Mesh::drawInternal(Int count, Int baseVertex, Int instanceCount, GLintptr indexOffset)
#endif
{
const Implementation::MeshState& state = *Context::current()->state().mesh;
const Implementation::MeshState& state = *Context::current().state().mesh;
/* Nothing to draw */
if(!count || !instanceCount) return;
@ -364,7 +364,7 @@ void Mesh::drawInternal(Int count, Int baseVertex, Int instanceCount, GLintptr i
}
void Mesh::bindVAO() {
GLuint& current = Context::current()->state().mesh->currentVAO;
GLuint& current = Context::current().state().mesh->currentVAO;
if(current != _id) {
/* Binding the VAO finally creates it */
_flags |= ObjectFlag::Created;
@ -419,7 +419,7 @@ void Mesh::attributePointerInternal(const Buffer& buffer, const GLuint location,
}
void Mesh::attributePointerInternal(AttributeLayout& attribute) {
(this->*Context::current()->state().mesh->attributePointerImplementation)(attribute);
(this->*Context::current().state().mesh->attributePointerImplementation)(attribute);
}
void Mesh::attributePointerImplementationDefault(AttributeLayout& attribute) {
@ -460,7 +460,7 @@ void Mesh::attributePointerImplementationDSAEXT(AttributeLayout& attribute) {
}
if(attribute.divisor)
(this->*Context::current()->state().mesh->vertexAttribDivisorImplementation)(attribute.location, attribute.divisor);
(this->*Context::current().state().mesh->vertexAttribDivisorImplementation)(attribute.location, attribute.divisor);
}
#endif
@ -485,7 +485,7 @@ void Mesh::vertexAttribPointer(AttributeLayout& attribute) {
#ifndef MAGNUM_TARGET_GLES2
glVertexAttribDivisor(attribute.location, attribute.divisor);
#else
(this->*Context::current()->state().mesh->vertexAttribDivisorImplementation)(attribute.location, attribute.divisor);
(this->*Context::current().state().mesh->vertexAttribDivisorImplementation)(attribute.location, attribute.divisor);
#endif
}
}
@ -537,7 +537,7 @@ void Mesh::bindIndexBufferImplementationVAO(Buffer& buffer) {
/* Reset ElementArray binding to force explicit glBindBuffer call later */
/** @todo Do this cleaner way */
Context::current()->state().buffer->bindings[Implementation::BufferState::indexForTarget(Buffer::TargetHint::ElementArray)] = 0;
Context::current().state().buffer->bindings[Implementation::BufferState::indexForTarget(Buffer::TargetHint::ElementArray)] = 0;
buffer.bindInternal(Buffer::TargetHint::ElementArray);
}

2
src/Magnum/MeshTools/FullScreenTriangle.cpp

@ -62,7 +62,7 @@ std::pair<std::unique_ptr<Buffer>, Mesh> fullScreenTriangle(Version version) {
}
std::pair<std::unique_ptr<Buffer>, Mesh> fullScreenTriangle() {
return fullScreenTriangle(Context::current()->version());
return fullScreenTriangle(Context::current().version());
}
}}

4
src/Magnum/MeshView.cpp

@ -52,7 +52,7 @@ void MeshView::draw(AbstractShaderProgram& shader, std::initializer_list<std::re
#ifndef MAGNUM_TARGET_GLES
multiDrawImplementationDefault(meshes);
#else
Context::current()->state().mesh->multiDrawImplementation(meshes);
Context::current().state().mesh->multiDrawImplementation(meshes);
#endif
}
@ -60,7 +60,7 @@ void MeshView::draw(AbstractShaderProgram& shader, std::initializer_list<std::re
void MeshView::multiDrawImplementationDefault(std::initializer_list<std::reference_wrapper<MeshView>> meshes) {
CORRADE_INTERNAL_ASSERT(meshes.size());
const Implementation::MeshState& state = *Context::current()->state().mesh;
const Implementation::MeshState& state = *Context::current().state().mesh;
Mesh& original = meshes.begin()->get()._original;
Containers::Array<GLsizei> count{meshes.size()};

8
src/Magnum/MultisampleTexture.cpp

@ -35,9 +35,9 @@ namespace Magnum { namespace Implementation {
template<> Vector2i MAGNUM_EXPORT maxMultisampleTextureSize<2>() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return Vector2i{0};
@ -46,10 +46,10 @@ template<> Vector2i MAGNUM_EXPORT maxMultisampleTextureSize<2>() {
template<> Vector3i MAGNUM_EXPORT maxMultisampleTextureSize<3>() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
return Vector3i{0};
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
return Vector3i{0};
#endif

10
src/Magnum/PixelStorage.cpp

@ -194,8 +194,8 @@ std::tuple<std::size_t, Math::Vector3<std::size_t>, std::size_t> CompressedPixel
void PixelStorage::applyInternal(const bool isUnpack) {
Implementation::RendererState::PixelStorage& state = isUnpack ?
Context::current()->state().renderer->unpackPixelStorage :
Context::current()->state().renderer->packPixelStorage;
Context::current().state().renderer->unpackPixelStorage :
Context::current().state().renderer->packPixelStorage;
#ifndef MAGNUM_TARGET_GLES
/* Byte swap */
@ -256,7 +256,7 @@ void PixelStorage::applyUnpack() {
applyInternal(true);
#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2)
Implementation::RendererState::PixelStorage& state = Context::current()->state().renderer->unpackPixelStorage;
Implementation::RendererState::PixelStorage& state = Context::current().state().renderer->unpackPixelStorage;
/* Image height (on ES for unpack only) */
if(state.imageHeight == Implementation::RendererState::PixelStorage::DisengagedValue || state.imageHeight != _imageHeight)
@ -273,8 +273,8 @@ void CompressedPixelStorage::applyInternal(const bool isUnpack) {
PixelStorage::applyInternal(isUnpack);
Implementation::RendererState::PixelStorage& state = isUnpack ?
Context::current()->state().renderer->unpackPixelStorage :
Context::current()->state().renderer->packPixelStorage;
Context::current().state().renderer->unpackPixelStorage :
Context::current().state().renderer->packPixelStorage;
/* Compressed block width */
if(state.compressedBlockSize.x() == Implementation::RendererState::PixelStorage::DisengagedValue || state.compressedBlockSize.x() != _blockSize.x())

66
src/Magnum/Platform/magnum-info.cpp

@ -236,7 +236,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
/* Create context here, so the context creation info is displayed at proper
place */
createContext();
Context* c = Context::current();
Context& c = Context::current();
Debug() << "Context flags:";
#ifndef MAGNUM_TARGET_GLES
@ -244,10 +244,10 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
#else
for(const auto flag: {Context::Flag::Debug})
#endif
if(c->flags() & flag) Debug() << " " << flag;
if(c.flags() & flag) Debug() << " " << flag;
Debug() << "Supported GLSL versions:";
const std::vector<std::string> shadingLanguageVersions = c->shadingLanguageVersionStrings();
const std::vector<std::string> shadingLanguageVersions = c.shadingLanguageVersionStrings();
for(const auto& version: shadingLanguageVersions)
Debug() << " " << version;
@ -279,7 +279,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
std::size_t future = 0;
if(!args.isSet("all-extensions"))
while(versions[future] != Version::None && c->isVersionSupported(versions[future]))
while(versions[future] != Version::None && c.isVersionSupported(versions[future]))
++future;
/* Display supported OpenGL extensions from unsupported versions */
@ -292,11 +292,11 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
std::string extensionName = extension.string();
Debug d;
d << " " << extensionName << std::string(60-extensionName.size(), ' ');
if(c->isExtensionSupported(extension))
if(c.isExtensionSupported(extension))
d << "SUPPORTED";
else if(c->isExtensionDisabled(extension))
else if(c.isExtensionDisabled(extension))
d << " removed";
else if(c->isVersionSupported(extension.requiredVersion()))
else if(c.isVersionSupported(extension.requiredVersion()))
d << " -";
else
d << " n/a";
@ -356,7 +356,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
_lvec(CubeMapTexture::maxSize())
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::ARB::blend_func_extended>()) {
if(c.isExtensionSupported<Extensions::GL::ARB::blend_func_extended>()) {
_h(ARB::blend_func_extended)
_l(AbstractFramebuffer::maxDualSourceDrawBuffers())
@ -365,7 +365,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
#ifndef MAGNUM_TARGET_GLES2
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::ARB::compute_shader>())
if(c.isExtensionSupported<Extensions::GL::ARB::compute_shader>())
#endif
{
#ifndef MAGNUM_TARGET_GLES
@ -377,7 +377,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
}
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>())
if(c.isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>())
#endif
{
#ifndef MAGNUM_TARGET_GLES
@ -390,7 +390,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
#ifndef MAGNUM_TARGET_GLES2
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>())
if(c.isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>())
#endif
{
#ifndef MAGNUM_TARGET_GLES
@ -416,7 +416,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
}
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::ARB::shader_image_load_store>())
if(c.isExtensionSupported<Extensions::GL::ARB::shader_image_load_store>())
#endif
{
#ifndef MAGNUM_TARGET_GLES
@ -438,7 +438,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
}
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::ARB::shader_storage_buffer_object>())
if(c.isExtensionSupported<Extensions::GL::ARB::shader_storage_buffer_object>())
#endif
{
#ifndef MAGNUM_TARGET_GLES
@ -459,7 +459,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
#ifndef MAGNUM_TARGET_GLES2
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(c.isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
#endif
{
#ifndef MAGNUM_TARGET_GLES
@ -475,7 +475,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
#endif
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>()) {
if(c.isExtensionSupported<Extensions::GL::ARB::texture_rectangle>()) {
_h(ARB::texture_rectangle)
_lvec(RectangleTexture::maxSize())
@ -484,7 +484,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
#ifndef MAGNUM_TARGET_GLES2
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>())
if(c.isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>())
#endif
{
#ifndef MAGNUM_TARGET_GLES
@ -509,7 +509,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
}
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
if(c.isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
#endif
{
#ifndef MAGNUM_TARGET_GLES
@ -522,7 +522,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
}
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(c.isExtensionSupported<Extensions::GL::EXT::texture_array>())
#endif
{
#ifndef MAGNUM_TARGET_GLES
@ -538,7 +538,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
#ifndef MAGNUM_TARGET_GLES2
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::EXT::transform_feedback>())
if(c.isExtensionSupported<Extensions::GL::EXT::transform_feedback>())
#endif
{
#ifndef MAGNUM_TARGET_GLES
@ -552,7 +552,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
#endif
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::ARB::transform_feedback3>()) {
if(c.isExtensionSupported<Extensions::GL::ARB::transform_feedback3>()) {
_h(ARB::transform_feedback3)
_l(TransformFeedback::maxBuffers())
@ -561,9 +561,9 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
if(c.isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
#else
if(c->isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
if(c.isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
#endif
{
#ifndef MAGNUM_TARGET_GLES
@ -580,9 +580,9 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::ARB::tessellation_shader>())
if(c.isExtensionSupported<Extensions::GL::ARB::tessellation_shader>())
#else
if(c->isExtensionSupported<Extensions::GL::EXT::tessellation_shader>())
if(c.isExtensionSupported<Extensions::GL::EXT::tessellation_shader>())
#endif
{
#ifndef MAGNUM_TARGET_GLES
@ -603,9 +603,9 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>())
if(c.isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>())
#else
if(c->isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
if(c.isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
#endif
{
#ifndef MAGNUM_TARGET_GLES
@ -618,9 +618,9 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
}
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::ARB::texture_buffer_range>())
if(c.isExtensionSupported<Extensions::GL::ARB::texture_buffer_range>())
#else
if(c->isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
if(c.isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
#endif
{
#ifndef MAGNUM_TARGET_GLES
@ -633,9 +633,9 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
}
#ifndef MAGNUM_TARGET_GLES
if(c->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(c.isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
#else
if(c->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(c.isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
#endif
{
#ifndef MAGNUM_TARGET_GLES
@ -648,13 +648,13 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
}
#endif
if(c->isExtensionSupported<Extensions::GL::EXT::texture_filter_anisotropic>()) {
if(c.isExtensionSupported<Extensions::GL::EXT::texture_filter_anisotropic>()) {
_h(EXT::texture_filter_anisotropic)
_l(Sampler::maxMaxAnisotropy())
}
if(c->isExtensionSupported<Extensions::GL::KHR::debug>()) {
if(c.isExtensionSupported<Extensions::GL::KHR::debug>()) {
_h(KHR::debug)
_l(AbstractObject::maxLabelLength())
@ -664,7 +664,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
}
#ifdef MAGNUM_TARGET_GLES2
if(c->isExtensionSupported<Extensions::GL::OES::texture_3D>()) {
if(c.isExtensionSupported<Extensions::GL::OES::texture_3D>()) {
_h(OES::texture_3D)
_lvec(Texture3D::maxSize())

4
src/Magnum/RectangleTexture.cpp

@ -37,10 +37,10 @@
namespace Magnum {
Vector2i RectangleTexture::maxSize() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
return {};
GLint& value = Context::current()->state().texture->maxRectangleSize;
GLint& value = Context::current().state().texture->maxRectangleSize;
if(value == 0)
glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE, &value);

20
src/Magnum/Renderbuffer.cpp

@ -37,7 +37,7 @@
namespace Magnum {
Int Renderbuffer::maxSize() {
GLint& value = Context::current()->state().framebuffer->maxRenderbufferSize;
GLint& value = Context::current().state().framebuffer->maxRenderbufferSize;
/* Get the value, if not already cached */
if(value == 0)
@ -49,11 +49,11 @@ Int Renderbuffer::maxSize() {
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
Int Renderbuffer::maxSamples() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::ANGLE::framebuffer_multisample>() && !Context::current()->isExtensionSupported<Extensions::GL::NV::framebuffer_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ANGLE::framebuffer_multisample>() && !Context::current().isExtensionSupported<Extensions::GL::NV::framebuffer_multisample>())
return 0;
#endif
GLint& value = Context::current()->state().framebuffer->maxSamples;
GLint& value = Context::current().state().framebuffer->maxSamples;
/* Get the value, if not already cached */
if(value == 0) {
@ -69,7 +69,7 @@ Int Renderbuffer::maxSamples() {
#endif
Renderbuffer::Renderbuffer(): _flags{ObjectFlag::DeleteOnDestruction} {
(this->*Context::current()->state().framebuffer->createRenderbufferImplementation)();
(this->*Context::current().state().framebuffer->createRenderbufferImplementation)();
}
void Renderbuffer::createImplementationDefault() {
@ -88,7 +88,7 @@ Renderbuffer::~Renderbuffer() {
if(!_id || !(_flags & ObjectFlag::DeleteOnDestruction)) return;
/* If bound, remove itself from state */
GLuint& binding = Context::current()->state().framebuffer->renderbufferBinding;
GLuint& binding = Context::current().state().framebuffer->renderbufferBinding;
if(binding == _id) binding = 0;
glDeleteRenderbuffers(1, &_id);
@ -108,28 +108,28 @@ inline void Renderbuffer::createIfNotAlready() {
#ifndef MAGNUM_TARGET_WEBGL
std::string Renderbuffer::label() {
createIfNotAlready();
return Context::current()->state().debug->getLabelImplementation(GL_RENDERBUFFER, _id);
return Context::current().state().debug->getLabelImplementation(GL_RENDERBUFFER, _id);
}
Renderbuffer& Renderbuffer::setLabelInternal(const Containers::ArrayView<const char> label) {
createIfNotAlready();
Context::current()->state().debug->labelImplementation(GL_RENDERBUFFER, _id, label);
Context::current().state().debug->labelImplementation(GL_RENDERBUFFER, _id, label);
return *this;
}
#endif
void Renderbuffer::setStorage(const RenderbufferFormat internalFormat, const Vector2i& size) {
(this->*Context::current()->state().framebuffer->renderbufferStorageImplementation)(internalFormat, size);
(this->*Context::current().state().framebuffer->renderbufferStorageImplementation)(internalFormat, size);
}
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
void Renderbuffer::setStorageMultisample(const Int samples, const RenderbufferFormat internalFormat, const Vector2i& size) {
(this->*Context::current()->state().framebuffer->renderbufferStorageMultisampleImplementation)(samples, internalFormat, size);
(this->*Context::current().state().framebuffer->renderbufferStorageMultisampleImplementation)(samples, internalFormat, size);
}
#endif
void Renderbuffer::bind() {
GLuint& binding = Context::current()->state().framebuffer->renderbufferBinding;
GLuint& binding = Context::current().state().framebuffer->renderbufferBinding;
if(binding == _id) return;

10
src/Magnum/Renderer.cpp

@ -62,7 +62,7 @@ void Renderer::setClearDepth(const Double depth) {
#endif
void Renderer::setClearDepth(Float depth) {
Context::current()->state().renderer->clearDepthfImplementation(depth);
Context::current().state().renderer->clearDepthfImplementation(depth);
}
void Renderer::setClearStencil(const Int stencil) {
@ -182,13 +182,13 @@ void Renderer::setLogicOperation(const LogicOperation operation) {
#ifndef MAGNUM_TARGET_WEBGL
Renderer::ResetNotificationStrategy Renderer::resetNotificationStrategy() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::robustness>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::robustness>())
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::robustness>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::robustness>())
#endif
return ResetNotificationStrategy::NoResetNotification;
ResetNotificationStrategy& strategy = Context::current()->state().renderer->resetNotificationStrategy;
ResetNotificationStrategy& strategy = Context::current().state().renderer->resetNotificationStrategy;
if(strategy == ResetNotificationStrategy()) {
#ifndef MAGNUM_TARGET_GLES
@ -202,7 +202,7 @@ Renderer::ResetNotificationStrategy Renderer::resetNotificationStrategy() {
}
Renderer::GraphicsResetStatus Renderer::graphicsResetStatus() {
return Context::current()->state().renderer->graphicsResetStatusImplementation();
return Context::current().state().renderer->graphicsResetStatusImplementation();
}
#endif

4
src/Magnum/Sampler.cpp

@ -48,10 +48,10 @@ static_assert((filter_or(Nearest, Base) == GL_NEAREST) &&
#undef filter_or
Float Sampler::maxMaxAnisotropy() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_filter_anisotropic>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_filter_anisotropic>())
return 0.0f;
GLfloat& value = Context::current()->state().texture->maxMaxAnisotropy;
GLfloat& value = Context::current().state().texture->maxMaxAnisotropy;
/* Get the value, if not already cached */
if(value == 0.0f)

142
src/Magnum/Shader.cpp

@ -89,26 +89,26 @@ UnsignedInt typeToIndex(const Shader::Type type) {
#ifndef MAGNUM_TARGET_GLES
bool isTypeSupported(const Shader::Type type) {
if(type == Shader::Type::Geometry && !Context::current()->isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
if(type == Shader::Type::Geometry && !Context::current().isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
return false;
if((type == Shader::Type::TessellationControl || type == Shader::Type::TessellationEvaluation) && !Context::current()->isExtensionSupported<Extensions::GL::ARB::tessellation_shader>())
if((type == Shader::Type::TessellationControl || type == Shader::Type::TessellationEvaluation) && !Context::current().isExtensionSupported<Extensions::GL::ARB::tessellation_shader>())
return false;
if(type == Shader::Type::Compute && !Context::current()->isExtensionSupported<Extensions::GL::ARB::compute_shader>())
if(type == Shader::Type::Compute && !Context::current().isExtensionSupported<Extensions::GL::ARB::compute_shader>())
return false;
return true;
}
#elif !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
bool isTypeSupported(const Shader::Type type) {
if(type == Shader::Type::Geometry && !Context::current()->isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
if(type == Shader::Type::Geometry && !Context::current().isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
return false;
if((type == Shader::Type::TessellationControl || type == Shader::Type::TessellationEvaluation) && !Context::current()->isExtensionSupported<Extensions::GL::EXT::tessellation_shader>())
if((type == Shader::Type::TessellationControl || type == Shader::Type::TessellationEvaluation) && !Context::current().isExtensionSupported<Extensions::GL::EXT::tessellation_shader>())
return false;
if(type == Shader::Type::Compute && !Context::current()->isVersionSupported(Version::GLES310))
if(type == Shader::Type::Compute && !Context::current().isVersionSupported(Version::GLES310))
return false;
return true;
@ -120,12 +120,12 @@ constexpr bool isTypeSupported(Shader::Type) { return true; }
}
Int Shader::maxVertexOutputComponents() {
GLint& value = Context::current()->state().shader->maxVertexOutputComponents;
GLint& value = Context::current().state().shader->maxVertexOutputComponents;
/* Get the value, if not already cached */
if(value == 0) {
#ifndef MAGNUM_TARGET_GLES
if(Context::current()->isVersionSupported(Version::GL320))
if(Context::current().isVersionSupported(Version::GL320))
glGetIntegerv(GL_MAX_VERTEX_OUTPUT_COMPONENTS, &value);
else
glGetIntegerv(GL_MAX_VARYING_COMPONENTS, &value);
@ -143,14 +143,14 @@ Int Shader::maxVertexOutputComponents() {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
Int Shader::maxTessellationControlInputComponents() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::tessellation_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::tessellation_shader>())
return 0;
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::tessellation_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::tessellation_shader>())
return 0;
#endif
GLint& value = Context::current()->state().shader->maxTessellationControlInputComponents;
GLint& value = Context::current().state().shader->maxTessellationControlInputComponents;
/* Get the value, if not already cached */
if(value == 0) glGetIntegerv(
@ -166,14 +166,14 @@ Int Shader::maxTessellationControlInputComponents() {
Int Shader::maxTessellationControlOutputComponents() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::tessellation_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::tessellation_shader>())
return 0;
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::tessellation_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::tessellation_shader>())
return 0;
#endif
GLint& value = Context::current()->state().shader->maxTessellationControlOutputComponents;
GLint& value = Context::current().state().shader->maxTessellationControlOutputComponents;
/* Get the value, if not already cached */
if(value == 0) glGetIntegerv(
@ -189,14 +189,14 @@ Int Shader::maxTessellationControlOutputComponents() {
Int Shader::maxTessellationControlTotalOutputComponents() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::tessellation_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::tessellation_shader>())
return 0;
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::tessellation_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::tessellation_shader>())
return 0;
#endif
GLint& value = Context::current()->state().shader->maxTessellationControlTotalOutputComponents;
GLint& value = Context::current().state().shader->maxTessellationControlTotalOutputComponents;
/* Get the value, if not already cached */
if(value == 0) glGetIntegerv(
@ -212,14 +212,14 @@ Int Shader::maxTessellationControlTotalOutputComponents() {
Int Shader::maxTessellationEvaluationInputComponents() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::tessellation_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::tessellation_shader>())
return 0;
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::tessellation_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::tessellation_shader>())
return 0;
#endif
GLint& value = Context::current()->state().shader->maxTessellationEvaluationInputComponents;
GLint& value = Context::current().state().shader->maxTessellationEvaluationInputComponents;
/* Get the value, if not already cached */
if(value == 0) glGetIntegerv(
@ -235,14 +235,14 @@ Int Shader::maxTessellationEvaluationInputComponents() {
Int Shader::maxTessellationEvaluationOutputComponents() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::tessellation_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::tessellation_shader>())
return 0;
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::tessellation_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::tessellation_shader>())
return 0;
#endif
GLint& value = Context::current()->state().shader->maxTessellationEvaluationOutputComponents;
GLint& value = Context::current().state().shader->maxTessellationEvaluationOutputComponents;
/* Get the value, if not already cached */
if(value == 0) glGetIntegerv(
@ -258,14 +258,14 @@ Int Shader::maxTessellationEvaluationOutputComponents() {
Int Shader::maxGeometryInputComponents() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
return 0;
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
return 0;
#endif
GLint& value = Context::current()->state().shader->maxGeometryInputComponents;
GLint& value = Context::current().state().shader->maxGeometryInputComponents;
/* Get the value, if not already cached */
/** @todo The extension has only `GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB`, this is supported since GL 3.2 (wtf?) */
@ -282,14 +282,14 @@ Int Shader::maxGeometryInputComponents() {
Int Shader::maxGeometryOutputComponents() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
return 0;
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
return 0;
#endif
GLint& value = Context::current()->state().shader->maxGeometryOutputComponents;
GLint& value = Context::current().state().shader->maxGeometryOutputComponents;
/* Get the value, if not already cached */
/** @todo The extension has only `GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB`, this is supported since GL 3.2 (wtf?) */
@ -306,14 +306,14 @@ Int Shader::maxGeometryOutputComponents() {
Int Shader::maxGeometryTotalOutputComponents() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
return 0;
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
return 0;
#endif
GLint& value = Context::current()->state().shader->maxGeometryTotalOutputComponents;
GLint& value = Context::current().state().shader->maxGeometryTotalOutputComponents;
/* Get the value, if not already cached */
if(value == 0) glGetIntegerv(
@ -329,12 +329,12 @@ Int Shader::maxGeometryTotalOutputComponents() {
#endif
Int Shader::maxFragmentInputComponents() {
GLint& value = Context::current()->state().shader->maxFragmentInputComponents;
GLint& value = Context::current().state().shader->maxFragmentInputComponents;
/* Get the value, if not already cached */
if(value == 0) {
#ifndef MAGNUM_TARGET_GLES
if(Context::current()->isVersionSupported(Version::GL320))
if(Context::current().isVersionSupported(Version::GL320))
glGetIntegerv(GL_MAX_FRAGMENT_INPUT_COMPONENTS, &value);
else
glGetIntegerv(GL_MAX_VARYING_COMPONENTS, &value);
@ -353,9 +353,9 @@ Int Shader::maxFragmentInputComponents() {
Int Shader::maxAtomicCounterBuffers(const Type type) {
if(
#ifndef MAGNUM_TARGET_GLES
!Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>() ||
!Context::current().isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>() ||
#else
!Context::current()->isVersionSupported(Version::GLES310) ||
!Context::current().isVersionSupported(Version::GLES310) ||
#endif
!isTypeSupported(type))
{
@ -363,7 +363,7 @@ Int Shader::maxAtomicCounterBuffers(const Type type) {
}
const UnsignedInt index = typeToIndex(type);
GLint& value = Context::current()->state().shader->maxAtomicCounterBuffers[index];
GLint& value = Context::current().state().shader->maxAtomicCounterBuffers[index];
/* Get the value, if not already cached */
constexpr static GLenum what[] = {
@ -386,13 +386,13 @@ Int Shader::maxAtomicCounterBuffers(const Type type) {
Int Shader::maxCombinedAtomicCounterBuffers() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 0;
GLint& value = Context::current()->state().shader->maxCombinedAtomicCounterBuffers;
GLint& value = Context::current().state().shader->maxCombinedAtomicCounterBuffers;
/* Get the value, if not already cached */
if(value == 0)
@ -404,9 +404,9 @@ Int Shader::maxCombinedAtomicCounterBuffers() {
Int Shader::maxAtomicCounters(const Type type) {
if(
#ifndef MAGNUM_TARGET_GLES
!Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>() ||
!Context::current().isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>() ||
#else
!Context::current()->isVersionSupported(Version::GLES310) ||
!Context::current().isVersionSupported(Version::GLES310) ||
#endif
!isTypeSupported(type))
{
@ -414,7 +414,7 @@ Int Shader::maxAtomicCounters(const Type type) {
}
const UnsignedInt index = typeToIndex(type);
GLint& value = Context::current()->state().shader->maxAtomicCounters[index];
GLint& value = Context::current().state().shader->maxAtomicCounters[index];
/* Get the value, if not already cached */
constexpr static GLenum what[] = {
@ -437,13 +437,13 @@ Int Shader::maxAtomicCounters(const Type type) {
Int Shader::maxCombinedAtomicCounters() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 0;
GLint& value = Context::current()->state().shader->maxCombinedAtomicCounters;
GLint& value = Context::current().state().shader->maxCombinedAtomicCounters;
/* Get the value, if not already cached */
if(value == 0)
@ -455,9 +455,9 @@ Int Shader::maxCombinedAtomicCounters() {
Int Shader::maxImageUniforms(const Type type) {
if(
#ifndef MAGNUM_TARGET_GLES
!Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_image_load_store>() ||
!Context::current().isExtensionSupported<Extensions::GL::ARB::shader_image_load_store>() ||
#else
!Context::current()->isVersionSupported(Version::GLES310) ||
!Context::current().isVersionSupported(Version::GLES310) ||
#endif
!isTypeSupported(type))
{
@ -465,7 +465,7 @@ Int Shader::maxImageUniforms(const Type type) {
}
const UnsignedInt index = typeToIndex(type);
GLint& value = Context::current()->state().shader->maxImageUniforms[index];
GLint& value = Context::current().state().shader->maxImageUniforms[index];
/* Get the value, if not already cached */
constexpr static GLenum what[] = {
@ -488,13 +488,13 @@ Int Shader::maxImageUniforms(const Type type) {
Int Shader::maxCombinedImageUniforms() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_image_load_store>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::shader_image_load_store>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 0;
GLint& value = Context::current()->state().shader->maxCombinedImageUniforms;
GLint& value = Context::current().state().shader->maxCombinedImageUniforms;
/* Get the value, if not already cached */
if(value == 0)
@ -506,9 +506,9 @@ Int Shader::maxCombinedImageUniforms() {
Int Shader::maxShaderStorageBlocks(const Type type) {
if(
#ifndef MAGNUM_TARGET_GLES
!Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_storage_buffer_object>() ||
!Context::current().isExtensionSupported<Extensions::GL::ARB::shader_storage_buffer_object>() ||
#else
!Context::current()->isVersionSupported(Version::GLES310) ||
!Context::current().isVersionSupported(Version::GLES310) ||
#endif
!isTypeSupported(type))
{
@ -516,7 +516,7 @@ Int Shader::maxShaderStorageBlocks(const Type type) {
}
const UnsignedInt index = typeToIndex(type);
GLint& value = Context::current()->state().shader->maxShaderStorageBlocks[index];
GLint& value = Context::current().state().shader->maxShaderStorageBlocks[index];
/* Get the value, if not already cached */
constexpr static GLenum what[] = {
@ -539,13 +539,13 @@ Int Shader::maxShaderStorageBlocks(const Type type) {
Int Shader::maxCombinedShaderStorageBlocks() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>())
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
#endif
return 0;
GLint& value = Context::current()->state().shader->maxCombinedShaderStorageBlocks;
GLint& value = Context::current().state().shader->maxCombinedShaderStorageBlocks;
/* Get the value, if not already cached */
if(value == 0)
@ -560,7 +560,7 @@ Int Shader::maxTextureImageUnits(const Type type) {
return 0;
const UnsignedInt index = typeToIndex(type);
GLint& value = Context::current()->state().shader->maxTextureImageUnits[index];
GLint& value = Context::current().state().shader->maxTextureImageUnits[index];
/* Get the value, if not already cached */
constexpr static GLenum what[] = {
@ -584,7 +584,7 @@ Int Shader::maxTextureImageUnits(const Type type) {
}
Int Shader::maxCombinedTextureImageUnits() {
GLint& value = Context::current()->state().shader->maxTextureImageUnitsCombined;
GLint& value = Context::current().state().shader->maxTextureImageUnitsCombined;
/* Get the value, if not already cached */
if(value == 0)
@ -596,14 +596,14 @@ Int Shader::maxCombinedTextureImageUnits() {
#ifndef MAGNUM_TARGET_GLES2
Int Shader::maxUniformBlocks(const Type type) {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>() || !isTypeSupported(type))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>() || !isTypeSupported(type))
#else
if(!isTypeSupported(type))
#endif
return 0;
const UnsignedInt index = typeToIndex(type);
GLint& value = Context::current()->state().shader->maxUniformBlocks[index];
GLint& value = Context::current().state().shader->maxUniformBlocks[index];
/* Get the value, if not already cached */
constexpr static GLenum what[] = {
@ -628,11 +628,11 @@ Int Shader::maxUniformBlocks(const Type type) {
Int Shader::maxCombinedUniformBlocks() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>())
return 0;
#endif
GLint& value = Context::current()->state().shader->maxCombinedUniformBlocks;
GLint& value = Context::current().state().shader->maxCombinedUniformBlocks;
/* Get the value, if not already cached */
if(value == 0)
@ -647,7 +647,7 @@ Int Shader::maxUniformComponents(const Type type) {
return 0;
const UnsignedInt index = typeToIndex(type);
GLint& value = Context::current()->state().shader->maxUniformComponents[index];
GLint& value = Context::current().state().shader->maxUniformComponents[index];
/* Get the value, if not already cached */
#ifndef MAGNUM_TARGET_GLES2
@ -686,14 +686,14 @@ Int Shader::maxUniformComponents(const Type type) {
#ifndef MAGNUM_TARGET_GLES2
Int Shader::maxCombinedUniformComponents(const Type type) {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>() || !isTypeSupported(type))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>() || !isTypeSupported(type))
#else
if(!isTypeSupported(type))
#endif
return 0;
const UnsignedInt index = typeToIndex(type);
GLint& value = Context::current()->state().shader->maxCombinedUniformComponents[index];
GLint& value = Context::current().state().shader->maxCombinedUniformComponents[index];
/* Get the value, if not already cached */
constexpr static GLenum what[] = {
@ -758,17 +758,17 @@ Shader::~Shader() {
#ifndef MAGNUM_TARGET_WEBGL
std::string Shader::label() const {
#ifndef MAGNUM_TARGET_GLES
return Context::current()->state().debug->getLabelImplementation(GL_SHADER, _id);
return Context::current().state().debug->getLabelImplementation(GL_SHADER, _id);
#else
return Context::current()->state().debug->getLabelImplementation(GL_SHADER_KHR, _id);
return Context::current().state().debug->getLabelImplementation(GL_SHADER_KHR, _id);
#endif
}
Shader& Shader::setLabelInternal(const Containers::ArrayView<const char> label) {
#ifndef MAGNUM_TARGET_GLES
Context::current()->state().debug->labelImplementation(GL_SHADER, _id, label);
Context::current().state().debug->labelImplementation(GL_SHADER, _id, label);
#else
Context::current()->state().debug->labelImplementation(GL_SHADER_KHR, _id, label);
Context::current().state().debug->labelImplementation(GL_SHADER_KHR, _id, label);
#endif
return *this;
}

12
src/Magnum/Shaders/DistanceFieldVector.cpp

@ -50,9 +50,9 @@ template<UnsignedInt dimensions> DistanceFieldVector<dimensions>::DistanceFieldV
Utility::Resource rs("MagnumShaders");
#ifndef MAGNUM_TARGET_GLES
const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210});
const Version version = Context::current().supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210});
#else
const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200});
const Version version = Context::current().supportedVersion({Version::GLES300, Version::GLES200});
#endif
Shader frag = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex);
@ -67,9 +67,9 @@ template<UnsignedInt dimensions> DistanceFieldVector<dimensions>::DistanceFieldV
AbstractShaderProgram::attachShaders({frag, vert});
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(version))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(version))
#else
if(!Context::current()->isVersionSupported(Version::GLES300))
if(!Context::current().isVersionSupported(Version::GLES300))
#endif
{
AbstractShaderProgram::bindAttributeLocation(AbstractVector<dimensions>::Position::Location, "position");
@ -79,7 +79,7 @@ template<UnsignedInt dimensions> DistanceFieldVector<dimensions>::DistanceFieldV
CORRADE_INTERNAL_ASSERT_OUTPUT(AbstractShaderProgram::link());
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>(version))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>(version))
#endif
{
transformationProjectionMatrixUniform = AbstractShaderProgram::uniformLocation("transformationProjectionMatrix");
@ -90,7 +90,7 @@ template<UnsignedInt dimensions> DistanceFieldVector<dimensions>::DistanceFieldV
}
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shading_language_420pack>(version))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::shading_language_420pack>(version))
#endif
{
AbstractShaderProgram::setUniform(AbstractShaderProgram::uniformLocation("vectorTexture"),

12
src/Magnum/Shaders/Flat.cpp

@ -53,9 +53,9 @@ template<UnsignedInt dimensions> Flat<dimensions>::Flat(const Flags flags): tran
Utility::Resource rs("MagnumShaders");
#ifndef MAGNUM_TARGET_GLES
const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210});
const Version version = Context::current().supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210});
#else
const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200});
const Version version = Context::current().supportedVersion({Version::GLES300, Version::GLES200});
#endif
Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex);
@ -72,9 +72,9 @@ template<UnsignedInt dimensions> Flat<dimensions>::Flat(const Flags flags): tran
attachShaders({vert, frag});
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(version))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(version))
#else
if(!Context::current()->isVersionSupported(Version::GLES300))
if(!Context::current().isVersionSupported(Version::GLES300))
#endif
{
bindAttributeLocation(Position::Location, "position");
@ -84,7 +84,7 @@ template<UnsignedInt dimensions> Flat<dimensions>::Flat(const Flags flags): tran
CORRADE_INTERNAL_ASSERT_OUTPUT(link());
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>(version))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>(version))
#endif
{
transformationProjectionMatrixUniform = uniformLocation("transformationProjectionMatrix");
@ -92,7 +92,7 @@ template<UnsignedInt dimensions> Flat<dimensions>::Flat(const Flags flags): tran
}
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shading_language_420pack>(version))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::shading_language_420pack>(version))
#endif
{
if(flags & Flag::Textured) setUniform(uniformLocation("textureData"), TextureLayer);

6
src/Magnum/Shaders/Implementation/CreateCompatibilityShader.h

@ -45,11 +45,11 @@ inline Shader createCompatibilityShader(const Utility::Resource& rs, Version ver
Shader shader(version, type);
#ifndef MAGNUM_TARGET_GLES
if(Context::current()->isExtensionDisabled<Extensions::GL::ARB::explicit_attrib_location>(version))
if(Context::current().isExtensionDisabled<Extensions::GL::ARB::explicit_attrib_location>(version))
shader.addSource("#define DISABLE_GL_ARB_explicit_attrib_location\n");
if(Context::current()->isExtensionDisabled<Extensions::GL::ARB::shading_language_420pack>(version))
if(Context::current().isExtensionDisabled<Extensions::GL::ARB::shading_language_420pack>(version))
shader.addSource("#define DISABLE_GL_ARB_shading_language_420pack\n");
if(Context::current()->isExtensionDisabled<Extensions::GL::ARB::explicit_uniform_location>(version))
if(Context::current().isExtensionDisabled<Extensions::GL::ARB::explicit_uniform_location>(version))
shader.addSource("#define DISABLE_GL_ARB_explicit_uniform_location\n");
#endif

16
src/Magnum/Shaders/MeshVisualizer.cpp

@ -59,13 +59,13 @@ MeshVisualizer::MeshVisualizer(const Flags flags): flags(flags), transformationP
Utility::Resource rs("MagnumShaders");
#ifndef MAGNUM_TARGET_GLES
const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210});
const Version version = Context::current().supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210});
CORRADE_INTERNAL_ASSERT(!flags || flags & Flag::NoGeometryShader || version >= Version::GL320);
#elif !defined(MAGNUM_TARGET_WEBGL)
const Version version = Context::current()->supportedVersion({Version::GLES310, Version::GLES300, Version::GLES200});
const Version version = Context::current().supportedVersion({Version::GLES310, Version::GLES300, Version::GLES200});
CORRADE_INTERNAL_ASSERT(!flags || flags & Flag::NoGeometryShader || version >= Version::GLES310);
#else
const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200});
const Version version = Context::current().supportedVersion({Version::GLES300, Version::GLES200});
#endif
Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex);
@ -76,7 +76,7 @@ MeshVisualizer::MeshVisualizer(const Flags flags): flags(flags), transformationP
#ifdef MAGNUM_TARGET_WEBGL
.addSource("#define SUBSCRIPTING_WORKAROUND\n")
#elif defined(MAGNUM_TARGET_GLES2)
.addSource(Context::current()->detectedDriver() & Context::DetectedDriver::ProbablyAngle ?
.addSource(Context::current()detectedDriver() & Context::DetectedDriver::ProbablyAngle ?
"#define SUBSCRIPTING_WORKAROUND\n" : "")
#endif
.addSource(rs.get("generic.glsl"))
@ -105,16 +105,16 @@ MeshVisualizer::MeshVisualizer(const Flags flags): flags(flags), transformationP
#endif
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(version))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(version))
#else
if(!Context::current()->isVersionSupported(Version::GLES300))
if(!Context::current().isVersionSupported(Version::GLES300))
#endif
{
bindAttributeLocation(Position::Location, "position");
#if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_GLES2)
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isVersionSupported(Version::GL310))
if(!Context::current().isVersionSupported(Version::GL310))
#endif
{
bindAttributeLocation(VertexIndex::Location, "vertexIndex");
@ -125,7 +125,7 @@ MeshVisualizer::MeshVisualizer(const Flags flags): flags(flags), transformationP
CORRADE_INTERNAL_ASSERT_OUTPUT(link());
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>(version))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>(version))
#endif
{
transformationProjectionMatrixUniform = uniformLocation("transformationProjectionMatrix");

12
src/Magnum/Shaders/Phong.cpp

@ -53,9 +53,9 @@ Phong::Phong(const Flags flags): transformationMatrixUniform(0), projectionMatri
Utility::Resource rs("MagnumShaders");
#ifndef MAGNUM_TARGET_GLES
const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210});
const Version version = Context::current().supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210});
#else
const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200});
const Version version = Context::current().supportedVersion({Version::GLES300, Version::GLES200});
#endif
Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex);
@ -74,9 +74,9 @@ Phong::Phong(const Flags flags): transformationMatrixUniform(0), projectionMatri
attachShaders({vert, frag});
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(version))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(version))
#else
if(!Context::current()->isVersionSupported(Version::GLES300))
if(!Context::current().isVersionSupported(Version::GLES300))
#endif
{
bindAttributeLocation(Position::Location, "position");
@ -87,7 +87,7 @@ Phong::Phong(const Flags flags): transformationMatrixUniform(0), projectionMatri
CORRADE_INTERNAL_ASSERT_OUTPUT(link());
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>(version))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>(version))
#endif
{
transformationMatrixUniform = uniformLocation("transformationMatrix");
@ -102,7 +102,7 @@ Phong::Phong(const Flags flags): transformationMatrixUniform(0), projectionMatri
}
#ifndef MAGNUM_TARGET_GLES
if(flags && !Context::current()->isExtensionSupported<Extensions::GL::ARB::shading_language_420pack>(version))
if(flags && !Context::current().isExtensionSupported<Extensions::GL::ARB::shading_language_420pack>(version))
#endif
{
if(flags & Flag::AmbientTexture) setUniform(uniformLocation("ambientTexture"), AmbientTextureLayer);

6
src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp

@ -56,15 +56,15 @@ void MeshVisualizerGLTest::compile() {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void MeshVisualizerGLTest::compileWireframeGeometryShader() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not supported"));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not supported"));
#endif
#ifdef MAGNUM_TARGET_GLES
if(Context::current()->isExtensionSupported<Extensions::GL::NV::shader_noperspective_interpolation>())
if(Context::current().isExtensionSupported<Extensions::GL::NV::shader_noperspective_interpolation>())
Debug() << "Using" << Extensions::GL::NV::shader_noperspective_interpolation::string();
#endif

12
src/Magnum/Shaders/Vector.cpp

@ -50,9 +50,9 @@ template<UnsignedInt dimensions> Vector<dimensions>::Vector(): transformationPro
Utility::Resource rs("MagnumShaders");
#ifndef MAGNUM_TARGET_GLES
const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210});
const Version version = Context::current().supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210});
#else
const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200});
const Version version = Context::current().supportedVersion({Version::GLES300, Version::GLES200});
#endif
Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex);
@ -67,9 +67,9 @@ template<UnsignedInt dimensions> Vector<dimensions>::Vector(): transformationPro
AbstractShaderProgram::attachShaders({vert, frag});
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(version))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(version))
#else
if(!Context::current()->isVersionSupported(Version::GLES300))
if(!Context::current().isVersionSupported(Version::GLES300))
#endif
{
AbstractShaderProgram::bindAttributeLocation(AbstractVector<dimensions>::Position::Location, "position");
@ -79,7 +79,7 @@ template<UnsignedInt dimensions> Vector<dimensions>::Vector(): transformationPro
CORRADE_INTERNAL_ASSERT_OUTPUT(AbstractShaderProgram::link());
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>(version))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>(version))
#endif
{
transformationProjectionMatrixUniform = AbstractShaderProgram::uniformLocation("transformationProjectionMatrix");
@ -88,7 +88,7 @@ template<UnsignedInt dimensions> Vector<dimensions>::Vector(): transformationPro
}
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shading_language_420pack>(version))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::shading_language_420pack>(version))
#endif
{
AbstractShaderProgram::setUniform(AbstractShaderProgram::uniformLocation("vectorTexture"), AbstractVector<dimensions>::VectorTextureLayer);

10
src/Magnum/Shaders/VertexColor.cpp

@ -50,9 +50,9 @@ template<UnsignedInt dimensions> VertexColor<dimensions>::VertexColor(): transfo
Utility::Resource rs("MagnumShaders");
#ifndef MAGNUM_TARGET_GLES
const Version version = Context::current()->supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210});
const Version version = Context::current().supportedVersion({Version::GL320, Version::GL310, Version::GL300, Version::GL210});
#else
const Version version = Context::current()->supportedVersion({Version::GLES300, Version::GLES200});
const Version version = Context::current().supportedVersion({Version::GLES300, Version::GLES200});
#endif
Shader vert = Implementation::createCompatibilityShader(rs, version, Shader::Type::Vertex);
@ -67,9 +67,9 @@ template<UnsignedInt dimensions> VertexColor<dimensions>::VertexColor(): transfo
attachShaders({vert, frag});
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(version))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(version))
#else
if(!Context::current()->isVersionSupported(Version::GLES300))
if(!Context::current().isVersionSupported(Version::GLES300))
#endif
{
bindAttributeLocation(Position::Location, "position");
@ -79,7 +79,7 @@ template<UnsignedInt dimensions> VertexColor<dimensions>::VertexColor(): transfo
CORRADE_INTERNAL_ASSERT_OUTPUT(link());
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>(version))
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>(version))
#endif
{
transformationProjectionMatrixUniform = uniformLocation("transformationProjectionMatrix");

2
src/Magnum/Test/AbstractObjectGLTest.cpp

@ -41,7 +41,7 @@ AbstractObjectGLTest::AbstractObjectGLTest() {
}
void AbstractObjectGLTest::labelNoOp() {
if(Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>())
if(Context::current().isExtensionSupported<Extensions::GL::KHR::debug>())
CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is supported."));
Buffer buffer;

2
src/Magnum/Test/AbstractOpenGLTester.h

@ -76,7 +76,7 @@ AbstractOpenGLTester::AbstractOpenGLTester(): _windowlessApplication{*_windowles
_windowlessApplication.createContext();
#endif
if(Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>()) {
if(Context::current().isExtensionSupported<Extensions::GL::KHR::debug>()) {
Renderer::enable(Renderer::Feature::DebugOutput);
Renderer::enable(Renderer::Feature::DebugOutputSynchronous);
DebugOutput::setDefaultCallback();

12
src/Magnum/Test/AbstractQueryGLTest.cpp

@ -48,7 +48,7 @@ AbstractQueryGLTest::AbstractQueryGLTest() {
void AbstractQueryGLTest::construct() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::occlusion_query_boolean>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::occlusion_query_boolean>())
CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not supported."));
#endif
@ -73,7 +73,7 @@ void AbstractQueryGLTest::constructCopy() {
void AbstractQueryGLTest::constructMove() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::occlusion_query_boolean>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::occlusion_query_boolean>())
CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not supported."));
#endif
@ -108,13 +108,13 @@ void AbstractQueryGLTest::constructMove() {
void AbstractQueryGLTest::label() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::occlusion_query_boolean>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::occlusion_query_boolean>())
CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not supported."));
#endif
/* No-Op version is tested in AbstractObjectGLTest */
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current()->isExtensionSupported<Extensions::GL::EXT::debug_label>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::debug_label>())
CORRADE_SKIP("Required extension is not available");
#ifndef MAGNUM_TARGET_GLES
@ -124,7 +124,7 @@ void AbstractQueryGLTest::label() {
#endif
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
#endif
{
query.begin(); query.end();

4
src/Magnum/Test/AbstractShaderProgramGLTest.cpp

@ -125,8 +125,8 @@ void AbstractShaderProgramGLTest::constructMove() {
void AbstractShaderProgramGLTest::label() {
/* No-Op version is tested in AbstractObjectGLTest */
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current()->isExtensionSupported<Extensions::GL::EXT::debug_label>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::debug_label>())
CORRADE_SKIP("Required extension is not available");
DummyShader shader;

4
src/Magnum/Test/AbstractTextureGLTest.cpp

@ -88,8 +88,8 @@ void AbstractTextureGLTest::constructMove() {
void AbstractTextureGLTest::label() {
/* No-Op version is tested in AbstractObjectGLTest */
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current()->isExtensionSupported<Extensions::GL::EXT::debug_label>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::debug_label>())
CORRADE_SKIP("Required extension is not available");
Texture2D texture;

20
src/Magnum/Test/BufferGLTest.cpp

@ -158,8 +158,8 @@ void BufferGLTest::wrap() {
void BufferGLTest::label() {
/* No-Op version is tested in AbstractObjectGLTest */
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current()->isExtensionSupported<Extensions::GL::EXT::debug_label>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::debug_label>())
CORRADE_SKIP("Required extension is not available");
Buffer buffer;
@ -176,7 +176,7 @@ void BufferGLTest::label() {
#ifndef MAGNUM_TARGET_GLES2
void BufferGLTest::bindBase() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::uniform_buffer_object::string() + std::string{" is not supported."});
#endif
@ -200,7 +200,7 @@ void BufferGLTest::bindBase() {
void BufferGLTest::bindRange() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::uniform_buffer_object::string() + std::string{" is not supported."});
#endif
@ -286,7 +286,7 @@ void BufferGLTest::data() {
void BufferGLTest::map() {
#ifdef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::mapbuffer>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::mapbuffer>())
CORRADE_SKIP(Extensions::GL::OES::mapbuffer::string() + std::string(" is not supported"));
#endif
Buffer buffer;
@ -320,7 +320,7 @@ void BufferGLTest::map() {
#ifdef CORRADE_TARGET_NACL
void BufferGLTest::mapSub() {
if(!Context::current()->isExtensionSupported<Extensions::GL::CHROMIUM::map_sub>())
if(!Context::current().isExtensionSupported<Extensions::GL::CHROMIUM::map_sub>())
CORRADE_SKIP(Extensions::GL::CHROMIUM::map_sub::string() + std::string(" is not supported"));
Buffer buffer;
@ -343,10 +343,10 @@ void BufferGLTest::mapSub() {
void BufferGLTest::mapRange() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::map_buffer_range>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::map_buffer_range>())
CORRADE_SKIP(Extensions::GL::ARB::map_buffer_range::string() + std::string(" is not supported"));
#elif defined(MAGNUM_TARGET_GLES2)
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::map_buffer_range>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::map_buffer_range>())
CORRADE_SKIP(Extensions::GL::EXT::map_buffer_range::string() + std::string(" is not supported"));
#endif
@ -374,10 +374,10 @@ void BufferGLTest::mapRange() {
void BufferGLTest::mapRangeExplicitFlush() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::map_buffer_range>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::map_buffer_range>())
CORRADE_SKIP(Extensions::GL::ARB::map_buffer_range::string() + std::string(" is not supported"));
#elif defined(MAGNUM_TARGET_GLES2)
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::map_buffer_range>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::map_buffer_range>())
CORRADE_SKIP(Extensions::GL::EXT::map_buffer_range::string() + std::string(" is not supported"));
#endif

22
src/Magnum/Test/BufferTextureGLTest.cpp

@ -56,10 +56,10 @@ BufferTextureGLTest::BufferTextureGLTest() {
void BufferTextureGLTest::construct() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported."));
#endif
@ -86,10 +86,10 @@ void BufferTextureGLTest::constructNoCreate() {
void BufferTextureGLTest::wrap() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported."));
#endif
@ -109,10 +109,10 @@ void BufferTextureGLTest::wrap() {
void BufferTextureGLTest::bind() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported."));
#endif
@ -136,10 +136,10 @@ void BufferTextureGLTest::bind() {
void BufferTextureGLTest::setBuffer() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported."));
#endif
@ -157,12 +157,12 @@ void BufferTextureGLTest::setBuffer() {
void BufferTextureGLTest::setBufferOffset() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_buffer_range>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_buffer_range>())
CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_range::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_buffer>())
CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported."));
#endif

36
src/Magnum/Test/ContextGLTest.cpp

@ -60,10 +60,10 @@ void ContextGLTest::constructCopyMove() {
}
void ContextGLTest::isVersionSupported() {
const Version v = Context::current()->version();
CORRADE_VERIFY(Context::current()->isVersionSupported(v));
CORRADE_VERIFY(Context::current()->isVersionSupported(Version(Int(v)-1)));
CORRADE_VERIFY(!Context::current()->isVersionSupported(Version(Int(v)+1)));
const Version v = Context::current().version();
CORRADE_VERIFY(Context::current().isVersionSupported(v));
CORRADE_VERIFY(Context::current().isVersionSupported(Version(Int(v)-1)));
CORRADE_VERIFY(!Context::current().isVersionSupported(Version(Int(v)+1)));
/* No assertions should be fired */
MAGNUM_ASSERT_VERSION_SUPPORTED(v);
@ -71,34 +71,34 @@ void ContextGLTest::isVersionSupported() {
}
void ContextGLTest::supportedVersion() {
const Version v = Context::current()->version();
const Version v = Context::current().version();
/* Selects first supported version (thus not necessarily the highest) */
CORRADE_VERIFY(Context::current()->supportedVersion({Version(Int(v)+1), v, Version(Int(v)-1)}) == v);
CORRADE_VERIFY(Context::current()->supportedVersion({Version(Int(v)+1), Version(Int(v)-1), v}) == Version(Int(v)-1));
CORRADE_VERIFY(Context::current().supportedVersion({Version(Int(v)+1), v, Version(Int(v)-1)}) == v);
CORRADE_VERIFY(Context::current().supportedVersion({Version(Int(v)+1), Version(Int(v)-1), v}) == Version(Int(v)-1));
}
void ContextGLTest::isExtensionSupported() {
#ifndef MAGNUM_TARGET_GLES
if(Context::current()->isExtensionSupported<Extensions::GL::GREMEDY::string_marker>())
if(Context::current().isExtensionSupported<Extensions::GL::GREMEDY::string_marker>())
CORRADE_SKIP(Extensions::GL::GREMEDY::string_marker::string() + std::string(" extension should not be supported, can't test"));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_filter_anisotropic>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_filter_anisotropic>())
CORRADE_SKIP(Extensions::GL::EXT::texture_filter_anisotropic::string() + std::string(" extension should be supported, can't test"));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>())
CORRADE_SKIP(Extensions::GL::ARB::explicit_attrib_location::string() + std::string(" extension should be supported, can't test"));
/* Test that we have proper extension list parser */
std::vector<std::string> extensions = Context::current()->extensionStrings();
std::vector<std::string> extensions = Context::current().extensionStrings();
CORRADE_VERIFY(std::find(extensions.begin(), extensions.end(),
Extensions::GL::EXT::texture_filter_anisotropic::string()) != extensions.end());
CORRADE_VERIFY(std::find(extensions.begin(), extensions.end(),
Extensions::GL::GREMEDY::string_marker::string()) == extensions.end());
/* This is disabled in GL < 3.2 to work around GLSL compiler bugs */
CORRADE_VERIFY(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(Version::GL310));
CORRADE_VERIFY(Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(Version::GL320));
CORRADE_VERIFY(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(Version::GL310));
CORRADE_VERIFY(Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(Version::GL320));
#else
CORRADE_SKIP("No useful extensions to test on OpenGL ES");
#endif
@ -106,18 +106,18 @@ void ContextGLTest::isExtensionSupported() {
void ContextGLTest::isExtensionDisabled() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::vertex_array_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::vertex_array_object>())
CORRADE_SKIP(Extensions::GL::ARB::vertex_array_object::string() + std::string(" extension should be supported, can't test"));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>())
CORRADE_SKIP(Extensions::GL::ARB::explicit_attrib_location::string() + std::string(" extension should be supported, can't test"));
/* This is not disabled anywhere */
CORRADE_VERIFY(!Context::current()->isExtensionDisabled<Extensions::GL::ARB::vertex_array_object>());
CORRADE_VERIFY(!Context::current().isExtensionDisabled<Extensions::GL::ARB::vertex_array_object>());
/* This is disabled in GL < 3.2 to work around GLSL compiler bugs */
CORRADE_VERIFY(Context::current()->isExtensionDisabled<Extensions::GL::ARB::explicit_attrib_location>(Version::GL310));
CORRADE_VERIFY(!Context::current()->isExtensionDisabled<Extensions::GL::ARB::explicit_attrib_location>(Version::GL320));
CORRADE_VERIFY(Context::current().isExtensionDisabled<Extensions::GL::ARB::explicit_attrib_location>(Version::GL310));
CORRADE_VERIFY(!Context::current().isExtensionDisabled<Extensions::GL::ARB::explicit_attrib_location>(Version::GL320));
#else
CORRADE_SKIP("No useful extensions to test on OpenGL ES");
#endif

130
src/Magnum/Test/CubeMapTextureArrayGLTest.cpp

@ -122,7 +122,7 @@ CubeMapTextureArrayGLTest::CubeMapTextureArrayGLTest() {
&CubeMapTextureArrayGLTest::invalidateSubImage});
#ifndef MAGNUM_TARGET_GLES
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>())
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>())
{
_compressedDataStorage = _compressedSubDataStorage = CompressedPixelStorage{}
.setCompressedBlockSize({4, 4, 1})
@ -148,10 +148,10 @@ namespace {
void CubeMapTextureArrayGLTest::construct() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
@ -178,10 +178,10 @@ void CubeMapTextureArrayGLTest::constructNoCreate() {
void CubeMapTextureArrayGLTest::wrap() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
@ -201,10 +201,10 @@ void CubeMapTextureArrayGLTest::wrap() {
void CubeMapTextureArrayGLTest::bind() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
@ -228,10 +228,10 @@ void CubeMapTextureArrayGLTest::bind() {
void CubeMapTextureArrayGLTest::sampling() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
@ -260,13 +260,13 @@ void CubeMapTextureArrayGLTest::sampling() {
void CubeMapTextureArrayGLTest::samplingSRGBDecode() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_sRGB_decode>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_sRGB_decode>())
CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported."));
CubeMapTextureArray texture;
@ -277,14 +277,14 @@ void CubeMapTextureArrayGLTest::samplingSRGBDecode() {
void CubeMapTextureArrayGLTest::samplingBorderInteger() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_integer>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_integer>())
CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported."));
#endif
@ -300,12 +300,12 @@ void CubeMapTextureArrayGLTest::samplingBorderInteger() {
void CubeMapTextureArrayGLTest::samplingSwizzle() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_swizzle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_swizzle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
@ -317,12 +317,12 @@ void CubeMapTextureArrayGLTest::samplingSwizzle() {
void CubeMapTextureArrayGLTest::samplingDepthStencilMode() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::stencil_texturing>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::stencil_texturing>())
CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
@ -334,9 +334,9 @@ void CubeMapTextureArrayGLTest::samplingDepthStencilMode() {
#ifdef MAGNUM_TARGET_GLES
void CubeMapTextureArrayGLTest::samplingBorder() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported."));
CubeMapTextureArray texture;
@ -349,10 +349,10 @@ void CubeMapTextureArrayGLTest::samplingBorder() {
void CubeMapTextureArrayGLTest::storage() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
@ -416,10 +416,10 @@ namespace {
void CubeMapTextureArrayGLTest::image() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
@ -444,13 +444,13 @@ void CubeMapTextureArrayGLTest::image() {
void CubeMapTextureArrayGLTest::compressedImage() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
CubeMapTextureArray texture;
@ -476,10 +476,10 @@ void CubeMapTextureArrayGLTest::compressedImage() {
void CubeMapTextureArrayGLTest::imageBuffer() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
@ -504,13 +504,13 @@ void CubeMapTextureArrayGLTest::imageBuffer() {
void CubeMapTextureArrayGLTest::compressedImageBuffer() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
CubeMapTextureArray texture;
@ -666,10 +666,10 @@ namespace {
void CubeMapTextureArrayGLTest::subImage() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
@ -696,20 +696,20 @@ void CubeMapTextureArrayGLTest::subImage() {
void CubeMapTextureArrayGLTest::compressedSubImage() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
#ifndef MAGNUM_TARGET_GLES
/* Compressed pixel storage for array textures is underspecified. If the
extension is supported, first test with default values to ensure we are
not that far off, then continue as usual */
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
CubeMapTextureArray texture;
texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3,
{12, 12, 6}, CompressedZero});
@ -747,7 +747,7 @@ void CubeMapTextureArrayGLTest::compressedSubImage() {
CORRADE_COMPARE(image.size(), (Vector3i{12, 12, 6}));
{
CORRADE_EXPECT_FAIL_IF(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>() && (Context::current()->detectedDriver() & Context::DetectedDriver::NVidia),
CORRADE_EXPECT_FAIL_IF(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>() && (Context::current().detectedDriver() & Context::DetectedDriver::NVidia),
"Non-default compressed pixel storage for cube map textures behaves weirdly on NVidia for client-memory images");
CORRADE_COMPARE_AS(
@ -759,10 +759,10 @@ void CubeMapTextureArrayGLTest::compressedSubImage() {
void CubeMapTextureArrayGLTest::subImageBuffer() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
@ -788,13 +788,13 @@ void CubeMapTextureArrayGLTest::subImageBuffer() {
void CubeMapTextureArrayGLTest::compressedSubImageBuffer() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
CubeMapTextureArray texture;
@ -822,9 +822,9 @@ void CubeMapTextureArrayGLTest::compressedSubImageBuffer() {
#ifndef MAGNUM_TARGET_GLES
void CubeMapTextureArrayGLTest::subImageQuery() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
CubeMapTextureArray texture;
@ -845,9 +845,9 @@ void CubeMapTextureArrayGLTest::subImageQuery() {
}
void CubeMapTextureArrayGLTest::compressedSubImageQuery() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
CubeMapTextureArray texture;
@ -858,7 +858,7 @@ void CubeMapTextureArrayGLTest::compressedSubImageQuery() {
/* Test also without compressed pixel storage to ensure that both size
computations work */
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 1}, Vector3i{4}), {});
MAGNUM_VERIFY_NO_ERROR();
@ -880,9 +880,9 @@ void CubeMapTextureArrayGLTest::compressedSubImageQuery() {
}
void CubeMapTextureArrayGLTest::subImageQueryBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
CubeMapTextureArray texture;
@ -903,9 +903,9 @@ void CubeMapTextureArrayGLTest::subImageQueryBuffer() {
}
void CubeMapTextureArrayGLTest::compressedSubImageQueryBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
CubeMapTextureArray texture;
@ -916,7 +916,7 @@ void CubeMapTextureArrayGLTest::compressedSubImageQueryBuffer() {
/* Test also without compressed pixel storage to ensure that both size
computations work */
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 1}, Vector3i{4}), {}, BufferUsage::StaticRead);
const auto imageData = image.buffer().data<UnsignedByte>();
@ -938,12 +938,12 @@ void CubeMapTextureArrayGLTest::compressedSubImageQueryBuffer() {
void CubeMapTextureArrayGLTest::generateMipmap() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
@ -970,10 +970,10 @@ void CubeMapTextureArrayGLTest::generateMipmap() {
void CubeMapTextureArrayGLTest::invalidateImage() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif
@ -986,10 +986,10 @@ void CubeMapTextureArrayGLTest::invalidateImage() {
void CubeMapTextureArrayGLTest::invalidateSubImage() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported."));
#endif

92
src/Magnum/Test/CubeMapTextureGLTest.cpp

@ -173,7 +173,7 @@ CubeMapTextureGLTest::CubeMapTextureGLTest() {
_dataOffset = 8;
#ifdef MAGNUM_TARGET_GLES2
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::unpack_subimage>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::unpack_subimage>())
#endif
{
_dataStorage = {};
@ -182,7 +182,7 @@ CubeMapTextureGLTest::CubeMapTextureGLTest() {
#endif
#ifndef MAGNUM_TARGET_GLES
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>())
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>())
{
_compressedDataStorage = CompressedPixelStorage{}
.setCompressedBlockSize({4, 4, 1})
@ -299,10 +299,10 @@ void CubeMapTextureGLTest::sampling() {
void CubeMapTextureGLTest::samplingSRGBDecode() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::sRGB>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::sRGB>())
CORRADE_SKIP(Extensions::GL::EXT::sRGB::string() + std::string(" is not supported."));
#endif
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_sRGB_decode>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_sRGB_decode>())
CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported."));
CubeMapTexture texture;
@ -314,7 +314,7 @@ void CubeMapTextureGLTest::samplingSRGBDecode() {
#ifndef MAGNUM_TARGET_GLES2
void CubeMapTextureGLTest::samplingSwizzle() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_swizzle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_swizzle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported."));
#endif
@ -325,7 +325,7 @@ void CubeMapTextureGLTest::samplingSwizzle() {
}
#else
void CubeMapTextureGLTest::samplingMaxLevel() {
if(!Context::current()->isExtensionSupported<Extensions::GL::APPLE::texture_max_level>())
if(!Context::current().isExtensionSupported<Extensions::GL::APPLE::texture_max_level>())
CORRADE_SKIP(Extensions::GL::APPLE::texture_max_level::string() + std::string(" is not supported."));
CubeMapTexture texture;
@ -335,8 +335,8 @@ void CubeMapTextureGLTest::samplingMaxLevel() {
}
void CubeMapTextureGLTest::samplingCompare() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::shadow_samplers>() ||
!Context::current()->isExtensionSupported<Extensions::GL::NV::shadow_samplers_cube>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::shadow_samplers>() ||
!Context::current().isExtensionSupported<Extensions::GL::NV::shadow_samplers_cube>())
CORRADE_SKIP(Extensions::GL::NV::shadow_samplers_cube::string() + std::string(" is not supported."));
CubeMapTexture texture;
@ -350,10 +350,10 @@ void CubeMapTextureGLTest::samplingCompare() {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void CubeMapTextureGLTest::samplingBorderInteger() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_integer>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_integer>())
CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported."));
#endif
@ -371,10 +371,10 @@ void CubeMapTextureGLTest::samplingBorderInteger() {
#ifndef MAGNUM_TARGET_GLES2
void CubeMapTextureGLTest::samplingDepthStencilMode() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::stencil_texturing>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::stencil_texturing>())
CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported."));
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 not supported.");
#endif
@ -387,8 +387,8 @@ void CubeMapTextureGLTest::samplingDepthStencilMode() {
#ifdef MAGNUM_TARGET_GLES
void CubeMapTextureGLTest::samplingBorder() {
if(!Context::current()->isExtensionSupported<Extensions::GL::NV::texture_border_clamp>() &&
!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
if(!Context::current().isExtensionSupported<Extensions::GL::NV::texture_border_clamp>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
CORRADE_SKIP("No required extension is supported.");
CubeMapTexture texture;
@ -407,7 +407,7 @@ void CubeMapTextureGLTest::storage() {
#ifndef MAGNUM_TARGET_GLES2
#ifdef MAGNUM_TARGET_GLES
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 not supported, skipping image size testing");
#endif
@ -459,10 +459,10 @@ void CubeMapTextureGLTest::image() {
void CubeMapTextureGLTest::compressedImage() {
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported."));
#endif
@ -518,10 +518,10 @@ void CubeMapTextureGLTest::imageBuffer() {
void CubeMapTextureGLTest::compressedImageBuffer() {
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported."));
#endif
@ -557,13 +557,13 @@ void CubeMapTextureGLTest::compressedImageBuffer() {
void CubeMapTextureGLTest::immutableCompressedImage() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_storage>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_storage>())
CORRADE_SKIP(Extensions::GL::ARB::texture_storage::string() + std::string(" is not supported."));
#elif defined(MAGNUM_TARGET_GLES2)
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_storage>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_storage>())
CORRADE_SKIP(Extensions::GL::EXT::texture_storage::string() + std::string(" is not supported."));
#endif
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
/* Testing that GL_TEXTURE_COMPRESSED_IMAGE_SIZE is consistent and returns
@ -657,7 +657,7 @@ namespace {
}
void CubeMapTextureGLTest::fullImageQuery() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported."));
CubeMapTexture texture;
@ -678,9 +678,9 @@ void CubeMapTextureGLTest::fullImageQuery() {
}
void CubeMapTextureGLTest::compressedFullImageQuery() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
CubeMapTexture texture;
@ -700,7 +700,7 @@ void CubeMapTextureGLTest::compressedFullImageQuery() {
}
void CubeMapTextureGLTest::fullImageQueryBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported."));
CubeMapTexture texture;
@ -721,9 +721,9 @@ void CubeMapTextureGLTest::fullImageQueryBuffer() {
}
void CubeMapTextureGLTest::compressedFullImageQueryBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
CubeMapTexture texture;
@ -815,10 +815,10 @@ void CubeMapTextureGLTest::subImage() {
void CubeMapTextureGLTest::compressedSubImage() {
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported."));
#endif
@ -826,7 +826,7 @@ void CubeMapTextureGLTest::compressedSubImage() {
/* Compressed pixel storage for array textures is underspecified. If the
extension is supported, first test with default values to ensure we are
not that far off, then continue as usual */
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
CubeMapTexture texture;
texture.setCompressedImage(CubeMapTexture::Coordinate::PositiveX, 0,
CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{12}, CompressedZero});
@ -885,7 +885,7 @@ void CubeMapTextureGLTest::compressedSubImage() {
CORRADE_COMPARE(image.size(), Vector2i{12});
{
CORRADE_EXPECT_FAIL_IF(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>() && Context::current()->isExtensionSupported<Extensions::GL::ARB::direct_state_access>() && (Context::current()->detectedDriver() & Context::DetectedDriver::NVidia),
CORRADE_EXPECT_FAIL_IF(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>() && Context::current().isExtensionSupported<Extensions::GL::ARB::direct_state_access>() && (Context::current().detectedDriver() & Context::DetectedDriver::NVidia),
"Non-default compressed pixel storage for cube map textures behaves weirdly on NVidia for client-memory images when using ARB_direct_state_access");
CORRADE_COMPARE_AS(
@ -929,10 +929,10 @@ void CubeMapTextureGLTest::subImageBuffer() {
void CubeMapTextureGLTest::compressedSubImageBuffer() {
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported."));
#endif
@ -972,10 +972,10 @@ void CubeMapTextureGLTest::compressedSubImageBuffer() {
#ifndef MAGNUM_TARGET_GLES
void CubeMapTextureGLTest::subImageQuery() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
/* I'm too lazy to call setSubImage() six times */
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported."));
CubeMapTexture texture;
@ -996,12 +996,12 @@ void CubeMapTextureGLTest::subImageQuery() {
}
void CubeMapTextureGLTest::compressedSubImageQuery() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
/* I'm too lazy to call setSubImage() six times */
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
CubeMapTexture texture;
@ -1012,7 +1012,7 @@ void CubeMapTextureGLTest::compressedSubImageQuery() {
/* Test also without compressed pixel storage to ensure that both size
computations work */
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 0}, {4, 4, 1}), {});
MAGNUM_VERIFY_NO_ERROR();
@ -1034,10 +1034,10 @@ void CubeMapTextureGLTest::compressedSubImageQuery() {
}
void CubeMapTextureGLTest::subImageQueryBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
/* I'm too lazy to call setSubImage() six times */
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported."));
CubeMapTexture texture;
@ -1057,12 +1057,12 @@ void CubeMapTextureGLTest::subImageQueryBuffer() {
}
void CubeMapTextureGLTest::compressedSubImageQueryBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
/* I'm too lazy to call setSubImage() six times */
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::direct_state_access>())
CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
CubeMapTexture texture;
@ -1073,7 +1073,7 @@ void CubeMapTextureGLTest::compressedSubImageQueryBuffer() {
/* Test also without compressed pixel storage to ensure that both size
computations work */
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 0}, {4, 4, 1}), {}, BufferUsage::StaticRead);
const auto imageData = image.buffer().data<UnsignedByte>();

28
src/Magnum/Test/DebugOutputGLTest.cpp

@ -61,7 +61,7 @@ DebugOutputGLTest::DebugOutputGLTest() {
}
void DebugOutputGLTest::setCallback() {
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>())
CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is not supported"));
/* Need to be careful, because the test runner is using debug output too */
@ -71,7 +71,7 @@ void DebugOutputGLTest::setCallback() {
}
void DebugOutputGLTest::setEnabled() {
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>())
CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is not supported"));
/* Try at least some combinations */
@ -83,10 +83,10 @@ void DebugOutputGLTest::setEnabled() {
}
void DebugOutputGLTest::messageNoOp() {
if(Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>() ||
Context::current()->isExtensionSupported<Extensions::GL::EXT::debug_marker>()
if(Context::current().isExtensionSupported<Extensions::GL::KHR::debug>() ||
Context::current().isExtensionSupported<Extensions::GL::EXT::debug_marker>()
#ifndef MAGNUM_TARGET_GLES
|| Context::current()->isExtensionSupported<Extensions::GL::GREMEDY::string_marker>()
|| Context::current().isExtensionSupported<Extensions::GL::GREMEDY::string_marker>()
#endif
)
CORRADE_SKIP("The extensions are supported, cannot test.");
@ -98,7 +98,7 @@ void DebugOutputGLTest::messageNoOp() {
}
void DebugOutputGLTest::message() {
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>())
CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is not supported"));
/* Need to be careful, because the test runner is using debug output too */
@ -113,10 +113,10 @@ void DebugOutputGLTest::message() {
}
void DebugOutputGLTest::messageFallback() {
if(Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>() ||
(!Context::current()->isExtensionSupported<Extensions::GL::EXT::debug_marker>()
if(Context::current().isExtensionSupported<Extensions::GL::KHR::debug>() ||
(!Context::current().isExtensionSupported<Extensions::GL::EXT::debug_marker>()
#ifndef MAGNUM_TARGET_GLES
&& !Context::current()->isExtensionSupported<Extensions::GL::GREMEDY::string_marker>()
&& !Context::current().isExtensionSupported<Extensions::GL::GREMEDY::string_marker>()
#endif
))
CORRADE_SKIP("No proper extension is supported");
@ -128,8 +128,8 @@ void DebugOutputGLTest::messageFallback() {
}
void DebugOutputGLTest::groupNoOp() {
if(Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>() ||
Context::current()->isExtensionSupported<Extensions::GL::EXT::debug_marker>())
if(Context::current().isExtensionSupported<Extensions::GL::KHR::debug>() ||
Context::current().isExtensionSupported<Extensions::GL::EXT::debug_marker>())
CORRADE_SKIP("The extensions are supported, cannot test.");
{
@ -140,7 +140,7 @@ void DebugOutputGLTest::groupNoOp() {
}
void DebugOutputGLTest::group() {
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>())
CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is not supported"));
/* Need to be careful, because the test runner is using debug output too */
@ -162,8 +162,8 @@ void DebugOutputGLTest::group() {
}
void DebugOutputGLTest::groupFallback() {
if(Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>() ||
!Context::current()->isExtensionSupported<Extensions::GL::EXT::debug_marker>())
if(Context::current().isExtensionSupported<Extensions::GL::KHR::debug>() ||
!Context::current().isExtensionSupported<Extensions::GL::EXT::debug_marker>())
CORRADE_SKIP("No proper extension is supported");
{

154
src/Magnum/Test/FramebufferGLTest.cpp

@ -177,7 +177,7 @@ FramebufferGLTest::FramebufferGLTest() {
&FramebufferGLTest::blit});
#ifdef MAGNUM_TARGET_GLES2
if(Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_storage>()) {
if(Context::current().isExtensionSupported<Extensions::GL::EXT::texture_storage>()) {
rgbaFormatES2 = TextureFormat::RGBA8;
depthStencilFormatES2 = TextureFormat::Depth24Stencil8;
} else {
@ -189,7 +189,7 @@ FramebufferGLTest::FramebufferGLTest() {
void FramebufferGLTest::construct() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
@ -222,7 +222,7 @@ void FramebufferGLTest::constructCopy() {
void FramebufferGLTest::constructMove() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
@ -251,7 +251,7 @@ void FramebufferGLTest::constructMove() {
void FramebufferGLTest::wrap() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
@ -271,13 +271,13 @@ void FramebufferGLTest::wrap() {
void FramebufferGLTest::label() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
/* No-Op version is tested in AbstractObjectGLTest */
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current()->isExtensionSupported<Extensions::GL::EXT::debug_label>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::debug_label>())
CORRADE_SKIP("Required extension is not available");
Framebuffer framebuffer({{}, Vector2i(32)});
@ -293,7 +293,7 @@ void FramebufferGLTest::label() {
void FramebufferGLTest::attachRenderbuffer() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
@ -308,7 +308,7 @@ void FramebufferGLTest::attachRenderbuffer() {
on my NVidia, thus we need to do this juggling with one renderbuffer */
Renderbuffer depthStencil;
#ifdef MAGNUM_TARGET_GLES2
if(Context::current()->isExtensionSupported<Extensions::GL::OES::packed_depth_stencil>())
if(Context::current().isExtensionSupported<Extensions::GL::OES::packed_depth_stencil>())
#endif
{
#ifdef MAGNUM_TARGET_GLES2
@ -325,7 +325,7 @@ void FramebufferGLTest::attachRenderbuffer() {
.attachRenderbuffer(Framebuffer::BufferAttachment::Depth, depthStencil);
#ifdef MAGNUM_TARGET_GLES2
if(Context::current()->isExtensionSupported<Extensions::GL::OES::packed_depth_stencil>())
if(Context::current().isExtensionSupported<Extensions::GL::OES::packed_depth_stencil>())
#endif
{
framebuffer.attachRenderbuffer(Framebuffer::BufferAttachment::Stencil, depthStencil);
@ -338,11 +338,11 @@ void FramebufferGLTest::attachRenderbuffer() {
void FramebufferGLTest::attachRenderbufferMultisample() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#elif defined(MAGNUM_TARGET_GLES2)
if(!Context::current()->isExtensionSupported<Extensions::GL::ANGLE::framebuffer_multisample>() &&
!Context::current()->isExtensionSupported<Extensions::GL::NV::framebuffer_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ANGLE::framebuffer_multisample>() &&
!Context::current().isExtensionSupported<Extensions::GL::NV::framebuffer_multisample>())
CORRADE_SKIP("Required extension is not available.");
#endif
@ -376,7 +376,7 @@ void FramebufferGLTest::attachRenderbufferMultisample() {
#ifndef MAGNUM_TARGET_GLES
void FramebufferGLTest::attachTexture1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
Texture1D color;
@ -397,7 +397,7 @@ void FramebufferGLTest::attachTexture1D() {
void FramebufferGLTest::attachTexture2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
@ -421,7 +421,7 @@ void FramebufferGLTest::attachTexture2D() {
MAGNUM_VERIFY_NO_ERROR();
#ifdef MAGNUM_TARGET_GLES2
if(Context::current()->isExtensionSupported<Extensions::GL::OES::packed_depth_stencil>())
if(Context::current().isExtensionSupported<Extensions::GL::OES::packed_depth_stencil>())
#endif
{
#ifdef MAGNUM_TARGET_GLES2
@ -441,7 +441,7 @@ void FramebufferGLTest::attachTexture2D() {
}
#ifdef MAGNUM_TARGET_GLES2
else if(Context::current()->isExtensionSupported<Extensions::GL::OES::depth_texture>()) {
else if(Context::current().isExtensionSupported<Extensions::GL::OES::depth_texture>()) {
Debug() << "Using" << Extensions::GL::OES::depth_texture::string();
Texture2D depth;
@ -457,10 +457,10 @@ void FramebufferGLTest::attachTexture2D() {
void FramebufferGLTest::attachTexture3D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#elif defined(MAGNUM_TARGET_GLES2)
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_3D>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_3D>())
CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not available."));
#endif
@ -481,7 +481,7 @@ void FramebufferGLTest::attachTexture3D() {
#ifndef MAGNUM_TARGET_GLES
void FramebufferGLTest::attachTexture1DArray() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
Texture1DArray color;
@ -503,9 +503,9 @@ void FramebufferGLTest::attachTexture1DArray() {
#ifndef MAGNUM_TARGET_GLES2
void FramebufferGLTest::attachTexture2DArray() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not available."));
#endif
@ -528,12 +528,12 @@ void FramebufferGLTest::attachTexture2DArray() {
#ifndef MAGNUM_TARGET_GLES2
void FramebufferGLTest::attachTexture2DMultisample() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not available."));
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 is not supported.");
#endif
@ -556,12 +556,12 @@ void FramebufferGLTest::attachTexture2DMultisample() {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void FramebufferGLTest::attachTexture2DMultisampleArray() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not available."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not available."));
#endif
@ -583,9 +583,9 @@ void FramebufferGLTest::attachTexture2DMultisampleArray() {
#ifndef MAGNUM_TARGET_GLES
void FramebufferGLTest::attachRectangleTexture() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not available."));
RectangleTexture color;
@ -606,7 +606,7 @@ void FramebufferGLTest::attachRectangleTexture() {
void FramebufferGLTest::attachCubeMapTexture() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
@ -623,7 +623,7 @@ void FramebufferGLTest::attachCubeMapTexture() {
CubeMapTexture depthStencil;
#ifdef MAGNUM_TARGET_GLES2
if(Context::current()->isExtensionSupported<Extensions::GL::OES::packed_depth_stencil>())
if(Context::current().isExtensionSupported<Extensions::GL::OES::packed_depth_stencil>())
#endif
{
#ifdef MAGNUM_TARGET_GLES2
@ -641,7 +641,7 @@ void FramebufferGLTest::attachCubeMapTexture() {
}
#ifdef MAGNUM_TARGET_GLES2
else if(Context::current()->isExtensionSupported<Extensions::GL::OES::depth_texture>()) {
else if(Context::current().isExtensionSupported<Extensions::GL::OES::depth_texture>()) {
Debug() << "Using" << Extensions::GL::OES::depth_texture::string();
depthStencil.setStorage(1, TextureFormat::DepthComponent16, Vector2i(128));
@ -657,12 +657,12 @@ void FramebufferGLTest::attachCubeMapTexture() {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void FramebufferGLTest::attachCubeMapTextureArray() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not available."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not available."));
#endif
@ -685,12 +685,12 @@ void FramebufferGLTest::attachCubeMapTextureArray() {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void FramebufferGLTest::attachLayeredTexture3D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not available."));
#endif
@ -707,9 +707,9 @@ void FramebufferGLTest::attachLayeredTexture3D() {
#ifndef MAGNUM_TARGET_GLES
void FramebufferGLTest::attachLayeredTexture1DArray() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available."));
Texture1DArray color;
@ -730,12 +730,12 @@ void FramebufferGLTest::attachLayeredTexture1DArray() {
void FramebufferGLTest::attachLayeredTexture2DArray() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not available."));
#endif
@ -756,12 +756,12 @@ void FramebufferGLTest::attachLayeredTexture2DArray() {
void FramebufferGLTest::attachLayeredCubeMapTexture() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not available."));
#endif
@ -782,16 +782,16 @@ void FramebufferGLTest::attachLayeredCubeMapTexture() {
void FramebufferGLTest::attachLayeredCubeMapTextureArray() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not available."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not available."));
#endif
@ -812,16 +812,16 @@ void FramebufferGLTest::attachLayeredCubeMapTextureArray() {
void FramebufferGLTest::attachLayeredTexture2DMultisampleArray() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::geometry_shader4>())
CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not available."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::geometry_shader>())
CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not available."));
#endif
@ -843,7 +843,7 @@ void FramebufferGLTest::attachLayeredTexture2DMultisampleArray() {
void FramebufferGLTest::detach() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
@ -857,11 +857,11 @@ void FramebufferGLTest::detach() {
void FramebufferGLTest::multipleColorOutputs() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#elif defined(MAGNUM_TARGET_GLES2)
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::draw_buffers>() &&
!Context::current()->isExtensionSupported<Extensions::GL::NV::draw_buffers>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::draw_buffers>() &&
!Context::current().isExtensionSupported<Extensions::GL::NV::draw_buffers>())
CORRADE_SKIP("No required extension available.");
#endif
@ -890,7 +890,7 @@ void FramebufferGLTest::multipleColorOutputs() {
{1, Framebuffer::ColorAttachment(0)}});
#ifdef MAGNUM_TARGET_GLES2
if(Context::current()->isExtensionSupported<Extensions::GL::NV::read_buffer>())
if(Context::current().isExtensionSupported<Extensions::GL::NV::read_buffer>())
#endif
{
#ifdef MAGNUM_TARGET_GLES2
@ -906,7 +906,7 @@ void FramebufferGLTest::multipleColorOutputs() {
void FramebufferGLTest::clear() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
@ -921,7 +921,7 @@ void FramebufferGLTest::clear() {
on my NVidia, thus we need to do this juggling with one renderbuffer */
Renderbuffer depthStencil;
#ifdef MAGNUM_TARGET_GLES2
if(Context::current()->isExtensionSupported<Extensions::GL::OES::packed_depth_stencil>())
if(Context::current().isExtensionSupported<Extensions::GL::OES::packed_depth_stencil>())
#endif
{
#ifdef MAGNUM_TARGET_GLES2
@ -938,7 +938,7 @@ void FramebufferGLTest::clear() {
.attachRenderbuffer(Framebuffer::BufferAttachment::Depth, depthStencil);
#ifdef MAGNUM_TARGET_GLES2
if(Context::current()->isExtensionSupported<Extensions::GL::OES::packed_depth_stencil>())
if(Context::current().isExtensionSupported<Extensions::GL::OES::packed_depth_stencil>())
#endif
{
framebuffer.attachRenderbuffer(Framebuffer::BufferAttachment::Stencil, depthStencil);
@ -954,7 +954,7 @@ void FramebufferGLTest::clear() {
void FramebufferGLTest::invalidate() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
@ -982,7 +982,7 @@ void FramebufferGLTest::invalidate() {
#ifndef MAGNUM_TARGET_GLES2
void FramebufferGLTest::invalidateSub() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
@ -1014,7 +1014,7 @@ namespace {
void FramebufferGLTest::read() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
@ -1029,7 +1029,7 @@ void FramebufferGLTest::read() {
on my NVidia, thus we need to do this juggling with one renderbuffer */
Renderbuffer depthStencil;
#ifdef MAGNUM_TARGET_GLES2
if(Context::current()->isExtensionSupported<Extensions::GL::OES::packed_depth_stencil>())
if(Context::current().isExtensionSupported<Extensions::GL::OES::packed_depth_stencil>())
#endif
{
#ifdef MAGNUM_TARGET_GLES2
@ -1046,7 +1046,7 @@ void FramebufferGLTest::read() {
.attachRenderbuffer(Framebuffer::BufferAttachment::Depth, depthStencil);
#ifdef MAGNUM_TARGET_GLES2
if(Context::current()->isExtensionSupported<Extensions::GL::OES::packed_depth_stencil>())
if(Context::current().isExtensionSupported<Extensions::GL::OES::packed_depth_stencil>())
#endif
{
framebuffer.attachRenderbuffer(Framebuffer::BufferAttachment::Stencil, depthStencil);
@ -1070,7 +1070,7 @@ void FramebufferGLTest::read() {
CORRADE_COMPARE(colorImage.data<Color4ub>()[DataOffset], Color4ub(128, 64, 32, 17));
#ifdef MAGNUM_TARGET_GLES
if(Context::current()->isExtensionSupported<Extensions::GL::NV::read_depth>())
if(Context::current().isExtensionSupported<Extensions::GL::NV::read_depth>())
#endif
{
#ifdef MAGNUM_TARGET_GLES
@ -1084,7 +1084,7 @@ void FramebufferGLTest::read() {
}
#ifdef MAGNUM_TARGET_GLES
if(Context::current()->isExtensionSupported<Extensions::GL::NV::read_stencil>())
if(Context::current().isExtensionSupported<Extensions::GL::NV::read_stencil>())
#endif
{
#ifdef MAGNUM_TARGET_GLES
@ -1098,7 +1098,7 @@ void FramebufferGLTest::read() {
}
#ifdef MAGNUM_TARGET_GLES
if(Context::current()->isExtensionSupported<Extensions::GL::NV::read_depth_stencil>())
if(Context::current().isExtensionSupported<Extensions::GL::NV::read_depth_stencil>())
#endif
{
#ifdef MAGNUM_TARGET_GLES
@ -1117,7 +1117,7 @@ void FramebufferGLTest::read() {
#ifndef MAGNUM_TARGET_GLES2
void FramebufferGLTest::readBuffer() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
@ -1156,11 +1156,11 @@ void FramebufferGLTest::readBuffer() {
void FramebufferGLTest::blit() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#elif defined(MAGNUM_TARGET_GLES2)
if(!Context::current()->isExtensionSupported<Extensions::GL::NV::framebuffer_blit>() &&
!Context::current()->isExtensionSupported<Extensions::GL::ANGLE::framebuffer_blit>())
if(!Context::current().isExtensionSupported<Extensions::GL::NV::framebuffer_blit>() &&
!Context::current().isExtensionSupported<Extensions::GL::ANGLE::framebuffer_blit>())
CORRADE_SKIP("Required extension is not available.");
#endif

120
src/Magnum/Test/MeshGLTest.cpp

@ -237,9 +237,9 @@ void MeshGLTest::construct() {
MAGNUM_VERIFY_NO_ERROR();
#ifndef MAGNUM_TARGET_GLES
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::vertex_array_object>())
if(Context::current().isExtensionSupported<Extensions::GL::ARB::vertex_array_object>())
#elif defined(MAGNUM_TARGET_GLES2)
if(Context::current()->isExtensionSupported<Extensions::GL::OES::vertex_array_object>())
if(Context::current().isExtensionSupported<Extensions::GL::OES::vertex_array_object>())
#endif
{
CORRADE_VERIFY(mesh.id() > 0);
@ -272,9 +272,9 @@ void MeshGLTest::constructMove() {
MAGNUM_VERIFY_NO_ERROR();
#ifndef MAGNUM_TARGET_GLES
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::vertex_array_object>())
if(Context::current().isExtensionSupported<Extensions::GL::ARB::vertex_array_object>())
#elif defined(MAGNUM_TARGET_GLES2)
if(Context::current()->isExtensionSupported<Extensions::GL::OES::vertex_array_object>())
if(Context::current().isExtensionSupported<Extensions::GL::OES::vertex_array_object>())
#endif
{
CORRADE_VERIFY(id > 0);
@ -292,9 +292,9 @@ void MeshGLTest::constructMove() {
MAGNUM_VERIFY_NO_ERROR();
#ifndef MAGNUM_TARGET_GLES
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::vertex_array_object>())
if(Context::current().isExtensionSupported<Extensions::GL::ARB::vertex_array_object>())
#elif defined(MAGNUM_TARGET_GLES2)
if(Context::current()->isExtensionSupported<Extensions::GL::OES::vertex_array_object>())
if(Context::current().isExtensionSupported<Extensions::GL::OES::vertex_array_object>())
#endif
{
CORRADE_VERIFY(cId > 0);
@ -306,10 +306,10 @@ void MeshGLTest::constructMove() {
void MeshGLTest::wrap() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::vertex_array_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::vertex_array_object>())
CORRADE_SKIP(Extensions::GL::ARB::vertex_array_object::string() + std::string{" is not supported."});
#elif defined(MAGNUM_TARGET_GLES2)
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::vertex_array_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::vertex_array_object>())
CORRADE_SKIP(Extensions::GL::OES::vertex_array_object::string() + std::string{" is not supported."});
#endif
@ -337,8 +337,8 @@ void MeshGLTest::wrap() {
void MeshGLTest::label() {
/* No-Op version is tested in AbstractObjectGLTest */
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current()->isExtensionSupported<Extensions::GL::EXT::debug_label>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::debug_label>())
CORRADE_SKIP("Required extension is not available");
Mesh mesh;
@ -514,7 +514,7 @@ template<class T> T Checker::get(PixelFormat format, PixelType type) {
#ifndef MAGNUM_TARGET_GLES2
void MeshGLTest::addVertexBufferUnsignedInt() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available."));
#endif
@ -539,7 +539,7 @@ void MeshGLTest::addVertexBufferUnsignedInt() {
void MeshGLTest::addVertexBufferInt() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available."));
#endif
@ -590,7 +590,7 @@ void MeshGLTest::addVertexBufferFloat() {
#ifndef MAGNUM_TARGET_GLES
void MeshGLTest::addVertexBufferDouble() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::vertex_attrib_64bit>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::vertex_attrib_64bit>())
CORRADE_SKIP(Extensions::GL::ARB::vertex_attrib_64bit::string() + std::string(" is not available."));
typedef Attribute<0, Double> Attribute;
@ -616,7 +616,7 @@ void MeshGLTest::addVertexBufferDouble() {
#ifndef MAGNUM_TARGET_GLES2
void MeshGLTest::addVertexBufferVectorNui() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available."));
#endif
@ -641,7 +641,7 @@ void MeshGLTest::addVertexBufferVectorNui() {
void MeshGLTest::addVertexBufferVectorNi() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available."));
#endif
@ -692,7 +692,7 @@ void MeshGLTest::addVertexBufferVectorN() {
#ifndef MAGNUM_TARGET_GLES
void MeshGLTest::addVertexBufferVectorNd() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::vertex_attrib_64bit>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::vertex_attrib_64bit>())
CORRADE_SKIP(Extensions::GL::ARB::vertex_attrib_64bit::string() + std::string(" is not available."));
typedef Attribute<0, Vector4d> Attribute;
@ -745,7 +745,7 @@ void MeshGLTest::addVertexBufferMatrixNxN() {
#ifndef MAGNUM_TARGET_GLES
void MeshGLTest::addVertexBufferMatrixNxNd() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::vertex_attrib_64bit>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::vertex_attrib_64bit>())
CORRADE_SKIP(Extensions::GL::ARB::vertex_attrib_64bit::string() + std::string(" is not available."));
typedef Attribute<0, Matrix3x3d> Attribute;
@ -810,7 +810,7 @@ void MeshGLTest::addVertexBufferMatrixMxN() {
#ifndef MAGNUM_TARGET_GLES
void MeshGLTest::addVertexBufferMatrixMxNd() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::vertex_attrib_64bit>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::vertex_attrib_64bit>())
CORRADE_SKIP(Extensions::GL::ARB::vertex_attrib_64bit::string() + std::string(" is not available."));
typedef Attribute<0, Matrix3x4d> Attribute;
@ -849,7 +849,7 @@ void MeshGLTest::addVertexBufferMatrixMxNd() {
#ifndef MAGNUM_TARGET_GLES2
void MeshGLTest::addVertexBufferUnsignedIntWithUnsignedShort() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available."));
#endif
@ -874,7 +874,7 @@ void MeshGLTest::addVertexBufferUnsignedIntWithUnsignedShort() {
void MeshGLTest::addVertexBufferUnsignedIntWithShort() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available."));
#endif
@ -899,7 +899,7 @@ void MeshGLTest::addVertexBufferUnsignedIntWithShort() {
void MeshGLTest::addVertexBufferIntWithUnsignedShort() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available."));
#endif
@ -924,7 +924,7 @@ void MeshGLTest::addVertexBufferIntWithUnsignedShort() {
void MeshGLTest::addVertexBufferIntWithShort() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available."));
#endif
@ -950,10 +950,10 @@ void MeshGLTest::addVertexBufferIntWithShort() {
void MeshGLTest::addVertexBufferFloatWithHalfFloat() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::half_float_vertex>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::half_float_vertex>())
CORRADE_SKIP(Extensions::GL::ARB::half_float_vertex::string() + std::string(" is not supported."));
#elif defined(MAGNUM_TARGET_GLES2)
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::vertex_half_float>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::vertex_half_float>())
CORRADE_SKIP(Extensions::GL::OES::vertex_half_float::string() + std::string(" is not supported."));
#endif
@ -993,7 +993,7 @@ void MeshGLTest::addVertexBufferFloatWithDouble() {
void MeshGLTest::addVertexBufferVector3WithUnsignedInt10f11f11fRev() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::vertex_type_10f_11f_11f_rev>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::vertex_type_10f_11f_11f_rev>())
CORRADE_SKIP(Extensions::GL::ARB::vertex_type_10f_11f_11f_rev::string() + std::string(" is not available."));
#endif
@ -1014,7 +1014,7 @@ void MeshGLTest::addVertexBufferVector3WithUnsignedInt10f11f11fRev() {
#ifndef MAGNUM_TARGET_GLES2
void MeshGLTest::addVertexBufferVector4WithUnsignedInt2101010Rev() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::vertex_type_2_10_10_10_rev>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::vertex_type_2_10_10_10_rev>())
CORRADE_SKIP(Extensions::GL::ARB::vertex_type_2_10_10_10_rev::string() + std::string(" is not available."));
#endif
@ -1033,7 +1033,7 @@ void MeshGLTest::addVertexBufferVector4WithUnsignedInt2101010Rev() {
void MeshGLTest::addVertexBufferVector4WithInt2101010Rev() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::vertex_type_2_10_10_10_rev>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::vertex_type_2_10_10_10_rev>())
CORRADE_SKIP(Extensions::GL::ARB::vertex_type_2_10_10_10_rev::string() + std::string(" is not available."));
#endif
@ -1107,7 +1107,7 @@ void MeshGLTest::addVertexBufferNormalized() {
#ifndef MAGNUM_TARGET_GLES
void MeshGLTest::addVertexBufferBGRA() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::vertex_array_bgra>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::vertex_array_bgra>())
CORRADE_SKIP(Extensions::GL::ARB::vertex_array_bgra::string() + std::string(" is not available."));
#endif
@ -1375,7 +1375,7 @@ void MeshGLTest::setIndexBufferRange() {
void MeshGLTest::setIndexBufferUnsignedInt() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::element_index_uint>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::element_index_uint>())
CORRADE_SKIP(Extensions::GL::OES::element_index_uint::string() + std::string(" is not available."));
#endif
@ -1407,7 +1407,7 @@ void MeshGLTest::setIndexBufferUnsignedInt() {
#ifndef MAGNUM_TARGET_GLES
void MeshGLTest::setBaseVertex() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::draw_elements_base_vertex>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::draw_elements_base_vertex>())
CORRADE_SKIP(Extensions::GL::ARB::draw_elements_base_vertex::string() + std::string(" is not available."));
Buffer vertices;
@ -1440,10 +1440,12 @@ void MeshGLTest::setInstanceCount() {
it didn't generate any error and rendered something */
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available."));
#elif defined(MAGNUM_TARGET_GLES2)
if(!Context::current()->isExtensionSupported<Extensions::GL::ANGLE::instanced_arrays>() && !Context::current()->isExtensionSupported<Extensions::GL::EXT::draw_instanced>() && !Context::current()->isExtensionSupported<Extensions::GL::NV::draw_instanced>())
if(!Context::current().isExtensionSupported<Extensions::GL::ANGLE::instanced_arrays>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::draw_instanced>() &&
!Context::current().isExtensionSupported<Extensions::GL::NV::draw_instanced>())
CORRADE_SKIP("Required extension is not available.");
#endif
@ -1479,10 +1481,12 @@ void MeshGLTest::setInstanceCountIndexed() {
it didn't generate any error and rendered something */
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available."));
#elif defined(MAGNUM_TARGET_GLES2)
if(!Context::current()->isExtensionSupported<Extensions::GL::ANGLE::instanced_arrays>() && !Context::current()->isExtensionSupported<Extensions::GL::EXT::draw_instanced>() && !Context::current()->isExtensionSupported<Extensions::GL::NV::draw_instanced>())
if(!Context::current().isExtensionSupported<Extensions::GL::ANGLE::instanced_arrays>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::draw_instanced>() &&
!Context::current().isExtensionSupported<Extensions::GL::NV::draw_instanced>())
CORRADE_SKIP("Required extension is not available.");
#endif
@ -1520,9 +1524,9 @@ void MeshGLTest::setInstanceCountBaseInstance() {
value. I'm too lazy to invent proper test case, so I'll just check that
it didn't generate any error and rendered something */
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::base_instance>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::base_instance>())
CORRADE_SKIP(Extensions::GL::ARB::base_instance::string() + std::string(" is not available."));
typedef Attribute<0, Float> Attribute;
@ -1553,9 +1557,9 @@ void MeshGLTest::setInstanceCountBaseInstanceIndexed() {
same value. I'm too lazy to invent proper test case, so I'll just check
that it didn't generate any error and rendered something */
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::base_instance>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::base_instance>())
CORRADE_SKIP(Extensions::GL::ARB::base_instance::string() + std::string(" is not available."));
Buffer vertices;
@ -1587,9 +1591,9 @@ void MeshGLTest::setInstanceCountBaseVertex() {
value. I'm too lazy to invent proper test case, so I'll just check
that it didn't generate any error and rendered something */
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::draw_elements_base_vertex>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::draw_elements_base_vertex>())
CORRADE_SKIP(Extensions::GL::ARB::draw_elements_base_vertex::string() + std::string(" is not available."));
Buffer vertices;
@ -1621,11 +1625,11 @@ void MeshGLTest::setInstanceCountBaseVertexBaseInstance() {
value. I'm too lazy to invent proper test case, so I'll just check
that it didn't generate any error and rendered something */
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::draw_elements_base_vertex>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::draw_elements_base_vertex>())
CORRADE_SKIP(Extensions::GL::ARB::draw_elements_base_vertex::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::base_instance>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::base_instance>())
CORRADE_SKIP(Extensions::GL::ARB::base_instance::string() + std::string(" is not available."));
Buffer vertices;
@ -1655,14 +1659,18 @@ void MeshGLTest::setInstanceCountBaseVertexBaseInstance() {
void MeshGLTest::addVertexBufferInstancedFloat() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::instanced_arrays>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::instanced_arrays>())
CORRADE_SKIP(Extensions::GL::ARB::instanced_arrays::string() + std::string(" is not available."));
#elif defined(MAGNUM_TARGET_GLES2)
if(!Context::current()->isExtensionSupported<Extensions::GL::ANGLE::instanced_arrays>() && !Context::current()->isExtensionSupported<Extensions::GL::EXT::instanced_arrays>() && !Context::current()->isExtensionSupported<Extensions::GL::NV::instanced_arrays>())
if(!Context::current().isExtensionSupported<Extensions::GL::ANGLE::instanced_arrays>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::instanced_arrays>() &&
!Context::current().isExtensionSupported<Extensions::GL::NV::instanced_arrays>())
CORRADE_SKIP("Required instancing extension is not available.");
if(!Context::current()->isExtensionSupported<Extensions::GL::ANGLE::instanced_arrays>() && !Context::current()->isExtensionSupported<Extensions::GL::EXT::draw_instanced>() && !Context::current()->isExtensionSupported<Extensions::GL::NV::draw_instanced>())
if(!Context::current().isExtensionSupported<Extensions::GL::ANGLE::instanced_arrays>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::draw_instanced>() &&
!Context::current().isExtensionSupported<Extensions::GL::NV::draw_instanced>())
CORRADE_SKIP("Required drawing extension is not available.");
#endif
@ -1699,11 +1707,11 @@ void MeshGLTest::addVertexBufferInstancedFloat() {
#ifndef MAGNUM_TARGET_GLES2
void MeshGLTest::addVertexBufferInstancedInteger() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::instanced_arrays>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::instanced_arrays>())
CORRADE_SKIP(Extensions::GL::ARB::instanced_arrays::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::gpu_shader4>())
CORRADE_SKIP(Extensions::GL::EXT::gpu_shader4::string() + std::string(" is not available."));
#endif
@ -1735,11 +1743,11 @@ void MeshGLTest::addVertexBufferInstancedInteger() {
#ifndef MAGNUM_TARGET_GLES
void MeshGLTest::addVertexBufferInstancedDouble() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::draw_instanced>())
CORRADE_SKIP(Extensions::GL::ARB::draw_instanced::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::instanced_arrays>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::instanced_arrays>())
CORRADE_SKIP(Extensions::GL::ARB::instanced_arrays::string() + std::string(" is not available."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::vertex_attrib_64bit>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::vertex_attrib_64bit>())
CORRADE_SKIP(Extensions::GL::ARB::vertex_attrib_64bit::string() + std::string(" is not available."));
typedef Attribute<0, Double> Attribute;
@ -1816,7 +1824,7 @@ template<class T> T MultiChecker::get(PixelFormat format, PixelType type) {
void MeshGLTest::multiDraw() {
#ifdef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::multi_draw_arrays>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::multi_draw_arrays>())
Debug() << Extensions::GL::EXT::multi_draw_arrays::string() << "not supported, using fallback implementation";
#endif
@ -1840,7 +1848,7 @@ void MeshGLTest::multiDraw() {
void MeshGLTest::multiDrawIndexed() {
#ifdef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::multi_draw_arrays>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::multi_draw_arrays>())
Debug() << Extensions::GL::EXT::multi_draw_arrays::string() << "not supported, using fallback implementation";
#endif
@ -1866,7 +1874,7 @@ void MeshGLTest::multiDrawIndexed() {
#ifndef MAGNUM_TARGET_GLES
void MeshGLTest::multiDrawBaseVertex() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::draw_elements_base_vertex>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::draw_elements_base_vertex>())
CORRADE_SKIP(Extensions::GL::ARB::draw_elements_base_vertex::string() + std::string(" is not available."));
Buffer vertices;

48
src/Magnum/Test/MultisampleTextureGLTest.cpp

@ -82,10 +82,10 @@ MultisampleTextureGLTest::MultisampleTextureGLTest() {
void MultisampleTextureGLTest::construct2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 is not supported.");
#endif
@ -112,10 +112,10 @@ void MultisampleTextureGLTest::construct2DNoCreate() {
void MultisampleTextureGLTest::construct2DArray() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported."));
#endif
@ -142,10 +142,10 @@ void MultisampleTextureGLTest::construct2DArrayNoCreate() {
void MultisampleTextureGLTest::wrap2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string{" is not supported."});
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 is not supported.");
#endif
@ -165,10 +165,10 @@ void MultisampleTextureGLTest::wrap2D() {
void MultisampleTextureGLTest::wrap2DArray() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported."));
#endif
@ -188,10 +188,10 @@ void MultisampleTextureGLTest::wrap2DArray() {
void MultisampleTextureGLTest::bind2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 is not supported.");
#endif
@ -215,10 +215,10 @@ void MultisampleTextureGLTest::bind2D() {
void MultisampleTextureGLTest::bind2DArray() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported."));
#endif
@ -242,10 +242,10 @@ void MultisampleTextureGLTest::bind2DArray() {
void MultisampleTextureGLTest::storage2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 is not supported.");
#endif
@ -261,10 +261,10 @@ void MultisampleTextureGLTest::storage2D() {
void MultisampleTextureGLTest::storage2DArray() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported."));
#endif
@ -280,10 +280,10 @@ void MultisampleTextureGLTest::storage2DArray() {
void MultisampleTextureGLTest::invalidateImage2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 is not supported.");
#endif
@ -296,10 +296,10 @@ void MultisampleTextureGLTest::invalidateImage2D() {
void MultisampleTextureGLTest::invalidateImage2DArray() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported."));
#endif
@ -312,10 +312,10 @@ void MultisampleTextureGLTest::invalidateImage2DArray() {
void MultisampleTextureGLTest::invalidateSubImage2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 is not supported.");
#endif
@ -328,10 +328,10 @@ void MultisampleTextureGLTest::invalidateSubImage2D() {
void MultisampleTextureGLTest::invalidateSubImage2DArray() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_multisample>())
CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_storage_multisample_2d_array>())
CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported."));
#endif

12
src/Magnum/Test/PixelStorageGLTest.cpp

@ -102,7 +102,7 @@ namespace {
void PixelStorageGLTest::unpack2D() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::unpack_subimage>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::unpack_subimage>())
CORRADE_SKIP(Extensions::GL::EXT::unpack_subimage::string() + std::string(" is not supported."));
#endif
@ -140,7 +140,7 @@ void PixelStorageGLTest::unpack2D() {
void PixelStorageGLTest::pack2D() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::NV::pack_subimage>())
if(!Context::current().isExtensionSupported<Extensions::GL::NV::pack_subimage>())
CORRADE_SKIP(Extensions::GL::NV::pack_subimage::string() + std::string(" is not supported."));
#endif
@ -288,7 +288,7 @@ namespace {
}
void PixelStorageGLTest::unpackCompressed2D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>())
CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported."));
CompressedPixelStorage storage;
@ -315,7 +315,7 @@ void PixelStorageGLTest::unpackCompressed2D() {
}
void PixelStorageGLTest::packCompressed2D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>())
CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported."));
CompressedImageView2D actual{CompressedPixelFormat::RGBAS3tcDxt3, {4, 4}, ActualCompressedData};
@ -396,7 +396,7 @@ namespace {
}
void PixelStorageGLTest::unpackCompressed3D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>())
CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported."));
CompressedPixelStorage storage;
@ -424,7 +424,7 @@ void PixelStorageGLTest::unpackCompressed3D() {
}
void PixelStorageGLTest::packCompressed3D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>())
CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported."));
CompressedImageView3D actual{CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 1}, ActualCompressedData};

6
src/Magnum/Test/PrimitiveQueryGLTest.cpp

@ -72,7 +72,7 @@ void PrimitiveQueryGLTest::constructNoCreate() {
void PrimitiveQueryGLTest::wrap() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not available."));
#endif
@ -92,7 +92,7 @@ void PrimitiveQueryGLTest::wrap() {
#ifndef MAGNUM_TARGET_GLES
void PrimitiveQueryGLTest::primitivesGenerated() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::transform_feedback>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::transform_feedback>())
CORRADE_SKIP(Extensions::GL::EXT::transform_feedback::string() + std::string(" is not available."));
struct MyShader: AbstractShaderProgram {
@ -146,7 +146,7 @@ void PrimitiveQueryGLTest::primitivesGenerated() {
void PrimitiveQueryGLTest::transformFeedbackPrimitivesWritten() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not available."));
#endif

46
src/Magnum/Test/RectangleTextureGLTest.cpp

@ -113,7 +113,7 @@ namespace {
}
void RectangleTextureGLTest::construct() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
{
@ -138,7 +138,7 @@ void RectangleTextureGLTest::constructNoCreate() {
}
void RectangleTextureGLTest::wrap() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
GLuint id;
@ -156,7 +156,7 @@ void RectangleTextureGLTest::wrap() {
}
void RectangleTextureGLTest::bind() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
RectangleTexture texture;
@ -178,7 +178,7 @@ void RectangleTextureGLTest::bind() {
}
void RectangleTextureGLTest::sampling() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
RectangleTexture texture;
@ -194,9 +194,9 @@ void RectangleTextureGLTest::sampling() {
}
void RectangleTextureGLTest::samplingSRGBDecode() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_sRGB_decode>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_sRGB_decode>())
CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported."));
RectangleTexture texture;
@ -206,9 +206,9 @@ void RectangleTextureGLTest::samplingSRGBDecode() {
}
void RectangleTextureGLTest::samplingBorderInteger() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_integer>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_integer>())
CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported."));
RectangleTexture a;
@ -222,9 +222,9 @@ void RectangleTextureGLTest::samplingBorderInteger() {
}
void RectangleTextureGLTest::samplingSwizzle() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_swizzle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_swizzle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported."));
RectangleTexture texture;
@ -234,9 +234,9 @@ void RectangleTextureGLTest::samplingSwizzle() {
}
void RectangleTextureGLTest::samplingDepthStencilMode() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::stencil_texturing>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::stencil_texturing>())
CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported."));
RectangleTexture texture;
@ -246,7 +246,7 @@ void RectangleTextureGLTest::samplingDepthStencilMode() {
}
void RectangleTextureGLTest::storage() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
RectangleTexture texture;
@ -270,7 +270,7 @@ namespace {
}
void RectangleTextureGLTest::image() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
RectangleTexture texture;
@ -294,7 +294,7 @@ void RectangleTextureGLTest::compressedImage() {
}
void RectangleTextureGLTest::imageBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
RectangleTexture texture;
@ -329,7 +329,7 @@ namespace {
}
void RectangleTextureGLTest::subImage() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
RectangleTexture texture;
@ -355,7 +355,7 @@ void RectangleTextureGLTest::compressedSubImage() {
}
void RectangleTextureGLTest::subImageBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
RectangleTexture texture;
@ -380,9 +380,9 @@ void RectangleTextureGLTest::compressedSubImageBuffer() {
}
void RectangleTextureGLTest::subImageQuery() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
RectangleTexture texture;
@ -407,9 +407,9 @@ void RectangleTextureGLTest::compressedSubImageQuery() {
}
void RectangleTextureGLTest::subImageQueryBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
RectangleTexture texture;
@ -434,7 +434,7 @@ void RectangleTextureGLTest::compressedSubImageQueryBuffer() {
}
void RectangleTextureGLTest::invalidateImage() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
RectangleTexture texture;
@ -445,7 +445,7 @@ void RectangleTextureGLTest::invalidateImage() {
}
void RectangleTextureGLTest::invalidateSubImage() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_rectangle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported."));
RectangleTexture texture;

20
src/Magnum/Test/RenderbufferGLTest.cpp

@ -62,7 +62,7 @@ RenderbufferGLTest::RenderbufferGLTest() {
void RenderbufferGLTest::construct() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
@ -94,7 +94,7 @@ void RenderbufferGLTest::constructCopy() {
void RenderbufferGLTest::constructMove() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
@ -121,7 +121,7 @@ void RenderbufferGLTest::constructMove() {
void RenderbufferGLTest::wrap() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
@ -141,11 +141,11 @@ void RenderbufferGLTest::wrap() {
void RenderbufferGLTest::label() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current()->isExtensionSupported<Extensions::GL::EXT::debug_label>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::debug_label>())
CORRADE_SKIP("Required extension is not available");
Renderbuffer renderbuffer;
@ -161,7 +161,7 @@ void RenderbufferGLTest::label() {
void RenderbufferGLTest::setStorage() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#endif
@ -178,11 +178,11 @@ void RenderbufferGLTest::setStorage() {
void RenderbufferGLTest::setStorageMultisample() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available."));
#elif defined(MAGNUM_TARGET_GLES2)
if(!Context::current()->isExtensionSupported<Extensions::GL::ANGLE::framebuffer_multisample>() &&
!Context::current()->isExtensionSupported<Extensions::GL::NV::framebuffer_multisample>())
if(!Context::current().isExtensionSupported<Extensions::GL::ANGLE::framebuffer_multisample>() &&
!Context::current().isExtensionSupported<Extensions::GL::NV::framebuffer_multisample>())
CORRADE_SKIP("Required extension is not available.");
#endif

6
src/Magnum/Test/SampleQueryGLTest.cpp

@ -74,7 +74,7 @@ void SampleQueryGLTest::constructNoCreate() {
void SampleQueryGLTest::wrap() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::occlusion_query_boolean>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::occlusion_query_boolean>())
CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not available."));
#endif
@ -141,7 +141,7 @@ MyShader::MyShader() {
void SampleQueryGLTest::querySamplesPassed() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::occlusion_query_boolean>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::occlusion_query_boolean>())
CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not available."));
#endif
@ -196,7 +196,7 @@ void SampleQueryGLTest::querySamplesPassed() {
#ifndef MAGNUM_TARGET_GLES
void SampleQueryGLTest::conditionalRender() {
if(!Context::current()->isExtensionSupported<Extensions::GL::NV::conditional_render>())
if(!Context::current().isExtensionSupported<Extensions::GL::NV::conditional_render>())
CORRADE_SKIP(Extensions::GL::NV::conditional_render::string() + std::string(" is not available."));
Renderbuffer renderbuffer;

4
src/Magnum/Test/ShaderGLTest.cpp

@ -137,8 +137,8 @@ void ShaderGLTest::constructMove() {
void ShaderGLTest::label() {
/* No-Op version is tested in AbstractObjectGLTest */
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current()->isExtensionSupported<Extensions::GL::EXT::debug_label>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::debug_label>())
CORRADE_SKIP("Required extension is not available");
#ifndef MAGNUM_TARGET_GLES

162
src/Magnum/Test/TextureArrayGLTest.cpp

@ -261,7 +261,7 @@ TextureArrayGLTest::TextureArrayGLTest() {
});
#ifndef MAGNUM_TARGET_GLES
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>())
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>())
{
_compressedDataStorage2D = CompressedPixelStorage{}
.setCompressedBlockSize({4, 4, 1})
@ -287,7 +287,7 @@ namespace {
#ifndef MAGNUM_TARGET_GLES
void TextureArrayGLTest::construct1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
{
@ -314,7 +314,7 @@ void TextureArrayGLTest::construct1DNoCreate() {
void TextureArrayGLTest::construct2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif
@ -358,7 +358,7 @@ void TextureArrayGLTest::wrap1D() {
void TextureArrayGLTest::wrap2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif
@ -378,7 +378,7 @@ void TextureArrayGLTest::wrap2D() {
#ifndef MAGNUM_TARGET_GLES
void TextureArrayGLTest::bind1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
Texture1DArray texture;
@ -402,7 +402,7 @@ void TextureArrayGLTest::bind1D() {
void TextureArrayGLTest::bind2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif
@ -426,7 +426,7 @@ void TextureArrayGLTest::bind2D() {
#ifndef MAGNUM_TARGET_GLES
void TextureArrayGLTest::sampling1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
Texture1DArray texture;
@ -447,9 +447,9 @@ void TextureArrayGLTest::sampling1D() {
}
void TextureArrayGLTest::samplingSRGBDecode1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_sRGB_decode>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_sRGB_decode>())
CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported."));
Texture1DArray texture;
@ -459,9 +459,9 @@ void TextureArrayGLTest::samplingSRGBDecode1D() {
}
void TextureArrayGLTest::samplingSwizzle1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_swizzle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_swizzle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported."));
Texture1DArray texture;
@ -471,9 +471,9 @@ void TextureArrayGLTest::samplingSwizzle1D() {
}
void TextureArrayGLTest::samplingBorderInteger1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_integer>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_integer>())
CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported."));
Texture1DArray a;
@ -487,9 +487,9 @@ void TextureArrayGLTest::samplingBorderInteger1D() {
}
void TextureArrayGLTest::samplingDepthStencilMode1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::stencil_texturing>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::stencil_texturing>())
CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported."));
Texture1DArray texture;
@ -501,7 +501,7 @@ void TextureArrayGLTest::samplingDepthStencilMode1D() {
void TextureArrayGLTest::sampling2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif
@ -535,10 +535,10 @@ void TextureArrayGLTest::sampling2D() {
void TextureArrayGLTest::samplingSRGBDecode2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_sRGB_decode>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_sRGB_decode>())
CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported."));
Texture2DArray texture;
@ -550,9 +550,9 @@ void TextureArrayGLTest::samplingSRGBDecode2D() {
#ifndef MAGNUM_TARGET_GLES2
void TextureArrayGLTest::samplingSwizzle2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_swizzle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_swizzle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported."));
#endif
@ -563,7 +563,7 @@ void TextureArrayGLTest::samplingSwizzle2D() {
}
#else
void TextureArrayGLTest::samplingMaxLevel2D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::APPLE::texture_max_level>())
if(!Context::current().isExtensionSupported<Extensions::GL::APPLE::texture_max_level>())
CORRADE_SKIP(Extensions::GL::APPLE::texture_max_level::string() + std::string(" is not supported."));
Texture2DArray texture;
@ -573,8 +573,8 @@ void TextureArrayGLTest::samplingMaxLevel2D() {
}
void TextureArrayGLTest::samplingCompare2D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::shadow_samplers>() ||
!Context::current()->isExtensionSupported<Extensions::GL::NV::shadow_samplers_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::shadow_samplers>() ||
!Context::current().isExtensionSupported<Extensions::GL::NV::shadow_samplers_array>())
CORRADE_SKIP(Extensions::GL::NV::shadow_samplers_array::string() + std::string(" is not supported."));
Texture2DArray texture;
@ -588,12 +588,12 @@ void TextureArrayGLTest::samplingCompare2D() {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void TextureArrayGLTest::samplingBorderInteger2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_integer>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_integer>())
CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported."));
#endif
@ -611,12 +611,12 @@ void TextureArrayGLTest::samplingBorderInteger2D() {
#ifndef MAGNUM_TARGET_GLES2
void TextureArrayGLTest::samplingDepthStencilMode2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::stencil_texturing>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::stencil_texturing>())
CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported."));
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 is not supported.");
#endif
@ -629,8 +629,8 @@ void TextureArrayGLTest::samplingDepthStencilMode2D() {
#ifdef MAGNUM_TARGET_GLES
void TextureArrayGLTest::samplingBorder2D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::NV::texture_border_clamp>() &&
!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
if(!Context::current().isExtensionSupported<Extensions::GL::NV::texture_border_clamp>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
CORRADE_SKIP("No required extension is supported.");
Texture2DArray texture;
@ -643,7 +643,7 @@ void TextureArrayGLTest::samplingBorder2D() {
#ifndef MAGNUM_TARGET_GLES
void TextureArrayGLTest::storage1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
Texture1DArray texture;
@ -664,7 +664,7 @@ void TextureArrayGLTest::storage1D() {
void TextureArrayGLTest::storage2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif
@ -675,7 +675,7 @@ void TextureArrayGLTest::storage2D() {
#ifndef MAGNUM_TARGET_GLES2
#ifdef MAGNUM_TARGET_GLES
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 not supported, skipping image size testing");
#endif
@ -702,7 +702,7 @@ namespace {
#ifndef MAGNUM_TARGET_GLES
void TextureArrayGLTest::image1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
Texture1DArray texture;
@ -726,7 +726,7 @@ void TextureArrayGLTest::compressedImage1D() {
}
void TextureArrayGLTest::image1DBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
Texture1DArray texture;
@ -775,7 +775,7 @@ namespace {
void TextureArrayGLTest::image2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif
@ -800,14 +800,14 @@ void TextureArrayGLTest::image2D() {
void TextureArrayGLTest::compressedImage2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported."));
#endif
@ -834,7 +834,7 @@ void TextureArrayGLTest::compressedImage2D() {
void TextureArrayGLTest::image2DBuffer() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif
@ -859,14 +859,14 @@ void TextureArrayGLTest::image2DBuffer() {
void TextureArrayGLTest::compressedImage2DBuffer() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported."));
#endif
@ -903,7 +903,7 @@ namespace {
#ifndef MAGNUM_TARGET_GLES
void TextureArrayGLTest::subImage1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
Texture1DArray texture;
@ -929,7 +929,7 @@ void TextureArrayGLTest::compressedSubImage1D() {
}
void TextureArrayGLTest::subImage1DBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
Texture1DArray texture;
@ -954,9 +954,9 @@ void TextureArrayGLTest::compressedSubImage1DBuffer() {
}
void TextureArrayGLTest::subImage1DQuery() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
Texture1DArray texture;
@ -980,9 +980,9 @@ void TextureArrayGLTest::compressedSubImage1DQuery() {
}
void TextureArrayGLTest::subImage1DQueryBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
Texture1DArray texture;
@ -1069,7 +1069,7 @@ namespace {
void TextureArrayGLTest::subImage2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif
@ -1095,14 +1095,14 @@ void TextureArrayGLTest::subImage2D() {
void TextureArrayGLTest::compressedSubImage2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported."));
#endif
@ -1110,7 +1110,7 @@ void TextureArrayGLTest::compressedSubImage2D() {
/* Compressed pixel storage for array textures is underspecified. If the
extension is supported, first test with default values to ensure we are
not that far off, then continue as usual */
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
Texture2DArray texture;
texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3,
Vector3i{12, 4, 4}, CompressedZero2D});
@ -1147,7 +1147,7 @@ void TextureArrayGLTest::compressedSubImage2D() {
CORRADE_COMPARE(image.size(), (Vector3i{12, 4, 4}));
{
CORRADE_EXPECT_FAIL_IF(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>() && (Context::current()->detectedDriver() & Context::DetectedDriver::NVidia),
CORRADE_EXPECT_FAIL_IF(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>() && (Context::current().detectedDriver() & Context::DetectedDriver::NVidia),
"Non-default compressed pixel storage for array textures behaves weirdly on NVidia");
CORRADE_COMPARE_AS(
@ -1158,7 +1158,7 @@ void TextureArrayGLTest::compressedSubImage2D() {
void TextureArrayGLTest::subImage2DBuffer() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif
@ -1184,14 +1184,14 @@ void TextureArrayGLTest::subImage2DBuffer() {
void TextureArrayGLTest::compressedSubImage2DBuffer() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported."));
#endif
@ -1199,7 +1199,7 @@ void TextureArrayGLTest::compressedSubImage2DBuffer() {
/* Compressed pixel storage for array textures is underspecified. If the
extension is supported, first test with default values to ensure we are
not that far off, then continue as usual */
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
Texture2DArray texture;
texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3,
Vector3i{12, 4, 4}, CompressedZero2D});
@ -1237,7 +1237,7 @@ void TextureArrayGLTest::compressedSubImage2DBuffer() {
CORRADE_COMPARE(image.size(), (Vector3i{12, 4, 4}));
{
CORRADE_EXPECT_FAIL_IF(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>() && (Context::current()->detectedDriver() & Context::DetectedDriver::NVidia),
CORRADE_EXPECT_FAIL_IF(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>() && (Context::current().detectedDriver() & Context::DetectedDriver::NVidia),
"Non-default compressed pixel storage for array textures behaves weirdly on NVidia");
CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{CompressedSubData2DComplete}, TestSuite::Compare::Container);
@ -1247,9 +1247,9 @@ void TextureArrayGLTest::compressedSubImage2DBuffer() {
#ifndef MAGNUM_TARGET_GLES
void TextureArrayGLTest::subImage2DQuery() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
Texture2DArray texture;
@ -1269,11 +1269,11 @@ void TextureArrayGLTest::subImage2DQuery() {
}
void TextureArrayGLTest::compressedSubImage2DQuery() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
Texture2DArray texture;
@ -1285,7 +1285,7 @@ void TextureArrayGLTest::compressedSubImage2DQuery() {
/* Test also without compressed pixel storage to ensure that both size
computations work */
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 1}, {4, 4, 2}), {});
MAGNUM_VERIFY_NO_ERROR();
@ -1307,9 +1307,9 @@ void TextureArrayGLTest::compressedSubImage2DQuery() {
}
void TextureArrayGLTest::subImage2DQueryBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
Texture2DArray texture;
@ -1330,11 +1330,11 @@ void TextureArrayGLTest::subImage2DQueryBuffer() {
}
void TextureArrayGLTest::compressedSubImage2DQueryBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
Texture2DArray texture;
@ -1360,9 +1360,9 @@ void TextureArrayGLTest::compressedSubImage2DQueryBuffer() {
}
void TextureArrayGLTest::generateMipmap1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
Texture1DArray texture;
@ -1389,9 +1389,9 @@ void TextureArrayGLTest::generateMipmap1D() {
void TextureArrayGLTest::generateMipmap2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif
@ -1423,7 +1423,7 @@ void TextureArrayGLTest::generateMipmap2D() {
#ifndef MAGNUM_TARGET_GLES
void TextureArrayGLTest::invalidateImage1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
Texture1DArray texture;
@ -1436,7 +1436,7 @@ void TextureArrayGLTest::invalidateImage1D() {
void TextureArrayGLTest::invalidateImage2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif
@ -1449,7 +1449,7 @@ void TextureArrayGLTest::invalidateImage2D() {
#ifndef MAGNUM_TARGET_GLES
void TextureArrayGLTest::invalidateSubImage1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
Texture1DArray texture;
@ -1462,7 +1462,7 @@ void TextureArrayGLTest::invalidateSubImage1D() {
void TextureArrayGLTest::invalidateSubImage2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported."));
#endif

154
src/Magnum/Test/TextureGLTest.cpp

@ -346,7 +346,7 @@ TextureGLTest::TextureGLTest() {
_dataOffset3D = 16;
#ifdef MAGNUM_TARGET_GLES2
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::unpack_subimage>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::unpack_subimage>())
#endif
{
_dataStorage2D = _dataStorage3D = {};
@ -355,7 +355,7 @@ TextureGLTest::TextureGLTest() {
#endif
#ifndef MAGNUM_TARGET_GLES
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>())
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>())
{
_compressedDataStorage2D = CompressedPixelStorage{}
.setCompressedBlockSize({4, 4, 1})
@ -432,7 +432,7 @@ void TextureGLTest::construct2DNoCreate() {
void TextureGLTest::construct3D() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_3D>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_3D>())
CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported."));
#endif
@ -491,7 +491,7 @@ void TextureGLTest::wrap2D() {
void TextureGLTest::wrap3D() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_3D>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_3D>())
CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported."));
#endif
@ -551,7 +551,7 @@ void TextureGLTest::bind2D() {
void TextureGLTest::bind3D() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_3D>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_3D>())
CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported."));
#endif
@ -593,7 +593,7 @@ void TextureGLTest::sampling1D() {
}
void TextureGLTest::samplingSRGBDecode1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_sRGB_decode>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_sRGB_decode>())
CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported."));
Texture1D texture;
@ -603,7 +603,7 @@ void TextureGLTest::samplingSRGBDecode1D() {
}
void TextureGLTest::samplingSwizzle1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_swizzle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_swizzle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported."));
Texture1D texture;
@ -613,7 +613,7 @@ void TextureGLTest::samplingSwizzle1D() {
}
void TextureGLTest::samplingBorderInteger1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_integer>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_integer>())
CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported."));
Texture1D a;
@ -627,7 +627,7 @@ void TextureGLTest::samplingBorderInteger1D() {
}
void TextureGLTest::samplingDepthStencilMode1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::stencil_texturing>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::stencil_texturing>())
CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported."));
Texture1D texture;
@ -665,10 +665,10 @@ void TextureGLTest::sampling2D() {
void TextureGLTest::samplingSRGBDecode2D() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::sRGB>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::sRGB>())
CORRADE_SKIP(Extensions::GL::EXT::sRGB::string() + std::string(" is not supported."));
#endif
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_sRGB_decode>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_sRGB_decode>())
CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported."));
Texture2D texture;
@ -680,7 +680,7 @@ void TextureGLTest::samplingSRGBDecode2D() {
#ifndef MAGNUM_TARGET_GLES2
void TextureGLTest::samplingSwizzle2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_swizzle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_swizzle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported."));
#endif
@ -691,7 +691,7 @@ void TextureGLTest::samplingSwizzle2D() {
}
#else
void TextureGLTest::samplingMaxLevel2D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::APPLE::texture_max_level>())
if(!Context::current().isExtensionSupported<Extensions::GL::APPLE::texture_max_level>())
CORRADE_SKIP(Extensions::GL::APPLE::texture_max_level::string() + std::string(" is not supported."));
Texture2D texture;
@ -701,7 +701,7 @@ void TextureGLTest::samplingMaxLevel2D() {
}
void TextureGLTest::samplingCompare2D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::shadow_samplers>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::shadow_samplers>())
CORRADE_SKIP(Extensions::GL::EXT::shadow_samplers::string() + std::string(" is not supported."));
Texture2D texture;
@ -715,10 +715,10 @@ void TextureGLTest::samplingCompare2D() {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void TextureGLTest::samplingBorderInteger2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_integer>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_integer>())
CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported."));
#endif
@ -736,10 +736,10 @@ void TextureGLTest::samplingBorderInteger2D() {
#ifndef MAGNUM_TARGET_GLES2
void TextureGLTest::samplingDepthStencilMode2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::stencil_texturing>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::stencil_texturing>())
CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported."));
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 is not supported.");
#endif
@ -752,8 +752,8 @@ void TextureGLTest::samplingDepthStencilMode2D() {
#ifdef MAGNUM_TARGET_GLES
void TextureGLTest::samplingBorder2D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::NV::texture_border_clamp>() &&
!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
if(!Context::current().isExtensionSupported<Extensions::GL::NV::texture_border_clamp>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
CORRADE_SKIP("No required extension is supported.");
Texture2D texture;
@ -766,7 +766,7 @@ void TextureGLTest::samplingBorder2D() {
void TextureGLTest::sampling3D() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_3D>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_3D>())
CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported."));
#endif
@ -795,12 +795,12 @@ void TextureGLTest::sampling3D() {
void TextureGLTest::samplingSRGBDecode3D() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_3D>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_3D>())
CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::sRGB>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::sRGB>())
CORRADE_SKIP(Extensions::GL::EXT::sRGB::string() + std::string(" is not supported."));
#endif
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_sRGB_decode>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_sRGB_decode>())
CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported."));
Texture3D texture;
@ -812,7 +812,7 @@ void TextureGLTest::samplingSRGBDecode3D() {
#ifndef MAGNUM_TARGET_GLES2
void TextureGLTest::samplingSwizzle3D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_swizzle>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_swizzle>())
CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported."));
#endif
@ -823,9 +823,9 @@ void TextureGLTest::samplingSwizzle3D() {
}
#else
void TextureGLTest::samplingMaxLevel3D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_3D>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_3D>())
CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::APPLE::texture_max_level>())
if(!Context::current().isExtensionSupported<Extensions::GL::APPLE::texture_max_level>())
CORRADE_SKIP(Extensions::GL::APPLE::texture_max_level::string() + std::string(" is not supported."));
Texture3D texture;
@ -838,10 +838,10 @@ void TextureGLTest::samplingMaxLevel3D() {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void TextureGLTest::samplingBorderInteger3D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_integer>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_integer>())
CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported."));
#endif
@ -859,10 +859,10 @@ void TextureGLTest::samplingBorderInteger3D() {
#ifndef MAGNUM_TARGET_GLES2
void TextureGLTest::samplingDepthStencilMode3D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::stencil_texturing>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::stencil_texturing>())
CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported."));
#else
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 is not supported.");
#endif
@ -876,12 +876,12 @@ void TextureGLTest::samplingDepthStencilMode3D() {
#ifdef MAGNUM_TARGET_GLES
void TextureGLTest::samplingBorder3D() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_3D>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_3D>())
CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported."));
#endif
if(!Context::current()->isExtensionSupported<Extensions::GL::NV::texture_border_clamp>() &&
!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
if(!Context::current().isExtensionSupported<Extensions::GL::NV::texture_border_clamp>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_border_clamp>())
CORRADE_SKIP("No required extension is supported.");
Texture3D texture;
@ -918,7 +918,7 @@ void TextureGLTest::storage2D() {
#ifndef MAGNUM_TARGET_GLES2
#ifdef MAGNUM_TARGET_GLES
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 not supported, skipping image size testing.");
#endif
@ -935,7 +935,7 @@ void TextureGLTest::storage2D() {
void TextureGLTest::storage3D() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_3D>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_3D>())
CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported."));
#endif
@ -946,7 +946,7 @@ void TextureGLTest::storage3D() {
#ifndef MAGNUM_TARGET_GLES2
#ifdef MAGNUM_TARGET_GLES
if(!Context::current()->isVersionSupported(Version::GLES310))
if(!Context::current().isVersionSupported(Version::GLES310))
CORRADE_SKIP("OpenGL ES 3.1 not supported, skipping image size testing.");
#endif
@ -1049,10 +1049,10 @@ void TextureGLTest::image2D() {
void TextureGLTest::compressedImage2D() {
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported."));
#endif
@ -1102,10 +1102,10 @@ void TextureGLTest::image2DBuffer() {
void TextureGLTest::compressedImage2DBuffer() {
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported."));
#endif
@ -1158,7 +1158,7 @@ namespace {
void TextureGLTest::image3D() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_3D>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_3D>())
CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported."));
#endif
@ -1186,7 +1186,7 @@ void TextureGLTest::compressedImage3D() {
/** @todo ASTC HDR, when available on any ES driver */
CORRADE_SKIP("No 3D texture compression format available on OpenGL ES.");
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_compression_bptc>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_compression_bptc>())
CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported."));
Texture3D texture;
@ -1233,7 +1233,7 @@ void TextureGLTest::compressedImage3DBuffer() {
/** @todo ASTC HDR, when available on any ES driver */
CORRADE_SKIP("No 3D texture compression format available on OpenGL ES.");
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_compression_bptc>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_compression_bptc>())
CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported."));
Texture3D texture;
@ -1309,7 +1309,7 @@ void TextureGLTest::compressedSubImage1DBuffer() {
}
void TextureGLTest::subImage1DQuery() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
Texture1D texture;
@ -1333,7 +1333,7 @@ void TextureGLTest::compressedSubImage1DQuery() {
}
void TextureGLTest::subImage1DQueryBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
Texture1D texture;
@ -1406,10 +1406,10 @@ void TextureGLTest::subImage2D() {
void TextureGLTest::compressedSubImage2D() {
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported."));
#endif
@ -1460,10 +1460,10 @@ void TextureGLTest::subImage2DBuffer() {
void TextureGLTest::compressedSubImage2DBuffer() {
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::WEBGL::compressed_texture_s3tc>())
CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported."));
#endif
@ -1492,7 +1492,7 @@ void TextureGLTest::compressedSubImage2DBuffer() {
#ifndef MAGNUM_TARGET_GLES
void TextureGLTest::subImage2DQuery() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
Texture2D texture;
@ -1512,9 +1512,9 @@ void TextureGLTest::subImage2DQuery() {
}
void TextureGLTest::compressedSubImage2DQuery() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
Texture2D texture;
@ -1525,7 +1525,7 @@ void TextureGLTest::compressedSubImage2DQuery() {
/* Test also without compressed pixel storage to ensure that both size
computations work */
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
CompressedImage2D image = texture.compressedSubImage(0, Range2Di::fromSize({4, 0}, Vector2i{4}), {});
MAGNUM_VERIFY_NO_ERROR();
@ -1547,7 +1547,7 @@ void TextureGLTest::compressedSubImage2DQuery() {
}
void TextureGLTest::subImage2DQueryBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
Texture2D texture;
@ -1568,9 +1568,9 @@ void TextureGLTest::subImage2DQueryBuffer() {
}
void TextureGLTest::compressedSubImage2DQueryBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_compression_s3tc>())
CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported."));
Texture2D texture;
@ -1581,7 +1581,7 @@ void TextureGLTest::compressedSubImage2DQueryBuffer() {
/* Test also without compressed pixel storage to ensure that both size
computations work */
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
CompressedBufferImage2D image = texture.compressedSubImage(0, Range2Di::fromSize({4, 0}, Vector2i{4}), {}, BufferUsage::StaticRead);
const auto imageData = image.buffer().data<UnsignedByte>();
@ -1673,7 +1673,7 @@ namespace {
void TextureGLTest::subImage3D() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_3D>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_3D>())
CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported."));
#endif
@ -1703,7 +1703,7 @@ void TextureGLTest::compressedSubImage3D() {
/** @todo ASTC HDR, when available on any ES driver */
CORRADE_SKIP("No 3D texture compression format available on OpenGL ES.");
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_compression_bptc>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_compression_bptc>())
CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported."));
Texture3D texture;
@ -1752,7 +1752,7 @@ void TextureGLTest::compressedSubImage3DBuffer() {
/** @todo ASTC HDR, when available on any ES driver */
CORRADE_SKIP("No 3D texture compression format available on OpenGL ES.");
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_compression_bptc>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_compression_bptc>())
CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported."));
Texture3D texture;
@ -1776,7 +1776,7 @@ void TextureGLTest::compressedSubImage3DBuffer() {
#ifndef MAGNUM_TARGET_GLES
void TextureGLTest::subImage3DQuery() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
Texture3D texture;
@ -1796,9 +1796,9 @@ void TextureGLTest::subImage3DQuery() {
}
void TextureGLTest::compressedSubImage3DQuery() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_compression_bptc>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_compression_bptc>())
CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported."));
Texture3D texture;
@ -1809,14 +1809,14 @@ void TextureGLTest::compressedSubImage3DQuery() {
/* Test also without compressed pixel storage to ensure that both size
computations work */
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 0}, Vector3i{4}), {});
MAGNUM_VERIFY_NO_ERROR();
CORRADE_COMPARE(image.size(), (Vector3i{4}));
CORRADE_EXPECT_FAIL_IF(!!(Context::current()->detectedDriver() & Context::DetectedDriver::NVidia),
CORRADE_EXPECT_FAIL_IF(!!(Context::current().detectedDriver() & Context::DetectedDriver::NVidia),
"Default compressed pixel storage behaves weirdly with BPTC compression on NVidia");
CORRADE_COMPARE_AS(
@ -1835,7 +1835,7 @@ void TextureGLTest::compressedSubImage3DQuery() {
}
void TextureGLTest::subImage3DQueryBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
Texture3D texture;
@ -1856,9 +1856,9 @@ void TextureGLTest::subImage3DQueryBuffer() {
}
void TextureGLTest::compressedSubImage3DQueryBuffer() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::get_texture_sub_image>())
CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported."));
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::texture_compression_bptc>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::texture_compression_bptc>())
CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported."));
Texture3D texture;
@ -1869,7 +1869,7 @@ void TextureGLTest::compressedSubImage3DQueryBuffer() {
/* Test also without compressed pixel storage to ensure that both size
computations work */
if(Context::current()->isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
if(Context::current().isExtensionSupported<Extensions::GL::ARB::compressed_texture_pixel_storage>()) {
CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 0}, Vector3i{4}), {}, BufferUsage::StaticRead);
const auto imageData = image.buffer().data<UnsignedByte>();
@ -1877,7 +1877,7 @@ void TextureGLTest::compressedSubImage3DQueryBuffer() {
CORRADE_COMPARE(image.size(), Vector3i{4});
CORRADE_EXPECT_FAIL_IF(!!(Context::current()->detectedDriver() & Context::DetectedDriver::NVidia),
CORRADE_EXPECT_FAIL_IF(!!(Context::current().detectedDriver() & Context::DetectedDriver::NVidia),
"Default compressed pixel storage behaves weirdly with BPTC compression on NVidia");
CORRADE_COMPARE_AS(imageData, Containers::ArrayView<const UnsignedByte>{CompressedData3D}, TestSuite::Compare::Container);
@ -1893,7 +1893,7 @@ void TextureGLTest::compressedSubImage3DQueryBuffer() {
}
void TextureGLTest::generateMipmap1D() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported."));
Texture1D texture;
@ -1920,7 +1920,7 @@ void TextureGLTest::generateMipmap1D() {
void TextureGLTest::generateMipmap2D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported."));
#endif
@ -1953,10 +1953,10 @@ void TextureGLTest::generateMipmap2D() {
void TextureGLTest::generateMipmap3D() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::framebuffer_object>())
CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported."));
#elif defined(MAGNUM_TARGET_GLES2)
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_3D>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_3D>())
CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported."));
#endif
@ -2007,7 +2007,7 @@ void TextureGLTest::invalidateImage2D() {
void TextureGLTest::invalidateImage3D() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_3D>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_3D>())
CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported."));
#endif
@ -2038,7 +2038,7 @@ void TextureGLTest::invalidateSubImage2D() {
void TextureGLTest::invalidateSubImage3D() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_3D>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_3D>())
CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported."));
#endif

10
src/Magnum/Test/TimeQueryGLTest.cpp

@ -59,10 +59,10 @@ void TimeQueryGLTest::constructNoCreate() {
void TimeQueryGLTest::wrap() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::timer_query>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::timer_query>())
CORRADE_SKIP(Extensions::GL::ARB::timer_query::string() + std::string(" is not available"));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::disjoint_timer_query>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::disjoint_timer_query>())
CORRADE_SKIP(Extensions::GL::EXT::disjoint_timer_query::string() + std::string(" is not available"));
#endif
@ -90,10 +90,10 @@ void TimeQueryGLTest::wrap() {
void TimeQueryGLTest::queryTime() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::timer_query>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::timer_query>())
CORRADE_SKIP(Extensions::GL::ARB::timer_query::string() + std::string(" is not available"));
#else
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::disjoint_timer_query>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::disjoint_timer_query>())
CORRADE_SKIP(Extensions::GL::EXT::disjoint_timer_query::string() + std::string(" is not available"));
#endif
@ -117,7 +117,7 @@ void TimeQueryGLTest::queryTime() {
void TimeQueryGLTest::queryTimestamp() {
#ifdef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::disjoint_timer_query>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::disjoint_timer_query>())
CORRADE_SKIP(Extensions::GL::EXT::disjoint_timer_query::string() + std::string(" is not available"));
#endif

22
src/Magnum/Test/TransformFeedbackGLTest.cpp

@ -76,7 +76,7 @@ TransformFeedbackGLTest::TransformFeedbackGLTest() {
void TransformFeedbackGLTest::construct() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported."));
#endif
@ -108,7 +108,7 @@ void TransformFeedbackGLTest::constructCopy() {
void TransformFeedbackGLTest::constructMove() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported."));
#endif
@ -135,7 +135,7 @@ void TransformFeedbackGLTest::constructMove() {
void TransformFeedbackGLTest::wrap() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported."));
#endif
@ -156,11 +156,11 @@ void TransformFeedbackGLTest::wrap() {
void TransformFeedbackGLTest::label() {
/* No-Op version is tested in AbstractObjectGLTest */
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported."));
#endif
if(!Context::current()->isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current()->isExtensionSupported<Extensions::GL::EXT::debug_label>())
if(!Context::current().isExtensionSupported<Extensions::GL::KHR::debug>() &&
!Context::current().isExtensionSupported<Extensions::GL::EXT::debug_label>())
CORRADE_SKIP("Required extension is not available");
TransformFeedback feedback;
@ -219,7 +219,7 @@ XfbShader::XfbShader() {
void TransformFeedbackGLTest::attachBase() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported."));
#endif
@ -255,7 +255,7 @@ void TransformFeedbackGLTest::attachBase() {
void TransformFeedbackGLTest::attachRange() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported."));
#endif
@ -331,7 +331,7 @@ XfbMultiShader::XfbMultiShader() {
void TransformFeedbackGLTest::attachBases() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported."));
#endif
@ -373,7 +373,7 @@ void TransformFeedbackGLTest::attachBases() {
void TransformFeedbackGLTest::attachRanges() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::transform_feedback2>())
CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported."));
#endif
@ -419,7 +419,7 @@ void TransformFeedbackGLTest::attachRanges() {
#ifndef MAGNUM_TARGET_GLES
void TransformFeedbackGLTest::interleaved() {
/* ARB_transform_feedback3 needed for gl_SkipComponents1 */
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::transform_feedback3>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::transform_feedback3>())
CORRADE_SKIP(Extensions::GL::ARB::transform_feedback3::string() + std::string(" is not supported."));
struct XfbInterleavedShader: AbstractShaderProgram {

8
src/Magnum/Text/DistanceFieldGlyphCache.cpp

@ -41,7 +41,7 @@ DistanceFieldGlyphCache::DistanceFieldGlyphCache(const Vector2i& originalSize, c
GlyphCache(TextureFormat::R8, originalSize, size, Vector2i(radius)),
#elif !defined(MAGNUM_TARGET_WEBGL)
/* Luminance is not renderable in most cases */
GlyphCache(Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_rg>() ?
GlyphCache(Context::current().isExtensionSupported<Extensions::GL::EXT::texture_rg>() ?
TextureFormat::Red : TextureFormat::RGB, originalSize, size, Vector2i(radius)),
#else
GlyphCache(TextureFormat::RGB, originalSize, size, Vector2i(radius)),
@ -54,7 +54,7 @@ DistanceFieldGlyphCache::DistanceFieldGlyphCache(const Vector2i& originalSize, c
#if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
/* Luminance is not renderable in most cases */
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_rg>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_rg>())
Warning() << "Text::DistanceFieldGlyphCache:" << Extensions::GL::EXT::texture_rg::string() << "not supported, using inefficient RGB format for glyph cache texture";
#endif
}
@ -67,7 +67,7 @@ void DistanceFieldGlyphCache::setImage(const Vector2i& offset, const ImageView2D
#else
TextureFormat internalFormat;
#ifndef MAGNUM_TARGET_WEBGL
if(Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_rg>()) {
if(Context::current().isExtensionSupported<Extensions::GL::EXT::texture_rg>()) {
internalFormat = TextureFormat::Red;
CORRADE_ASSERT(image.format() == PixelFormat::Red,
"Text::DistanceFieldGlyphCache::setImage(): expected" << PixelFormat::Red << "but got" << image.format(), );
@ -96,7 +96,7 @@ void DistanceFieldGlyphCache::setDistanceFieldImage(const Vector2i& offset, cons
"Text::DistanceFieldGlyphCache::setDistanceFieldImage(): expected" << PixelFormat::Red << "but got" << image.format(), );
#else
#ifndef MAGNUM_TARGET_WEBGL
if(Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_rg>())
if(Context::current().isExtensionSupported<Extensions::GL::EXT::texture_rg>())
CORRADE_ASSERT(image.format() == PixelFormat::Red,
"Text::DistanceFieldGlyphCache::setDistanceFieldImage(): expected" << PixelFormat::Red << "but got" << image.format(), );
else

4
src/Magnum/Text/GlyphCache.cpp

@ -51,8 +51,8 @@ GlyphCache::GlyphCache(const Vector2i& originalSize, const Vector2i& size, const
const TextureFormat internalFormat = TextureFormat::R8;
#elif !defined(MAGNUM_TARGET_WEBGL)
TextureFormat internalFormat;
if(Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_rg>()) {
internalFormat = Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_storage>() ?
if(Context::current().isExtensionSupported<Extensions::GL::EXT::texture_rg>()) {
internalFormat = Context::current().isExtensionSupported<Extensions::GL::EXT::texture_storage>() ?
TextureFormat::R8 : TextureFormat::Red;
} else internalFormat = TextureFormat::Luminance;
#else

4
src/Magnum/Text/Renderer.cpp

@ -306,11 +306,11 @@ AbstractRenderer::AbstractRenderer(AbstractFont& font, const GlyphCache& cache,
#ifndef MAGNUM_TARGET_GLES
MAGNUM_ASSERT_EXTENSION_SUPPORTED(Extensions::GL::ARB::map_buffer_range);
#elif defined(MAGNUM_TARGET_GLES2) && !defined(CORRADE_TARGET_EMSCRIPTEN)
if(Context::current()->isExtensionSupported<Extensions::GL::EXT::map_buffer_range>()) {
if(Context::current().isExtensionSupported<Extensions::GL::EXT::map_buffer_range>()) {
bufferMapImplementation = &AbstractRenderer::bufferMapImplementationRange;
}
#ifdef CORRADE_TARGET_NACL
else if(Context::current()->isExtensionSupported<Extensions::GL::CHROMIUM::map_sub>()) {
else if(Context::current().isExtensionSupported<Extensions::GL::CHROMIUM::map_sub>()) {
bufferMapImplementation = &AbstractRenderer::bufferMapImplementationSub;
bufferUnmapImplementation = &AbstractRenderer::bufferUnmapImplementationSub;
}

8
src/Magnum/Text/Test/RendererGLTest.cpp

@ -258,13 +258,13 @@ void RendererGLTest::renderMeshIndexType() {
void RendererGLTest::mutableText() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::map_buffer_range>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::map_buffer_range>())
CORRADE_SKIP(Extensions::GL::ARB::map_buffer_range::string() + std::string(" is not supported"));
#elif defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_EMSCRIPTEN)
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::map_buffer_range>() &&
!Context::current()->isExtensionSupported<Extensions::GL::OES::mapbuffer>()
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::map_buffer_range>() &&
!Context::current().isExtensionSupported<Extensions::GL::OES::mapbuffer>()
#ifdef CORRADE_TARGET_NACL
&& !Context::current()->isExtensionSupported<Extensions::GL::CHROMIUM::map_sub>()
&& !Context::current().isExtensionSupported<Extensions::GL::CHROMIUM::map_sub>()
#endif
) {
CORRADE_SKIP("No required extension is supported");

2
src/Magnum/Texture.cpp

@ -53,7 +53,7 @@ template MAGNUM_EXPORT Vector2i maxTextureSize<2>();
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
template<> MAGNUM_EXPORT Vector3i maxTextureSize<3>() {
#ifdef MAGNUM_TARGET_GLES2
if(!Context::current()->isExtensionSupported<Extensions::GL::OES::texture_3D>())
if(!Context::current().isExtensionSupported<Extensions::GL::OES::texture_3D>())
return {};
#endif
return {Vector2i(Implementation::maxTextureSideSize()), Implementation::max3DTextureDepth()};

2
src/Magnum/TextureArray.cpp

@ -46,7 +46,7 @@ namespace {
template<UnsignedInt dimensions> VectorTypeFor<dimensions+1, Int> TextureArray<dimensions>::maxSize() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_array>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::texture_array>())
return {};
#endif

24
src/Magnum/TextureTools/DistanceField.cpp

@ -91,9 +91,9 @@ DistanceFieldShader::DistanceFieldShader(): radiusUniform(0), scalingUniform(1)
Utility::Resource rs("MagnumTextureTools");
#ifndef MAGNUM_TARGET_GLES
const Version v = Context::current()->supportedVersion({Version::GL320, Version::GL300, Version::GL210});
const Version v = Context::current().supportedVersion({Version::GL320, Version::GL300, Version::GL210});
#else
const Version v = Context::current()->supportedVersion({Version::GLES300, Version::GLES200});
const Version v = Context::current().supportedVersion({Version::GLES300, Version::GLES200});
#endif
Shader vert = Shaders::Implementation::createCompatibilityShader(rs, v, Shader::Type::Vertex);
@ -109,9 +109,9 @@ DistanceFieldShader::DistanceFieldShader(): radiusUniform(0), scalingUniform(1)
/* Older GLSL doesn't have gl_VertexID, vertices must be supplied explicitly */
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isVersionSupported(Version::GL300))
if(!Context::current().isVersionSupported(Version::GL300))
#else
if(!Context::current()->isVersionSupported(Version::GLES300))
if(!Context::current().isVersionSupported(Version::GLES300))
#endif
{
bindAttributeLocation(Position::Location, "position");
@ -120,16 +120,16 @@ DistanceFieldShader::DistanceFieldShader(): radiusUniform(0), scalingUniform(1)
CORRADE_INTERNAL_ASSERT_OUTPUT(link());
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>())
#endif
{
radiusUniform = uniformLocation("radius");
scalingUniform = uniformLocation("scaling");
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isVersionSupported(Version::GL320))
if(!Context::current().isVersionSupported(Version::GL320))
#else
if(!Context::current()->isVersionSupported(Version::GLES300))
if(!Context::current().isVersionSupported(Version::GLES300))
#endif
{
imageSizeInvertedUniform = uniformLocation("imageSizeInverted");
@ -137,7 +137,7 @@ DistanceFieldShader::DistanceFieldShader(): radiusUniform(0), scalingUniform(1)
}
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::shading_language_420pack>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::shading_language_420pack>())
#endif
{
setUniform(uniformLocation("textureData"), TextureUnit);
@ -179,9 +179,9 @@ void distanceField(Texture2D& input, Texture2D& output, const Range2Di& rectangl
.setTexture(input);
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isVersionSupported(Version::GL320))
if(!Context::current().isVersionSupported(Version::GL320))
#else
if(!Context::current()->isVersionSupported(Version::GLES300))
if(!Context::current().isVersionSupported(Version::GLES300))
#endif
{
shader.setImageSizeInverted(1.0f/Vector2(imageSize));
@ -194,9 +194,9 @@ void distanceField(Texture2D& input, Texture2D& output, const Range2Di& rectangl
/* Older GLSL doesn't have gl_VertexID, vertices must be supplied explicitly */
Buffer buffer;
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isVersionSupported(Version::GL300))
if(!Context::current().isVersionSupported(Version::GL300))
#else
if(!Context::current()->isVersionSupported(Version::GLES300))
if(!Context::current().isVersionSupported(Version::GLES300))
#endif
{
constexpr Vector2 triangle[] = {

34
src/Magnum/TransformFeedback.cpp

@ -42,11 +42,11 @@ namespace Magnum {
Int TransformFeedback::maxInterleavedComponents() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::transform_feedback>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::transform_feedback>())
return 0;
#endif
GLint& value = Context::current()->state().transformFeedback->maxInterleavedComponents;
GLint& value = Context::current().state().transformFeedback->maxInterleavedComponents;
if(value == 0)
glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, &value);
@ -56,11 +56,11 @@ Int TransformFeedback::maxInterleavedComponents() {
Int TransformFeedback::maxSeparateAttributes() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::transform_feedback>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::transform_feedback>())
return 0;
#endif
GLint& value = Context::current()->state().transformFeedback->maxSeparateAttributes;
GLint& value = Context::current().state().transformFeedback->maxSeparateAttributes;
if(value == 0)
glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &value);
@ -70,11 +70,11 @@ Int TransformFeedback::maxSeparateAttributes() {
Int TransformFeedback::maxSeparateComponents() {
#ifndef MAGNUM_TARGET_GLES
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::transform_feedback>())
if(!Context::current().isExtensionSupported<Extensions::GL::EXT::transform_feedback>())
return 0;
#endif
GLint& value = Context::current()->state().transformFeedback->maxSeparateComponents;
GLint& value = Context::current().state().transformFeedback->maxSeparateComponents;
if(value == 0)
glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS, &value);
@ -84,10 +84,10 @@ Int TransformFeedback::maxSeparateComponents() {
#ifndef MAGNUM_TARGET_GLES
Int TransformFeedback::maxBuffers() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::transform_feedback3>())
if(!Context::current().isExtensionSupported<Extensions::GL::ARB::transform_feedback3>())
return maxSeparateAttributes();
GLint& value = Context::current()->state().transformFeedback->maxBuffers;
GLint& value = Context::current().state().transformFeedback->maxBuffers;
if(value == 0)
glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_BUFFERS, &value);
@ -97,7 +97,7 @@ Int TransformFeedback::maxBuffers() {
#endif
TransformFeedback::TransformFeedback(): _flags{ObjectFlag::DeleteOnDestruction} {
(this->*Context::current()->state().transformFeedback->createImplementation)();
(this->*Context::current().state().transformFeedback->createImplementation)();
CORRADE_INTERNAL_ASSERT(_id != Implementation::State::DisengagedBinding);
}
@ -117,14 +117,14 @@ TransformFeedback::~TransformFeedback() {
if(!_id || !(_flags & ObjectFlag::DeleteOnDestruction)) return;
/* If bound, remove itself from state */
GLuint& binding = Context::current()->state().transformFeedback->binding;
GLuint& binding = Context::current().state().transformFeedback->binding;
if(binding == _id) binding = 0;
glDeleteTransformFeedbacks(1, &_id);
}
void TransformFeedback::bindInternal() {
GLuint& bound = Context::current()->state().transformFeedback->binding;
GLuint& bound = Context::current().state().transformFeedback->binding;
/* Already bound, nothing to do */
if(bound == _id) return;
@ -149,23 +149,23 @@ inline void TransformFeedback::createIfNotAlready() {
#ifndef MAGNUM_TARGET_WEBGL
std::string TransformFeedback::label() {
createIfNotAlready();
return Context::current()->state().debug->getLabelImplementation(GL_TRANSFORM_FEEDBACK, _id);
return Context::current().state().debug->getLabelImplementation(GL_TRANSFORM_FEEDBACK, _id);
}
TransformFeedback& TransformFeedback::setLabelInternal(const Containers::ArrayView<const char> label) {
createIfNotAlready();
Context::current()->state().debug->labelImplementation(GL_TRANSFORM_FEEDBACK, _id, label);
Context::current().state().debug->labelImplementation(GL_TRANSFORM_FEEDBACK, _id, label);
return *this;
}
#endif
TransformFeedback& TransformFeedback::attachBuffer(const UnsignedInt index, Buffer& buffer, const GLintptr offset, const GLsizeiptr size) {
(this->*Context::current()->state().transformFeedback->attachRangeImplementation)(index, buffer, offset, size);
(this->*Context::current().state().transformFeedback->attachRangeImplementation)(index, buffer, offset, size);
return *this;
}
TransformFeedback& TransformFeedback::attachBuffer(const UnsignedInt index, Buffer& buffer) {
(this->*Context::current()->state().transformFeedback->attachBaseImplementation)(index, buffer);
(this->*Context::current().state().transformFeedback->attachBaseImplementation)(index, buffer);
return *this;
}
@ -193,13 +193,13 @@ void TransformFeedback::attachImplementationDSA(const GLuint index, Buffer& buff
/** @todoc const std::initializer_list makes Doxygen grumpy */
TransformFeedback& TransformFeedback::attachBuffers(const UnsignedInt firstIndex, std::initializer_list<std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers) {
(this->*Context::current()->state().transformFeedback->attachRangesImplementation)(firstIndex, buffers);
(this->*Context::current().state().transformFeedback->attachRangesImplementation)(firstIndex, buffers);
return *this;
}
/** @todoc const std::initializer_list makes Doxygen grumpy */
TransformFeedback& TransformFeedback::attachBuffers(const UnsignedInt firstIndex, std::initializer_list<Buffer*> buffers) {
(this->*Context::current()->state().transformFeedback->attachBasesImplementation)(firstIndex, buffers);
(this->*Context::current().state().transformFeedback->attachBasesImplementation)(firstIndex, buffers);
return *this;
}

2
src/MagnumPlugins/TgaImporter/TgaImporter.cpp

@ -100,7 +100,7 @@ std::optional<ImageData2D> TgaImporter::doImage2D(UnsignedInt) {
/* Grayscale */
} else if(header.imageType == 3) {
#if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
format = Context::current() && Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_rg>() ?
format = Context::current() && Context::current().isExtensionSupported<Extensions::GL::EXT::texture_rg>() ?
PixelFormat::Red : PixelFormat::Luminance;
#elif !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
format = PixelFormat::Red;

Loading…
Cancel
Save