diff --git a/src/Magnum/GL/Test/AbstractObjectGLTest.cpp b/src/Magnum/GL/Test/AbstractObjectGLTest.cpp index ee11db197..ebc44e57f 100644 --- a/src/Magnum/GL/Test/AbstractObjectGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractObjectGLTest.cpp @@ -23,12 +23,12 @@ DEALINGS IN THE SOFTWARE. */ -#include "Magnum/Buffer.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/OpenGLTester.h" +#include "Magnum/GL/Buffer.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/OpenGLTester.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct AbstractObjectGLTest: OpenGLTester { explicit AbstractObjectGLTest(); @@ -41,17 +41,17 @@ AbstractObjectGLTest::AbstractObjectGLTest() { } void AbstractObjectGLTest::labelNoOp() { - if(Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is supported.")); - if(Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::debug_label::string() + std::string(" is supported.")); + if(Context::current().isExtensionSupported()) + CORRADE_SKIP(GL::Extensions::KHR::debug::string() + std::string(" is supported.")); + if(Context::current().isExtensionSupported()) + CORRADE_SKIP(GL::Extensions::EXT::debug_label::string() + std::string(" is supported.")); Buffer buffer; buffer.setLabel("MyBuffer"); CORRADE_COMPARE(buffer.label(), ""); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::AbstractObjectGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::AbstractObjectGLTest) diff --git a/src/Magnum/GL/Test/AbstractQueryGLTest.cpp b/src/Magnum/GL/Test/AbstractQueryGLTest.cpp index ea40c4deb..4b0221008 100644 --- a/src/Magnum/GL/Test/AbstractQueryGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractQueryGLTest.cpp @@ -23,12 +23,12 @@ DEALINGS IN THE SOFTWARE. */ -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/OpenGLTester.h" -#include "Magnum/SampleQuery.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/OpenGLTester.h" +#include "Magnum/GL/SampleQuery.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct AbstractQueryGLTest: OpenGLTester { explicit AbstractQueryGLTest(); @@ -55,8 +55,8 @@ AbstractQueryGLTest::AbstractQueryGLTest() { void AbstractQueryGLTest::construct() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::occlusion_query_boolean::string() + std::string(" is not supported.")); #endif { @@ -66,11 +66,11 @@ void AbstractQueryGLTest::construct() { const SampleQuery query{SampleQuery::Target::AnySamplesPassed}; #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(query.id() > 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void AbstractQueryGLTest::constructCopy() { @@ -80,8 +80,8 @@ void AbstractQueryGLTest::constructCopy() { void AbstractQueryGLTest::constructMove() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::occlusion_query_boolean::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_GLES @@ -91,7 +91,7 @@ void AbstractQueryGLTest::constructMove() { #endif const Int id = a.id(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); SampleQuery b(std::move(a)); @@ -107,7 +107,7 @@ void AbstractQueryGLTest::constructMove() { const Int cId = c.id(); c = std::move(b); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); CORRADE_COMPARE(b.id(), cId); CORRADE_COMPARE(c.id(), id); @@ -116,13 +116,13 @@ void AbstractQueryGLTest::constructMove() { #ifndef MAGNUM_TARGET_WEBGL void AbstractQueryGLTest::label() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::occlusion_query_boolean::string() + std::string(" is not supported.")); #endif /* No-Op version is tested in AbstractObjectGLTest */ - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); #ifndef MAGNUM_TARGET_GLES @@ -132,7 +132,7 @@ void AbstractQueryGLTest::label() { #endif #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported()) #endif { query.begin(); query.end(); @@ -146,10 +146,10 @@ void AbstractQueryGLTest::label() { query.setLabel("MyQuery"); CORRADE_COMPARE(query.label(), "MyQuery"); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::AbstractQueryGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::AbstractQueryGLTest) diff --git a/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp index bfb33dc9a..a79f0e982 100644 --- a/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp @@ -27,24 +27,23 @@ #include #include -#include "Magnum/AbstractShaderProgram.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" #include "Magnum/Image.h" -#include "Magnum/ImageView.h" +#include "Magnum/GL/AbstractShaderProgram.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" #ifndef MAGNUM_TARGET_GLES2 -#include "Magnum/ImageFormat.h" +#include "Magnum/GL/ImageFormat.h" #endif -#include "Magnum/PixelFormat.h" -#include "Magnum/Shader.h" -#include "Magnum/Texture.h" -#include "Magnum/TextureFormat.h" +#include "Magnum/GL/PixelFormat.h" +#include "Magnum/GL/Shader.h" +#include "Magnum/GL/Texture.h" +#include "Magnum/GL/TextureFormat.h" +#include "Magnum/GL/OpenGLTester.h" #include "Magnum/Math/Matrix.h" #include "Magnum/Math/Vector4.h" #include "Magnum/Math/Color.h" -#include "Magnum/OpenGLTester.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct AbstractShaderProgramGLTest: OpenGLTester { explicit AbstractShaderProgramGLTest(); @@ -120,11 +119,11 @@ void AbstractShaderProgramGLTest::construct() { { const DummyShader shader; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(shader.id() > 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void AbstractShaderProgramGLTest::constructCopy() { @@ -136,7 +135,7 @@ void AbstractShaderProgramGLTest::constructMove() { DummyShader a; const Int id = a.id(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); DummyShader b(std::move(a)); @@ -148,7 +147,7 @@ void AbstractShaderProgramGLTest::constructMove() { const Int cId = c.id(); c = std::move(b); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); CORRADE_COMPARE(b.id(), cId); CORRADE_COMPARE(c.id(), id); @@ -157,8 +156,8 @@ void AbstractShaderProgramGLTest::constructMove() { #ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgramGLTest::label() { /* No-Op version is tested in AbstractObjectGLTest */ - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); DummyShader shader; @@ -167,7 +166,7 @@ void AbstractShaderProgramGLTest::label() { shader.setLabel("DummyShader"); CORRADE_COMPARE(shader.label(), "DummyShader"); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif @@ -218,20 +217,20 @@ void AbstractShaderProgramGLTest::create() { frag.addSource(rs.get("MyShader.frag")); const bool fragCompiled = frag.compile(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(vertCompiled); CORRADE_VERIFY(fragCompiled); MyPublicShader program; program.attachShaders({vert, frag}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); program.bindAttributeLocation(0, "position"); const bool linked = program.link(); const bool valid = program.validate().first; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(linked); { #ifdef CORRADE_TARGET_APPLE @@ -245,7 +244,7 @@ void AbstractShaderProgramGLTest::create() { const Int colorUniform = program.uniformLocation("color"); const Int additionsUniform = program.uniformLocation("additions"); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(matrixUniform >= 0); CORRADE_VERIFY(multiplierUniform >= 0); CORRADE_VERIFY(colorUniform >= 0); @@ -276,14 +275,14 @@ void AbstractShaderProgramGLTest::createMultipleOutputs() { frag.addSource(rs.get("MyShaderFragmentOutputs.frag")); const bool fragCompiled = frag.compile(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(vertCompiled); CORRADE_VERIFY(fragCompiled); MyPublicShader program; program.attachShaders({vert, frag}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); program.bindAttributeLocation(0, "position"); program.bindFragmentDataLocation(0, "first"); @@ -291,7 +290,7 @@ void AbstractShaderProgramGLTest::createMultipleOutputs() { const bool linked = program.link(); const bool valid = program.validate().first; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(linked); { #ifdef CORRADE_TARGET_APPLE @@ -330,14 +329,14 @@ void AbstractShaderProgramGLTest::createMultipleOutputsIndexed() { frag.addSource(rs.get("MyShaderFragmentOutputs.frag")); const bool fragCompiled = frag.compile(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(vertCompiled); CORRADE_VERIFY(fragCompiled); MyPublicShader program; program.attachShaders({vert, frag}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); program.bindAttributeLocation(0, "position"); program.bindFragmentDataLocationIndexed(0, 0, "first"); @@ -345,7 +344,7 @@ void AbstractShaderProgramGLTest::createMultipleOutputsIndexed() { const bool linked = program.link(); const bool valid = program.validate().first; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(linked); { #ifdef CORRADE_TARGET_APPLE @@ -463,37 +462,37 @@ MyShader::MyShader() { void AbstractShaderProgramGLTest::uniform() { MyShader shader; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); shader.setUniform(shader.multiplierUniform, 0.35f); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void AbstractShaderProgramGLTest::uniformVector() { MyShader shader; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); shader.setUniform(shader.colorUniform, Vector4(0.3f, 0.7f, 1.0f, 0.25f)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void AbstractShaderProgramGLTest::uniformMatrix() { MyShader shader; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); shader.setUniform(shader.matrixUniform, Matrix4x4::fromDiagonal({0.3f, 0.7f, 1.0f, 0.25f})); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void AbstractShaderProgramGLTest::uniformArray() { MyShader shader; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /* Testing also implicit conversion to base type (Vector4[] -> Math::Vector<4, Float>[]) */ #ifndef CORRADE_MSVC2015_COMPATIBILITY /* Causes ICE */ @@ -506,7 +505,7 @@ void AbstractShaderProgramGLTest::uniformArray() { }; shader.setUniform(shader.additionsUniform, values); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #ifndef MAGNUM_TARGET_GLES2 @@ -533,19 +532,19 @@ void AbstractShaderProgramGLTest::createUniformBlocks() { frag.addSource(rs.get("UniformBlockShader.frag")); const bool fragCompiled = frag.compile(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(vertCompiled); CORRADE_VERIFY(fragCompiled); MyPublicShader program; program.attachShaders({vert, frag}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const bool linked = program.link(); const bool valid = program.validate().first; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(linked); { #ifdef CORRADE_TARGET_APPLE @@ -557,7 +556,7 @@ void AbstractShaderProgramGLTest::createUniformBlocks() { const Int matricesUniformBlock = program.uniformBlockIndex("matrices"); const Int materialUniformBlock = program.uniformBlockIndex("material"); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(matricesUniformBlock >= 0); CORRADE_VERIFY(materialUniformBlock >= 0); } @@ -641,18 +640,18 @@ UniformBlockShader::UniformBlockShader() { void AbstractShaderProgramGLTest::uniformBlock() { UniformBlockShader shader; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); shader.setUniformBlockBinding(shader.matricesUniformBlock, 0); shader.setUniformBlockBinding(shader.materialUniformBlock, 1); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void AbstractShaderProgramGLTest::compute() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compute_shader::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compute_shader::string() + std::string(" is not supported.")); #else if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); @@ -683,7 +682,7 @@ void AbstractShaderProgramGLTest::compute() { } } shader; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const Color4ub inData[] = { { 10, 20, 30, 40}, @@ -708,18 +707,18 @@ void AbstractShaderProgramGLTest::compute() { Texture2D out; out.setStorage(1, TextureFormat::RGBA8UI, {2, 2}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); shader.setImages(in, out) .dispatchCompute({1, 1, 1}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo Test on ES */ #ifndef MAGNUM_TARGET_GLES const auto data = out.image(0, {PixelFormat::RGBAInteger, PixelType::UnsignedByte}).release(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_AS(Containers::arrayCast(data), Containers::arrayView(outData), @@ -728,6 +727,6 @@ void AbstractShaderProgramGLTest::compute() { } #endif -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::AbstractShaderProgramGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::AbstractShaderProgramGLTest) diff --git a/src/Magnum/GL/Test/AbstractShaderProgramTest.cpp b/src/Magnum/GL/Test/AbstractShaderProgramTest.cpp index 9348a356d..5378b83aa 100644 --- a/src/Magnum/GL/Test/AbstractShaderProgramTest.cpp +++ b/src/Magnum/GL/Test/AbstractShaderProgramTest.cpp @@ -25,9 +25,9 @@ #include -#include "Magnum/AbstractShaderProgram.h" +#include "Magnum/GL/AbstractShaderProgram.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct AbstractShaderProgramTest: TestSuite::Tester { explicit AbstractShaderProgramTest(); @@ -55,6 +55,6 @@ void AbstractShaderProgramTest::constructNoCreate() { CORRADE_VERIFY(true); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::AbstractShaderProgramTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::AbstractShaderProgramTest) diff --git a/src/Magnum/GL/Test/AbstractTextureGLTest.cpp b/src/Magnum/GL/Test/AbstractTextureGLTest.cpp index 6829c0d9f..3b6259841 100644 --- a/src/Magnum/GL/Test/AbstractTextureGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractTextureGLTest.cpp @@ -23,12 +23,12 @@ DEALINGS IN THE SOFTWARE. */ -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/Texture.h" -#include "Magnum/OpenGLTester.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Texture.h" +#include "Magnum/GL/OpenGLTester.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct AbstractTextureGLTest: OpenGLTester { explicit AbstractTextureGLTest(); @@ -57,11 +57,11 @@ void AbstractTextureGLTest::construct() { { const Texture2D texture; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(texture.id() > 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void AbstractTextureGLTest::constructCopy() { @@ -73,7 +73,7 @@ void AbstractTextureGLTest::constructMove() { Texture2D a; const Int id = a.id(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); Texture2D b(std::move(a)); @@ -85,7 +85,7 @@ void AbstractTextureGLTest::constructMove() { const Int cId = c.id(); c = std::move(b); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); CORRADE_COMPARE(b.id(), cId); CORRADE_COMPARE(c.id(), id); @@ -94,22 +94,22 @@ void AbstractTextureGLTest::constructMove() { #ifndef MAGNUM_TARGET_WEBGL void AbstractTextureGLTest::label() { /* No-Op version is tested in AbstractObjectGLTest */ - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); Texture2D texture; CORRADE_COMPARE(texture.label(), ""); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); texture.setLabel("MyTexture"); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.label(), "MyTexture"); } #endif -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::AbstractTextureGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::AbstractTextureGLTest) diff --git a/src/Magnum/GL/Test/AttributeTest.cpp b/src/Magnum/GL/Test/AttributeTest.cpp index 49880529f..d961766fa 100644 --- a/src/Magnum/GL/Test/AttributeTest.cpp +++ b/src/Magnum/GL/Test/AttributeTest.cpp @@ -26,9 +26,9 @@ #include #include -#include "Magnum/AbstractShaderProgram.h" +#include "Magnum/GL/AbstractShaderProgram.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct AttributeTest: TestSuite::Tester { explicit AttributeTest(); @@ -463,6 +463,6 @@ void AttributeTest::debugDataTypeVector4() { CORRADE_COMPARE(out.str(), "GL::Attribute::DataType::HalfFloat GL::Attribute::DataType(0xdead)\n"); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::AttributeTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::AttributeTest) diff --git a/src/Magnum/GL/Test/BufferGLTest.cpp b/src/Magnum/GL/Test/BufferGLTest.cpp index caae66d47..576f31019 100644 --- a/src/Magnum/GL/Test/BufferGLTest.cpp +++ b/src/Magnum/GL/Test/BufferGLTest.cpp @@ -28,12 +28,12 @@ #include #include -#include "Magnum/Buffer.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/OpenGLTester.h" +#include "Magnum/GL/Buffer.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/OpenGLTester.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct BufferGLTest: OpenGLTester { explicit BufferGLTest(); @@ -95,13 +95,13 @@ void BufferGLTest::construct() { { Buffer buffer; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(buffer.id() > 0); CORRADE_COMPARE(buffer.targetHint(), Buffer::TargetHint::Array); CORRADE_COMPARE(buffer.size(), 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void BufferGLTest::constructCopy() { @@ -113,7 +113,7 @@ void BufferGLTest::constructMove() { Buffer a; const Int id = a.id(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); Buffer b(std::move(a)); @@ -125,7 +125,7 @@ void BufferGLTest::constructMove() { const Int cId = c.id(); c = std::move(b); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); CORRADE_COMPARE(b.id(), cId); CORRADE_COMPARE(c.id(), id); @@ -149,17 +149,17 @@ void BufferGLTest::wrap() { #ifndef MAGNUM_TARGET_WEBGL void BufferGLTest::label() { /* No-Op version is tested in AbstractObjectGLTest */ - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); Buffer buffer; CORRADE_COMPARE(buffer.label(), ""); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); buffer.setLabel("MyBuffer"); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(buffer.label(), "MyBuffer"); } @@ -168,32 +168,32 @@ void BufferGLTest::label() { #ifndef MAGNUM_TARGET_GLES2 void BufferGLTest::bindBase() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::uniform_buffer_object::string() + std::string{" is not supported."}); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::uniform_buffer_object::string() + std::string{" is not supported."}); #endif Buffer buffer; buffer.bind(Buffer::Target::Uniform, 15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Buffer::unbind(Buffer::Target::Uniform, 15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Buffer::bind(Buffer::Target::Uniform, 7, {&buffer, nullptr, &buffer}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Buffer::unbind(Buffer::Target::Uniform, 7, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void BufferGLTest::bindRange() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::uniform_buffer_object::string() + std::string{" is not supported."}); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::uniform_buffer_object::string() + std::string{" is not supported."}); #endif /* Check that we have correct offset alignment */ @@ -203,14 +203,14 @@ void BufferGLTest::bindRange() { buffer.setData({nullptr, 1024}, BufferUsage::StaticDraw) .bind(Buffer::Target::Uniform, 15, 256, 13); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo C++14: get rid of std::make_tuple */ Buffer::bind(Buffer::Target::Uniform, 7, { std::make_tuple(&buffer, 256, 13), {}, std::make_tuple(&buffer, 768, 64)}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif @@ -220,25 +220,25 @@ void BufferGLTest::data() { /* Plain array */ constexpr Int data[] = {2, 7, 5, 13, 25}; buffer.setData({data, 5}, BufferUsage::StaticDraw); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(buffer.size(), 5*4); /* STL vector */ std::vector data2{2, 7, 5, 13, 25}; buffer.setData(data2, BufferUsage::StaticDraw); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(buffer.size(), 5*4); /* STL array */ std::array data3{{2, 7, 5, 13, 25}}; buffer.setData(data3, BufferUsage::StaticDraw); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(buffer.size(), 5*4); /** @todo How to verify the contents in ES? */ #ifndef MAGNUM_TARGET_GLES auto contents = buffer.data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_AS(Containers::arrayCast(contents), Containers::arrayView(data), TestSuite::Compare::Container); @@ -247,25 +247,25 @@ void BufferGLTest::data() { /* Plain array */ constexpr Int subData[] = {125, 3, 15}; buffer.setSubData(4, {subData, 3}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(buffer.size(), 5*4); /* STL vector */ std::vector subData2{125, 3, 15}; buffer.setSubData(4, subData2); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(buffer.size(), 5*4); /* STL array */ std::array subData3{{125, 3, 15}}; buffer.setSubData(4, subData3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(buffer.size(), 5*4); /** @todo How to verify the contents in ES? */ #ifndef MAGNUM_TARGET_GLES auto subContents = buffer.subData(4, 3*4); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_AS(Containers::arrayCast(subContents), Containers::arrayView(subData), TestSuite::Compare::Container); @@ -275,8 +275,8 @@ void BufferGLTest::data() { #ifndef MAGNUM_TARGET_WEBGL void BufferGLTest::map() { #ifdef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::mapbuffer::string() + std::string(" is not supported")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::mapbuffer::string() + std::string(" is not supported")); #endif Buffer buffer; @@ -290,7 +290,7 @@ void BufferGLTest::map() { Buffer::MapAccess::WriteOnly #endif ); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(contents); #ifndef MAGNUM_TARGET_GLES2 @@ -299,7 +299,7 @@ void BufferGLTest::map() { contents[3] = 107; CORRADE_VERIFY(buffer.unmap()); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to verify the contents in ES? */ #ifndef MAGNUM_TARGET_GLES @@ -311,11 +311,11 @@ void BufferGLTest::map() { void BufferGLTest::mapRange() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::map_buffer_range::string() + std::string(" is not supported")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::map_buffer_range::string() + std::string(" is not supported")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::map_buffer_range::string() + std::string(" is not supported")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::map_buffer_range::string() + std::string(" is not supported")); #endif constexpr char data[] = {2, 7, 5, 13, 25}; @@ -323,7 +323,7 @@ void BufferGLTest::mapRange() { buffer.setData(data, BufferUsage::StaticDraw); Containers::ArrayView contents = buffer.map(1, 4, Buffer::MapFlag::Read|Buffer::MapFlag::Write); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(contents); CORRADE_COMPARE(contents.size(), 4); @@ -331,7 +331,7 @@ void BufferGLTest::mapRange() { contents[3] = 107; CORRADE_VERIFY(buffer.unmap()); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to verify the contents in ES? */ #ifndef MAGNUM_TARGET_GLES @@ -343,11 +343,11 @@ void BufferGLTest::mapRange() { void BufferGLTest::mapRangeExplicitFlush() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::map_buffer_range::string() + std::string(" is not supported")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::map_buffer_range::string() + std::string(" is not supported")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::map_buffer_range::string() + std::string(" is not supported")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::map_buffer_range::string() + std::string(" is not supported")); #endif constexpr char data[] = {2, 7, 5, 13, 25}; @@ -359,7 +359,7 @@ void BufferGLTest::mapRangeExplicitFlush() { CORRADE_VERIFY(contents); contents[2] = 99; CORRADE_VERIFY(buffer.unmap()); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /* Unflushed range _might_ not be changed, thus nothing to test */ @@ -368,9 +368,9 @@ void BufferGLTest::mapRangeExplicitFlush() { CORRADE_VERIFY(contents); contents[3] = 107; buffer.flushMappedRange(3, 1); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(buffer.unmap()); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /* Flushed range should be changed */ /** @todo How to verify the contents in ES? */ @@ -392,7 +392,7 @@ void BufferGLTest::copy() { buffer2.setData({nullptr, 5}, BufferUsage::StaticRead); Buffer::copy(buffer1, buffer2, 1, 2, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to verify the contents in ES? */ #ifndef MAGNUM_TARGET_GLES @@ -411,12 +411,12 @@ void BufferGLTest::invalidate() { /* Just test that no errors are emitted */ buffer.invalidateSubData(3, 2); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); buffer.invalidateData(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::BufferGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::BufferGLTest) diff --git a/src/Magnum/GL/Test/BufferImageGLTest.cpp b/src/Magnum/GL/Test/BufferImageGLTest.cpp index 56c869883..03c0544bc 100644 --- a/src/Magnum/GL/Test/BufferImageGLTest.cpp +++ b/src/Magnum/GL/Test/BufferImageGLTest.cpp @@ -27,11 +27,12 @@ #include #include -#include "Magnum/BufferImage.h" #include "Magnum/PixelFormat.h" -#include "Magnum/OpenGLTester.h" +#include "Magnum/GL/BufferImage.h" +#include "Magnum/GL/PixelFormat.h" +#include "Magnum/GL/OpenGLTester.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct BufferImageGLTest: OpenGLTester { explicit BufferImageGLTest(); @@ -104,7 +105,7 @@ void BufferImageGLTest::construct() { const auto imageData = a.buffer().data(); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(a.storage().alignment(), 1); CORRADE_COMPARE(a.format(), GL::PixelFormat::Red); @@ -127,7 +128,7 @@ void BufferImageGLTest::constructGeneric() { const auto imageData = a.buffer().data(); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(a.storage().alignment(), 1); CORRADE_COMPARE(a.format(), GL::PixelFormat::Red); @@ -154,7 +155,7 @@ void BufferImageGLTest::constructCompressed() { const auto imageData = a.buffer().data(); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(a.storage().compressedBlockSize(), Vector3i{4}); @@ -183,7 +184,7 @@ void BufferImageGLTest::constructCompressedGeneric() { const auto imageData = a.buffer().data(); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(a.storage().compressedBlockSize(), Vector3i{4}); @@ -212,7 +213,7 @@ void BufferImageGLTest::constructBuffer() { const auto imageData = a.buffer().data(); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(!buffer.id()); CORRADE_COMPARE(a.buffer().id(), id); @@ -241,7 +242,7 @@ void BufferImageGLTest::constructBufferGeneric() { const auto imageData = a.buffer().data(); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(!buffer.id()); CORRADE_COMPARE(a.buffer().id(), id); @@ -274,7 +275,7 @@ void BufferImageGLTest::constructBufferCompressed() { const auto imageData = a.buffer().data(); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(a.storage().compressedBlockSize(), Vector3i{4}); @@ -309,7 +310,7 @@ void BufferImageGLTest::constructBufferCompressedGeneric() { const auto imageData = a.buffer().data(); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(a.storage().compressedBlockSize(), Vector3i{4}); @@ -332,7 +333,7 @@ void BufferImageGLTest::constructInvalidSize() { Error redirectError{&out}; /* Doesn't consider alignment */ - BufferImage2D{PixelFormat::RGB8Unorm, {1, 3}, Containers::Array{3*3}, BufferUsage::StaticDraw}; + BufferImage2D{Magnum::PixelFormat::RGB8Unorm, {1, 3}, Containers::Array{3*3}, BufferUsage::StaticDraw}; CORRADE_COMPARE(out.str(), "GL::BufferImage::BufferImage(): data too small, got 9 but expected at least 12 bytes\n"); } @@ -343,14 +344,14 @@ void BufferImageGLTest::constructCompressedInvalidSize() { { std::ostringstream out; Error redirectError{&out}; - CompressedBufferImage2D{CompressedPixelFormat::Bc2RGBAUnorm, {4, 4}, Containers::Array{2}, BufferUsage::StaticDraw}; + CompressedBufferImage2D{Magnum::CompressedPixelFormat::Bc2RGBAUnorm, {4, 4}, Containers::Array{2}, BufferUsage::StaticDraw}; CORRADE_COMPARE(out.str(), "GL::CompressedBufferImage::CompressedBufferImage(): data too small, got 2 but expected at least 4 bytes\n"); /* Size should be rounded up even if the image size is not full block */ } { std::ostringstream out; Error redirectError{&out}; - CompressedBufferImage2D{CompressedPixelFormat::Bc2RGBAUnorm, {2, 2}, Containers::Array{2}, BufferUsage::StaticDraw}; + CompressedBufferImage2D{Magnum::CompressedPixelFormat::Bc2RGBAUnorm, {2, 2}, Containers::Array{2}, BufferUsage::StaticDraw}; CORRADE_COMPARE(out.str(), "GL::CompressedBufferImage::CompressedBufferImage(): data too small, got 2 but expected at least 4 bytes\n"); } } @@ -370,7 +371,7 @@ void BufferImageGLTest::constructMove() { BufferImage2D a{PixelFormat::Red, PixelType::UnsignedByte, {4, 1}, data, BufferUsage::StaticDraw}; const Int id = a.buffer().id(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); BufferImage2D b(std::move(a)); @@ -390,7 +391,7 @@ void BufferImageGLTest::constructMove() { const Int cId = c.buffer().id(); c = std::move(b); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); CORRADE_COMPARE(b.buffer().id(), cId); @@ -408,7 +409,7 @@ void BufferImageGLTest::constructMoveCompressed() { CompressedBufferImage2D a{CompressedPixelFormat::RGBAS3tcDxt1, {4, 4}, data, BufferUsage::StaticDraw}; const Int id = a.buffer().id(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); CompressedBufferImage2D b{std::move(a)}; @@ -434,7 +435,7 @@ void BufferImageGLTest::constructMoveCompressed() { const Int cId = c.buffer().id(); c = std::move(b); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); CORRADE_COMPARE(b.buffer().id(), cId); @@ -470,7 +471,7 @@ void BufferImageGLTest::dataPropertiesCompressed() { .setCompressedBlockDataSize(16) .setImageHeight(12) .setSkip({5, 8, 11}), - CompressedPixelFormat::Bc1RGBAUnorm, {2, 8, 11}, data, BufferUsage::StaticDraw}; + Magnum::CompressedPixelFormat::Bc1RGBAUnorm, {2, 8, 11}, data, BufferUsage::StaticDraw}; CORRADE_COMPARE(image.dataProperties(), (std::pair, Math::Vector3>{{2*16, 2*16, 9*16}, {1, 3, 3}})); } @@ -487,7 +488,7 @@ void BufferImageGLTest::setData() { const auto imageData = a.buffer().data(); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(a.storage().alignment(), 4); CORRADE_COMPARE(a.format(), GL::PixelFormat::RGBA); @@ -514,7 +515,7 @@ void BufferImageGLTest::setDataGeneric() { const auto imageData = a.buffer().data(); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(a.storage().alignment(), 4); CORRADE_COMPARE(a.format(), GL::PixelFormat::RGBA); @@ -544,7 +545,7 @@ void BufferImageGLTest::setDataCompressed() { const auto imageData = a.buffer().data(); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(a.storage().compressedBlockSize(), Vector3i{4}); @@ -575,7 +576,7 @@ void BufferImageGLTest::setDataCompressedGeneric() { const auto imageData = a.buffer().data(); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(a.storage().compressedBlockSize(), Vector3i{4}); @@ -611,6 +612,6 @@ void BufferImageGLTest::releaseCompressed() { CORRADE_COMPARE(b.id(), id); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::BufferImageGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::BufferImageGLTest) diff --git a/src/Magnum/GL/Test/BufferImageTest.cpp b/src/Magnum/GL/Test/BufferImageTest.cpp index 037970c65..20a75c232 100644 --- a/src/Magnum/GL/Test/BufferImageTest.cpp +++ b/src/Magnum/GL/Test/BufferImageTest.cpp @@ -25,9 +25,9 @@ #include -#include "Magnum/BufferImage.h" +#include "Magnum/GL/BufferImage.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct BufferImageTest: TestSuite::Tester { explicit BufferImageTest(); @@ -59,6 +59,6 @@ void BufferImageTest::constructNoCreateCompressed() { CORRADE_VERIFY(true); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::BufferImageTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::BufferImageTest) diff --git a/src/Magnum/GL/Test/BufferTest.cpp b/src/Magnum/GL/Test/BufferTest.cpp index f3f6db39b..31fa28398 100644 --- a/src/Magnum/GL/Test/BufferTest.cpp +++ b/src/Magnum/GL/Test/BufferTest.cpp @@ -27,9 +27,9 @@ #include #include -#include "Magnum/Buffer.h" +#include "Magnum/GL/Buffer.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct BufferTest: TestSuite::Tester { explicit BufferTest(); @@ -75,6 +75,6 @@ void BufferTest::debugTarget() { } #endif -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::BufferTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::BufferTest) diff --git a/src/Magnum/GL/Test/BufferTextureGLTest.cpp b/src/Magnum/GL/Test/BufferTextureGLTest.cpp index caae0ef7d..04f372c8b 100644 --- a/src/Magnum/GL/Test/BufferTextureGLTest.cpp +++ b/src/Magnum/GL/Test/BufferTextureGLTest.cpp @@ -25,15 +25,15 @@ #include -#include "Magnum/Buffer.h" -#include "Magnum/BufferTexture.h" -#include "Magnum/BufferTextureFormat.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/ImageFormat.h" -#include "Magnum/OpenGLTester.h" +#include "Magnum/GL/Buffer.h" +#include "Magnum/GL/BufferTexture.h" +#include "Magnum/GL/BufferTextureFormat.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/ImageFormat.h" +#include "Magnum/GL/OpenGLTester.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct BufferTextureGLTest: OpenGLTester { explicit BufferTextureGLTest(); @@ -61,30 +61,30 @@ BufferTextureGLTest::BufferTextureGLTest() { void BufferTextureGLTest::construct() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_buffer_object::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_buffer::string() + std::string(" is not supported.")); #endif { BufferTexture texture; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(texture.id() > 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void BufferTextureGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_buffer_object::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_buffer::string() + std::string(" is not supported.")); #endif GLuint id; @@ -103,40 +103,40 @@ void BufferTextureGLTest::wrap() { void BufferTextureGLTest::bind() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_buffer_object::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_buffer::string() + std::string(" is not supported.")); #endif BufferTexture texture; texture.bind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::bind(7, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(7, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void BufferTextureGLTest::bindImage() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_buffer_object::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::shader_image_load_store::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_buffer::string() + std::string(" is not supported.")); if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif @@ -148,30 +148,30 @@ void BufferTextureGLTest::bindImage() { texture.setBuffer(BufferTextureFormat::RGBA8, buffer) .bindImage(2, ImageAccess::ReadWrite, ImageFormat::RGBA8); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbindImage(2); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbindImages(1, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #endif } void BufferTextureGLTest::setBuffer() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_buffer_object::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_buffer::string() + std::string(" is not supported.")); #endif BufferTexture texture; @@ -183,18 +183,18 @@ void BufferTextureGLTest::setBuffer() { buffer.setData(data, BufferUsage::StaticDraw); texture.setBuffer(BufferTextureFormat::R8UI, buffer); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void BufferTextureGLTest::setBufferOffset() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_object::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_buffer_range::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_buffer_object::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_buffer_range::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_buffer::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_buffer::string() + std::string(" is not supported.")); #endif /* Check that we have correct offset alignment */ @@ -212,9 +212,9 @@ void BufferTextureGLTest::setBufferOffset() { buffer.setSubData(256 - 16, data); texture.setBuffer(BufferTextureFormat::R8UI, buffer, 256, 8); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::BufferTextureGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::BufferTextureGLTest) diff --git a/src/Magnum/GL/Test/BufferTextureTest.cpp b/src/Magnum/GL/Test/BufferTextureTest.cpp index ddb8261eb..c201a230a 100644 --- a/src/Magnum/GL/Test/BufferTextureTest.cpp +++ b/src/Magnum/GL/Test/BufferTextureTest.cpp @@ -25,9 +25,9 @@ #include -#include "Magnum/BufferTexture.h" +#include "Magnum/GL/BufferTexture.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct BufferTextureTest: TestSuite::Tester { explicit BufferTextureTest(); @@ -48,6 +48,6 @@ void BufferTextureTest::constructNoCreate() { CORRADE_VERIFY(true); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::BufferTextureTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::BufferTextureTest) diff --git a/src/Magnum/GL/Test/ContextGLTest.cpp b/src/Magnum/GL/Test/ContextGLTest.cpp index 793a3353b..681270ef5 100644 --- a/src/Magnum/GL/Test/ContextGLTest.cpp +++ b/src/Magnum/GL/Test/ContextGLTest.cpp @@ -25,11 +25,11 @@ #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/OpenGLTester.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/OpenGLTester.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct ContextGLTest: OpenGLTester { explicit ContextGLTest(); @@ -72,14 +72,14 @@ void ContextGLTest::isVersionSupported() { CORRADE_VERIFY(!Context::current().isVersionSupported(Version(Int(v)+1))); /* No assertions should be fired */ - MAGNUM_ASSERT_VERSION_SUPPORTED(v); - MAGNUM_ASSERT_VERSION_SUPPORTED(Version(Int(v)-1)); + MAGNUM_ASSERT_GL_VERSION_SUPPORTED(v); + MAGNUM_ASSERT_GL_VERSION_SUPPORTED(Version(Int(v)-1)); } #ifndef MAGNUM_TARGET_GLES void ContextGLTest::isVersionSupportedES() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::ES2_compatibility::string() + std::string(" extension should not be supported, can't test")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::ES2_compatibility::string() + std::string(" extension should not be supported, can't test")); /* No assertions should be fired */ CORRADE_VERIFY(Context::current().isVersionSupported(Version::GLES200)); @@ -96,25 +96,25 @@ void ContextGLTest::supportedVersion() { void ContextGLTest::isExtensionSupported() { #ifndef MAGNUM_TARGET_GLES - if(Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::GREMEDY::string_marker::string() + std::string(" extension should not be supported, can't test")); + if(Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::GREMEDY::string_marker::string() + std::string(" extension should not be supported, can't test")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_filter_anisotropic::string() + std::string(" extension should be supported, can't test")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_filter_anisotropic::string() + std::string(" extension should be supported, can't test")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::explicit_attrib_location::string() + std::string(" extension should be supported, can't test")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::explicit_attrib_location::string() + std::string(" extension should be supported, can't test")); /* Test that we have proper extension list parser */ std::vector extensions = Context::current().extensionStrings(); CORRADE_VERIFY(std::find(extensions.begin(), extensions.end(), - Extensions::GL::EXT::texture_filter_anisotropic::string()) != extensions.end()); + Extensions::EXT::texture_filter_anisotropic::string()) != extensions.end()); CORRADE_VERIFY(std::find(extensions.begin(), extensions.end(), - Extensions::GL::GREMEDY::string_marker::string()) == extensions.end()); + Extensions::GREMEDY::string_marker::string()) == extensions.end()); /* This is disabled in GL < 3.2 to work around GLSL compiler bugs */ - CORRADE_VERIFY(!Context::current().isExtensionSupported(Version::GL310)); - CORRADE_VERIFY(Context::current().isExtensionSupported(Version::GL320)); + CORRADE_VERIFY(!Context::current().isExtensionSupported(Version::GL310)); + CORRADE_VERIFY(Context::current().isExtensionSupported(Version::GL320)); #else CORRADE_SKIP("No useful extensions to test on OpenGL ES"); #endif @@ -122,23 +122,23 @@ void ContextGLTest::isExtensionSupported() { void ContextGLTest::isExtensionDisabled() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::vertex_array_object::string() + std::string(" extension should be supported, can't test")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::vertex_array_object::string() + std::string(" extension should be supported, can't test")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::explicit_attrib_location::string() + std::string(" extension should be supported, can't test")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::explicit_attrib_location::string() + std::string(" extension should be supported, can't test")); /* This is not disabled anywhere */ - CORRADE_VERIFY(!Context::current().isExtensionDisabled()); + CORRADE_VERIFY(!Context::current().isExtensionDisabled()); /* This is disabled in GL < 3.2 to work around GLSL compiler bugs */ - CORRADE_VERIFY(Context::current().isExtensionDisabled(Version::GL310)); - CORRADE_VERIFY(!Context::current().isExtensionDisabled(Version::GL320)); + CORRADE_VERIFY(Context::current().isExtensionDisabled(Version::GL310)); + CORRADE_VERIFY(!Context::current().isExtensionDisabled(Version::GL320)); #else CORRADE_SKIP("No useful extensions to test on OpenGL ES"); #endif } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::ContextGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::ContextGLTest) diff --git a/src/Magnum/GL/Test/ContextTest.cpp b/src/Magnum/GL/Test/ContextTest.cpp index f2b2dbafd..fee5efe05 100644 --- a/src/Magnum/GL/Test/ContextTest.cpp +++ b/src/Magnum/GL/Test/ContextTest.cpp @@ -26,10 +26,10 @@ #include #include -#include "Magnum/Context.h" -#include "Magnum/Version.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Version.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct ContextTest: TestSuite::Tester { explicit ContextTest(); @@ -142,6 +142,6 @@ void ContextTest::debugDetectedDrivers() { #endif } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::ContextTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::ContextTest) diff --git a/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp b/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp index 23e7ce78e..343f75900 100644 --- a/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp @@ -25,19 +25,19 @@ #include -#include "Magnum/BufferImage.h" -#include "Magnum/CubeMapTextureArray.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" #include "Magnum/Image.h" -#include "Magnum/ImageFormat.h" -#include "Magnum/OpenGLTester.h" -#include "Magnum/PixelFormat.h" -#include "Magnum/TextureFormat.h" +#include "Magnum/GL/BufferImage.h" +#include "Magnum/GL/CubeMapTextureArray.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/ImageFormat.h" +#include "Magnum/GL/OpenGLTester.h" +#include "Magnum/GL/PixelFormat.h" +#include "Magnum/GL/TextureFormat.h" #include "Magnum/Math/Color.h" #include "Magnum/Math/Range.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct CubeMapTextureArrayGLTest: OpenGLTester { explicit CubeMapTextureArrayGLTest(); @@ -323,30 +323,30 @@ CubeMapTextureArrayGLTest::CubeMapTextureArrayGLTest() { void CubeMapTextureArrayGLTest::construct() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif { CubeMapTextureArray texture; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(texture.id() > 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void CubeMapTextureArrayGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif GLuint id; @@ -365,40 +365,40 @@ void CubeMapTextureArrayGLTest::wrap() { void CubeMapTextureArrayGLTest::bind() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif CubeMapTextureArray texture; texture.bind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::bind(7, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(7, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void CubeMapTextureArrayGLTest::bindImage() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::shader_image_load_store::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif @@ -407,23 +407,23 @@ void CubeMapTextureArrayGLTest::bindImage() { texture.setStorage(1, TextureFormat::RGBA8, {32, 32, 12}) .bindImage(2, 0, 1, ImageAccess::ReadWrite, ImageFormat::RGBA8); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); texture.bindImageLayered(3, 0, ImageAccess::ReadWrite, ImageFormat::RGBA8); AbstractTexture::unbindImage(2); AbstractTexture::unbindImage(3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbindImages(1, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #endif } @@ -432,11 +432,11 @@ template void CubeMapTextureArrayGLTest::sampling() { "sampling" : "sampling"); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif CubeMapTextureArray texture; @@ -456,114 +456,114 @@ template void CubeMapTextureArrayGLTest::sampling() { .setWrapping(T::Wrapping::ClampToEdge) #endif .setMaxAnisotropy(Sampler::maxMaxAnisotropy()) - .setCompareMode(Sampler::CompareMode::CompareRefToTexture) - .setCompareFunction(Sampler::CompareFunction::GreaterOrEqual); + .setCompareMode(SamplerCompareMode::CompareRefToTexture) + .setCompareFunction(SamplerCompareFunction::GreaterOrEqual); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void CubeMapTextureArrayGLTest::samplingSRGBDecode() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); CubeMapTextureArray texture; texture.setSRGBDecode(false); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void CubeMapTextureArrayGLTest::samplingBorderInteger() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_integer::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_border_clamp::string() + std::string(" is not supported.")); #endif CubeMapTextureArray a; - a.setWrapping(Sampler::Wrapping::ClampToBorder) + a.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Vector4i(1, 56, 78, -2)); CubeMapTextureArray b; - b.setWrapping(Sampler::Wrapping::ClampToBorder) + b.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Vector4ui(35, 56, 78, 15)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void CubeMapTextureArrayGLTest::samplingSwizzle() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_swizzle::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif CubeMapTextureArray texture; texture.setSwizzle<'b', 'g', 'r', '0'>(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void CubeMapTextureArrayGLTest::samplingDepthStencilMode() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::stencil_texturing::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif CubeMapTextureArray texture; - texture.setDepthStencilMode(Sampler::DepthStencilMode::StencilIndex); + texture.setDepthStencilMode(SamplerDepthStencilMode::StencilIndex); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #ifdef MAGNUM_TARGET_GLES void CubeMapTextureArrayGLTest::samplingBorder() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_border_clamp::string() + std::string(" is not supported.")); CubeMapTextureArray texture; - texture.setWrapping(Sampler::Wrapping::ClampToBorder) + texture.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Color3(0.5f)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif void CubeMapTextureArrayGLTest::storage() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif CubeMapTextureArray texture; texture.setStorage(5, TextureFormat::RGBA8, {32, 32, 24}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.imageSize(0), Vector3i(32, 32, 24)); CORRADE_COMPARE(texture.imageSize(1), Vector3i(16, 16, 24)); @@ -572,18 +572,18 @@ void CubeMapTextureArrayGLTest::storage() { CORRADE_COMPARE(texture.imageSize(4), Vector3i( 2, 2, 24)); CORRADE_COMPARE(texture.imageSize(5), Vector3i(0)); /* not available */ - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void CubeMapTextureArrayGLTest::image() { setTestCaseDescription(PixelStorageData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif CubeMapTextureArray texture; @@ -592,13 +592,13 @@ void CubeMapTextureArrayGLTest::image() { PixelFormat::RGBA, PixelType::UnsignedByte, {2, 2, 6}, PixelStorageData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES Image3D image = texture.image(0, {PixelStorageData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), @@ -611,11 +611,11 @@ void CubeMapTextureArrayGLTest::imageBuffer() { setTestCaseDescription(PixelStorageData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif CubeMapTextureArray texture; @@ -625,7 +625,7 @@ void CubeMapTextureArrayGLTest::imageBuffer() { PixelStorageData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES @@ -633,7 +633,7 @@ void CubeMapTextureArrayGLTest::imageBuffer() { PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6)); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorageData[testCaseInstanceId()].offset), @@ -646,18 +646,18 @@ void CubeMapTextureArrayGLTest::compressedImage() { setTestCaseDescription(CompressedPixelStorageData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif CubeMapTextureArray texture; @@ -668,12 +668,12 @@ void CubeMapTextureArrayGLTest::compressedImage() { CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 6}, CompressedPixelStorageData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CompressedImage3D image = texture.compressedImage(0, {CompressedPixelStorageData[testCaseInstanceId()].storage}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 6})); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorageData[testCaseInstanceId()].offset), @@ -686,18 +686,18 @@ void CubeMapTextureArrayGLTest::compressedImageBuffer() { setTestCaseDescription(CompressedPixelStorageData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif CubeMapTextureArray texture; @@ -709,14 +709,14 @@ void CubeMapTextureArrayGLTest::compressedImageBuffer() { CompressedPixelStorageData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES CompressedBufferImage3D image = texture.compressedImage(0, {CompressedPixelStorageData[testCaseInstanceId()].storage}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 6})); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedPixelStorageData[testCaseInstanceId()].offset), @@ -766,11 +766,11 @@ void CubeMapTextureArrayGLTest::subImage() { setTestCaseDescription(SubPixelStorageData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif CubeMapTextureArray texture; @@ -781,13 +781,13 @@ void CubeMapTextureArrayGLTest::subImage() { PixelFormat::RGBA, PixelType::UnsignedByte, {2, 2, 4}, SubPixelStorageData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES Image3D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(4, 4, 6)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()), @@ -799,11 +799,11 @@ void CubeMapTextureArrayGLTest::subImageBuffer() { setTestCaseDescription(SubPixelStorageData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif CubeMapTextureArray texture; @@ -815,14 +815,14 @@ void CubeMapTextureArrayGLTest::subImageBuffer() { SubPixelStorageData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES BufferImage3D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(4, 4, 6)); CORRADE_COMPARE_AS(Containers::arrayCast(imageData), @@ -835,22 +835,22 @@ void CubeMapTextureArrayGLTest::subImageBuffer() { void CubeMapTextureArrayGLTest::subImageQuery() { setTestCaseDescription(SubPixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); CubeMapTextureArray texture; texture.setStorage(1, TextureFormat::RGBA8, {4, 4, 6}) .setSubImage(0, {}, ImageView3D{PixelFormat::RGBA, PixelType::UnsignedByte, {4, 4, 6}, SubDataComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image3D image = texture.subImage(0, Range3Di::fromSize(Vector3i{1}, {2, 2, 4}), {SubPixelStorageData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 4)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(SubPixelStorageData[testCaseInstanceId()].offset), @@ -861,23 +861,23 @@ void CubeMapTextureArrayGLTest::subImageQuery() { void CubeMapTextureArrayGLTest::subImageQueryBuffer() { setTestCaseDescription(SubPixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); CubeMapTextureArray texture; texture.setStorage(1, TextureFormat::RGBA8, {4, 4, 6}) .setSubImage(0, {}, ImageView3D{PixelFormat::RGBA, PixelType::UnsignedByte, {4, 4, 6}, SubDataComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); BufferImage3D image = texture.subImage(0, Range3Di::fromSize(Vector3i{1}, {2, 2, 4}), {SubPixelStorageData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 4)); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(SubPixelStorageData[testCaseInstanceId()].offset), @@ -958,18 +958,18 @@ void CubeMapTextureArrayGLTest::compressedSubImage() { setTestCaseDescription(CompressedSubPixelStorageData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif CubeMapTextureArray texture; @@ -982,12 +982,12 @@ void CubeMapTextureArrayGLTest::compressedSubImage() { CompressedPixelFormat::RGBAS3tcDxt3, Vector3i{4}, CompressedSubPixelStorageData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CompressedImage3D image = texture.compressedImage(0, {}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{12, 12, 6})); @@ -1006,18 +1006,18 @@ void CubeMapTextureArrayGLTest::compressedSubImageBuffer() { setTestCaseDescription(CompressedSubPixelStorageData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif CubeMapTextureArray texture; @@ -1031,14 +1031,14 @@ void CubeMapTextureArrayGLTest::compressedSubImageBuffer() { CompressedSubPixelStorageData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES CompressedBufferImage3D image = texture.compressedImage(0, {}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{12, 12, 6})); CORRADE_COMPARE_AS(Containers::arrayCast(imageData), Containers::arrayView(CompressedSubDataComplete), @@ -1050,26 +1050,26 @@ void CubeMapTextureArrayGLTest::compressedSubImageBuffer() { void CubeMapTextureArrayGLTest::compressedSubImageQuery() { setTestCaseDescription(CompressedSubPixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); - if(CompressedSubPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); - if(CompressedSubPixelStorageData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::internalformat_query2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(CompressedSubPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedSubPixelStorageData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::internalformat_query2::string() + std::string(" is not supported.")); CubeMapTextureArray texture; texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, {12, 12, 6}) .setCompressedSubImage(0, {}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 12, 6}, CompressedSubDataComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 1}, Vector3i{4}), {CompressedSubPixelStorageData[testCaseInstanceId()].storage}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{4}); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedSubPixelStorageData[testCaseInstanceId()].offset), @@ -1080,27 +1080,27 @@ void CubeMapTextureArrayGLTest::compressedSubImageQuery() { void CubeMapTextureArrayGLTest::compressedSubImageQueryBuffer() { setTestCaseDescription(CompressedSubPixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); - if(CompressedSubPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); - if(CompressedSubPixelStorageData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::internalformat_query2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(CompressedSubPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedSubPixelStorageData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::internalformat_query2::string() + std::string(" is not supported.")); CubeMapTextureArray texture; texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, {12, 12, 6}) .setCompressedSubImage(0, {}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 12, 6}, CompressedSubDataComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 1}, Vector3i{4}), {CompressedSubPixelStorageData[testCaseInstanceId()].storage}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{4}); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedSubPixelStorageData[testCaseInstanceId()].offset), @@ -1111,13 +1111,13 @@ void CubeMapTextureArrayGLTest::compressedSubImageQueryBuffer() { void CubeMapTextureArrayGLTest::generateMipmap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif CubeMapTextureArray texture; @@ -1129,7 +1129,7 @@ void CubeMapTextureArrayGLTest::generateMipmap() { texture.generateMipmap(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.imageSize(0), Vector3i(32, 32, 24)); CORRADE_COMPARE(texture.imageSize(1), Vector3i(16, 16, 24)); @@ -1138,41 +1138,41 @@ void CubeMapTextureArrayGLTest::generateMipmap() { CORRADE_COMPARE(texture.imageSize(4), Vector3i( 2, 2, 24)); CORRADE_COMPARE(texture.imageSize(5), Vector3i( 1, 1, 24)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void CubeMapTextureArrayGLTest::invalidateImage() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif CubeMapTextureArray texture; texture.setStorage(2, TextureFormat::RGBA8, {32, 32, 24}); texture.invalidateImage(1); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void CubeMapTextureArrayGLTest::invalidateSubImage() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not supported.")); #endif CubeMapTextureArray texture; texture.setStorage(2, TextureFormat::RGBA8, {32, 32, 24}); texture.invalidateSubImage(1, Vector3i(2), Vector3i(8)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::CubeMapTextureArrayGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::CubeMapTextureArrayGLTest) diff --git a/src/Magnum/GL/Test/CubeMapTextureArrayTest.cpp b/src/Magnum/GL/Test/CubeMapTextureArrayTest.cpp index 1fe37bf3d..c204efdef 100644 --- a/src/Magnum/GL/Test/CubeMapTextureArrayTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureArrayTest.cpp @@ -25,9 +25,9 @@ #include -#include "Magnum/CubeMapTextureArray.h" +#include "Magnum/GL/CubeMapTextureArray.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct CubeMapTextureArrayTest: TestSuite::Tester { explicit CubeMapTextureArrayTest(); @@ -48,6 +48,6 @@ void CubeMapTextureArrayTest::constructNoCreate() { CORRADE_VERIFY(true); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::CubeMapTextureArrayTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::CubeMapTextureArrayTest) diff --git a/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp b/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp index b7be92214..31ca434d9 100644 --- a/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp @@ -25,23 +25,23 @@ #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" +#include "Magnum/Image.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" #ifndef MAGNUM_TARGET_GLES2 -#include "Magnum/BufferImage.h" +#include "Magnum/GL/BufferImage.h" #endif -#include "Magnum/CubeMapTexture.h" -#include "Magnum/Image.h" +#include "Magnum/GL/CubeMapTexture.h" #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -#include "Magnum/ImageFormat.h" +#include "Magnum/GL/ImageFormat.h" #endif -#include "Magnum/OpenGLTester.h" -#include "Magnum/PixelFormat.h" -#include "Magnum/TextureFormat.h" +#include "Magnum/GL/OpenGLTester.h" +#include "Magnum/GL/PixelFormat.h" +#include "Magnum/GL/TextureFormat.h" #include "Magnum/Math/Color.h" #include "Magnum/Math/Range.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct CubeMapTextureGLTest: OpenGLTester { explicit CubeMapTextureGLTest(); @@ -389,11 +389,11 @@ void CubeMapTextureGLTest::construct() { { CubeMapTexture texture; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(texture.id() > 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void CubeMapTextureGLTest::wrap() { @@ -415,26 +415,26 @@ void CubeMapTextureGLTest::bind() { CubeMapTexture texture; texture.bind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::bind(7, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(7, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void CubeMapTextureGLTest::bindImage() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::shader_image_load_store::string() + std::string(" is not supported.")); #else if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); @@ -444,23 +444,23 @@ void CubeMapTextureGLTest::bindImage() { texture.setStorage(1, TextureFormat::RGBA8, Vector2i{32}) .bindImage(2, 0, CubeMapCoordinate::NegativeX, ImageAccess::ReadWrite, ImageFormat::RGBA8); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); texture.bindImageLayered(3, 0, ImageAccess::ReadWrite, ImageFormat::RGBA8); AbstractTexture::unbindImage(2); AbstractTexture::unbindImage(3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbindImages(1, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #endif } #endif @@ -489,115 +489,115 @@ template void CubeMapTextureGLTest::sampling() { #endif .setMaxAnisotropy(Sampler::maxMaxAnisotropy()) #ifndef MAGNUM_TARGET_GLES2 - .setCompareMode(Sampler::CompareMode::CompareRefToTexture) - .setCompareFunction(Sampler::CompareFunction::GreaterOrEqual) + .setCompareMode(SamplerCompareMode::CompareRefToTexture) + .setCompareFunction(SamplerCompareFunction::GreaterOrEqual) #endif ; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #ifndef MAGNUM_TARGET_WEBGL void CubeMapTextureGLTest::samplingSRGBDecode() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::sRGB::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::sRGB::string() + std::string(" is not supported.")); #endif - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); CubeMapTexture texture; texture.setSRGBDecode(false); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #ifndef MAGNUM_TARGET_GLES2 void CubeMapTextureGLTest::samplingSwizzle() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_swizzle::string() + std::string(" is not supported.")); #endif CubeMapTexture texture; texture.setSwizzle<'b', 'g', 'r', '0'>(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #elif !defined(MAGNUM_TARGET_WEBGL) void CubeMapTextureGLTest::samplingMaxLevel() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::APPLE::texture_max_level::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::APPLE::texture_max_level::string() + std::string(" is not supported.")); CubeMapTexture texture; texture.setMaxLevel(750); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void CubeMapTextureGLTest::samplingCompare() { - if(!Context::current().isExtensionSupported() || - !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::NV::shadow_samplers_cube::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported() || + !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::NV::shadow_samplers_cube::string() + std::string(" is not supported.")); CubeMapTexture texture; - texture.setCompareMode(Sampler::CompareMode::CompareRefToTexture) - .setCompareFunction(Sampler::CompareFunction::GreaterOrEqual); + texture.setCompareMode(SamplerCompareMode::CompareRefToTexture) + .setCompareFunction(SamplerCompareFunction::GreaterOrEqual); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void CubeMapTextureGLTest::samplingBorderInteger() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_integer::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_border_clamp::string() + std::string(" is not supported.")); #endif CubeMapTexture a; - a.setWrapping(Sampler::Wrapping::ClampToBorder) + a.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Vector4i(1, 56, 78, -2)); CubeMapTexture b; - b.setWrapping(Sampler::Wrapping::ClampToBorder) + b.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Vector4ui(35, 56, 78, 15)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #ifndef MAGNUM_TARGET_GLES2 void CubeMapTextureGLTest::samplingDepthStencilMode() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::stencil_texturing::string() + std::string(" is not supported.")); #else if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 not supported."); #endif CubeMapTexture texture; - texture.setDepthStencilMode(Sampler::DepthStencilMode::StencilIndex); + texture.setDepthStencilMode(SamplerDepthStencilMode::StencilIndex); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) void CubeMapTextureGLTest::samplingBorder() { - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("No required extension is supported."); CubeMapTexture texture; - texture.setWrapping(Sampler::Wrapping::ClampToBorder) + texture.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Color3(0.5f)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif @@ -611,7 +611,7 @@ void CubeMapTextureGLTest::storage() { #endif Vector2i(32)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES @@ -627,7 +627,7 @@ void CubeMapTextureGLTest::storage() { /* Not available */ CORRADE_COMPARE(texture.imageSize(5), Vector2i(0)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #endif } @@ -640,8 +640,8 @@ void CubeMapTextureGLTest::image() { #ifdef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_WEBGL - if(PixelStorageData[testCaseInstanceId()].storage != PixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::unpack_subimage::string() + std::string(" is not supported.")); + if(PixelStorageData[testCaseInstanceId()].storage != PixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::unpack_subimage::string() + std::string(" is not supported.")); #else if(PixelStorageData[testCaseInstanceId()].storage != PixelStorage{}) CORRADE_SKIP("Image unpack is not supported in WebGL 1."); @@ -669,7 +669,7 @@ void CubeMapTextureGLTest::image() { texture.setImage(CubeMapCoordinate::NegativeZ, 0, format, ImageView2D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(2), Zero}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES @@ -677,7 +677,7 @@ void CubeMapTextureGLTest::image() { {PixelStorageData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), @@ -707,7 +707,7 @@ void CubeMapTextureGLTest::imageBuffer() { texture.setImage(CubeMapCoordinate::NegativeZ, 0, TextureFormat::RGBA8, ImageView2D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(2), Zero}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES @@ -715,7 +715,7 @@ void CubeMapTextureGLTest::imageBuffer() { {PixelStorageData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorageData[testCaseInstanceId()].offset), @@ -741,8 +741,8 @@ void CubeMapTextureGLTest::subImage() { #ifdef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_WEBGL - if(PixelStorageData[testCaseInstanceId()].storage != PixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::unpack_subimage::string() + std::string(" is not supported.")); + if(PixelStorageData[testCaseInstanceId()].storage != PixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::unpack_subimage::string() + std::string(" is not supported.")); #else if(PixelStorageData[testCaseInstanceId()].storage != PixelStorage{}) CORRADE_SKIP("Image unpack is not supported in WebGL 1."); @@ -773,13 +773,13 @@ void CubeMapTextureGLTest::subImage() { PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(2), PixelStorageData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES Image2D image = texture.image(CubeMapCoordinate::PositiveX, 0, {PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(4)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()), @@ -810,14 +810,14 @@ void CubeMapTextureGLTest::subImageBuffer() { PixelStorageData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES BufferImage2D image = texture.image(CubeMapCoordinate::PositiveX, 0, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(4)); CORRADE_COMPARE_AS(Containers::arrayCast(imageData), @@ -831,23 +831,23 @@ void CubeMapTextureGLTest::subImageBuffer() { void CubeMapTextureGLTest::subImageQuery() { setTestCaseDescription(PixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); /* I'm too lazy to call setSubImage() six times */ - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::direct_state_access::string() + std::string(" is not supported.")); CubeMapTexture texture; texture.setStorage(1, TextureFormat::RGBA8, Vector2i{4}) .setSubImage(0, {}, ImageView3D{PixelFormat::RGBA, PixelType::UnsignedByte, {4, 4, 1}, SubDataComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image3D image = texture.subImage(0, Range3Di::fromSize({1, 1, 0}, {2, 2, 1}), {PixelStorageData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 1)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), @@ -858,24 +858,24 @@ void CubeMapTextureGLTest::subImageQuery() { void CubeMapTextureGLTest::subImageQueryBuffer() { setTestCaseDescription(PixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); /* I'm too lazy to call setSubImage() six times */ - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::direct_state_access::string() + std::string(" is not supported.")); CubeMapTexture texture; texture.setStorage(1, TextureFormat::RGBA8, Vector2i{4}) .setSubImage(0, {}, ImageView3D{PixelFormat::RGBA, PixelType::UnsignedByte, {4, 4, 1}, SubDataComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); BufferImage3D image = texture.subImage(0, Range3Di::fromSize({1, 1, 0}, {2, 2, 1}), {PixelStorageData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 1)); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorageData[testCaseInstanceId()].offset), @@ -888,16 +888,16 @@ void CubeMapTextureGLTest::compressedImage() { setTestCaseDescription(CompressedPixelStorageData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif const CompressedImageView2D view{ @@ -915,12 +915,12 @@ void CubeMapTextureGLTest::compressedImage() { .setCompressedImage(CubeMapCoordinate::PositiveZ, 0, view) .setCompressedImage(CubeMapCoordinate::NegativeZ, 0, view); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CompressedImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX, 0, {CompressedPixelStorageData[testCaseInstanceId()].storage}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{4}); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorageData[testCaseInstanceId()].offset), @@ -934,16 +934,16 @@ void CubeMapTextureGLTest::compressedImageBuffer() { setTestCaseDescription(CompressedPixelStorageData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif CompressedBufferImage2D buffer{ @@ -962,14 +962,14 @@ void CubeMapTextureGLTest::compressedImageBuffer() { .setCompressedImage(CubeMapCoordinate::PositiveZ, 0, buffer) .setCompressedImage(CubeMapCoordinate::NegativeZ, 0, buffer); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CompressedBufferImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX, 0, {CompressedPixelStorageData[testCaseInstanceId()].storage}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{4}); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedPixelStorageData[testCaseInstanceId()].offset), @@ -984,18 +984,18 @@ void CubeMapTextureGLTest::immutableCompressedImage() { setTestCaseDescription(CompressedPixelStorageData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_storage::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_storage::string() + std::string(" is not supported.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_storage::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_storage::string() + std::string(" is not supported.")); #endif - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif /* Testing that GL_TEXTURE_COMPRESSED_IMAGE_SIZE is consistent and returns @@ -1021,12 +1021,12 @@ void CubeMapTextureGLTest::immutableCompressedImage() { .setCompressedSubImage(CubeMapCoordinate::PositiveZ, 0, {}, view) .setCompressedSubImage(CubeMapCoordinate::NegativeZ, 0, {}, view); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CompressedImage2D image = texture.compressedImage(CubeMapCoordinate::NegativeY, 0, {CompressedPixelStorageData[testCaseInstanceId()].storage}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{4}); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorageData[testCaseInstanceId()].offset), @@ -1071,16 +1071,16 @@ void CubeMapTextureGLTest::compressedSubImage() { setTestCaseDescription(CompressedPixelStorageData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif CubeMapTexture texture; @@ -1103,17 +1103,17 @@ void CubeMapTextureGLTest::compressedSubImage() { CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, CompressedPixelStorageData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CompressedImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX, 0, {}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{12}); { - CORRADE_EXPECT_FAIL_IF(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && Context::current().isExtensionSupported() && (Context::current().detectedDriver() & Context::DetectedDriver::NVidia), + CORRADE_EXPECT_FAIL_IF(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && Context::current().isExtensionSupported() && (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(Containers::arrayCast(image.data()), @@ -1128,16 +1128,16 @@ void CubeMapTextureGLTest::compressedSubImageBuffer() { setTestCaseDescription(CompressedPixelStorageData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif CubeMapTexture texture; @@ -1161,14 +1161,14 @@ void CubeMapTextureGLTest::compressedSubImageBuffer() { CompressedPixelStorageData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CompressedBufferImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX, 0, {}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{12}); CORRADE_COMPARE_AS(Containers::arrayCast(imageData), @@ -1182,27 +1182,27 @@ void CubeMapTextureGLTest::compressedSubImageBuffer() { void CubeMapTextureGLTest::compressedSubImageQuery() { setTestCaseDescription(CompressedPixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); /* I'm too lazy to call setSubImage() six times */ - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); - if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); - if(CompressedPixelStorageData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::internalformat_query2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::direct_state_access::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorageData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::internalformat_query2::string() + std::string(" is not supported.")); CubeMapTexture texture; texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, Vector2i{12}) .setCompressedSubImage(0, {}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 12, 1}, CompressedSubDataComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 0}, {4, 4, 1}), {CompressedPixelStorageData[testCaseInstanceId()].storage}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 1})); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorageData[testCaseInstanceId()].offset), @@ -1213,28 +1213,28 @@ void CubeMapTextureGLTest::compressedSubImageQuery() { void CubeMapTextureGLTest::compressedSubImageQueryBuffer() { setTestCaseDescription(CompressedPixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); /* I'm too lazy to call setSubImage() six times */ - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); - if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); - if(CompressedPixelStorageData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::internalformat_query2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::direct_state_access::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorageData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::internalformat_query2::string() + std::string(" is not supported.")); CubeMapTexture texture; texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, Vector2i{12}) .setCompressedSubImage(0, {}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 12, 1}, CompressedSubDataComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 4, 0}, {4, 4, 1}), {CompressedPixelStorageData[testCaseInstanceId()].storage}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 1})); CORRADE_COMPARE_AS( @@ -1248,8 +1248,8 @@ void CubeMapTextureGLTest::compressedSubImageQueryBuffer() { void CubeMapTextureGLTest::fullImageQuery() { setTestCaseDescription(FullPixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::direct_state_access::string() + std::string(" is not supported.")); CubeMapTexture texture; texture.setStorage(1, TextureFormat::RGBA8, Vector2i{2, 2}) @@ -1257,12 +1257,12 @@ void CubeMapTextureGLTest::fullImageQuery() { PixelFormat::RGBA, PixelType::UnsignedByte, {2, 2, 6}, FullPixelStorageData[testCaseInstanceId()].data}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image3D image = texture.image(0, {FullPixelStorageData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(FullPixelStorageData[testCaseInstanceId()].offset), @@ -1273,8 +1273,8 @@ void CubeMapTextureGLTest::fullImageQuery() { void CubeMapTextureGLTest::fullImageQueryBuffer() { setTestCaseDescription(FullPixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::direct_state_access::string() + std::string(" is not supported.")); CubeMapTexture texture; texture.setStorage(1, TextureFormat::RGBA8, Vector2i{2}) @@ -1283,13 +1283,13 @@ void CubeMapTextureGLTest::fullImageQueryBuffer() { FullPixelStorageData[testCaseInstanceId()].data, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); BufferImage3D image = texture.image(0, {FullPixelStorageData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2, 2, 6)); const auto imageData = image.buffer().data(); @@ -1300,12 +1300,12 @@ void CubeMapTextureGLTest::fullImageQueryBuffer() { void CubeMapTextureGLTest::compressedFullImageQuery() { setTestCaseDescription(CompressedFullPixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); - if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::direct_state_access::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); CubeMapTexture texture; texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, Vector2i{4}) @@ -1313,11 +1313,11 @@ void CubeMapTextureGLTest::compressedFullImageQuery() { CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 6}, CompressedFullPixelStorageData[testCaseInstanceId()].data}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedImage3D image = texture.compressedImage(0, {CompressedFullPixelStorageData[testCaseInstanceId()].storage}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 6})); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedFullPixelStorageData[testCaseInstanceId()].offset), @@ -1328,12 +1328,12 @@ void CubeMapTextureGLTest::compressedFullImageQuery() { void CubeMapTextureGLTest::compressedFullImageQueryBuffer() { setTestCaseDescription(CompressedFullPixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::direct_state_access::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); - if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::direct_state_access::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(CompressedPixelStorageData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); CubeMapTexture texture; texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, Vector2i{4}) @@ -1342,11 +1342,11 @@ void CubeMapTextureGLTest::compressedFullImageQueryBuffer() { CompressedFullPixelStorageData[testCaseInstanceId()].data, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedBufferImage3D image = texture.compressedImage(0, {CompressedFullPixelStorageData[testCaseInstanceId()].storage}, BufferUsage::StaticRead); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 6})); const auto imageData = image.buffer().data(); @@ -1385,7 +1385,7 @@ void CubeMapTextureGLTest::generateMipmap() { texture.generateMipmap(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES @@ -1396,7 +1396,7 @@ void CubeMapTextureGLTest::generateMipmap() { CORRADE_COMPARE(texture.imageSize(4), Vector2i( 2)); CORRADE_COMPARE(texture.imageSize(5), Vector2i( 1)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #endif } @@ -1411,7 +1411,7 @@ void CubeMapTextureGLTest::invalidateImage() { Vector2i(32)); texture.invalidateImage(1); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void CubeMapTextureGLTest::invalidateSubImage() { @@ -1435,10 +1435,10 @@ void CubeMapTextureGLTest::invalidateSubImage() { "Broken on Mesa."); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::CubeMapTextureGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::CubeMapTextureGLTest) diff --git a/src/Magnum/GL/Test/CubeMapTextureTest.cpp b/src/Magnum/GL/Test/CubeMapTextureTest.cpp index ca3d39c01..b13447bc1 100644 --- a/src/Magnum/GL/Test/CubeMapTextureTest.cpp +++ b/src/Magnum/GL/Test/CubeMapTextureTest.cpp @@ -25,9 +25,9 @@ #include -#include "Magnum/CubeMapTexture.h" +#include "Magnum/GL/CubeMapTexture.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct CubeMapTextureTest: TestSuite::Tester { explicit CubeMapTextureTest(); @@ -48,6 +48,6 @@ void CubeMapTextureTest::constructNoCreate() { CORRADE_VERIFY(true); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::CubeMapTextureTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::CubeMapTextureTest) diff --git a/src/Magnum/GL/Test/DebugOutputGLTest.cpp b/src/Magnum/GL/Test/DebugOutputGLTest.cpp index f037ba528..dbf594204 100644 --- a/src/Magnum/GL/Test/DebugOutputGLTest.cpp +++ b/src/Magnum/GL/Test/DebugOutputGLTest.cpp @@ -25,12 +25,12 @@ #include -#include "Magnum/Context.h" -#include "Magnum/DebugOutput.h" -#include "Magnum/Extensions.h" -#include "Magnum/OpenGLTester.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/DebugOutput.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/OpenGLTester.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct DebugOutputGLTest: OpenGLTester { explicit DebugOutputGLTest(); @@ -61,32 +61,32 @@ DebugOutputGLTest::DebugOutputGLTest() { } void DebugOutputGLTest::setCallback() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is not supported")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::KHR::debug::string() + std::string(" is not supported")); /* Need to be careful, because the test runner is using debug output too */ DebugOutput::setDefaultCallback(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void DebugOutputGLTest::setEnabled() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is not supported")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::KHR::debug::string() + std::string(" is not supported")); /* Try at least some combinations */ DebugOutput::setEnabled(DebugOutput::Source::Application, true); DebugOutput::setEnabled(DebugOutput::Source::Application, DebugOutput::Type::UndefinedBehavior, {3168, 35487, 234487}, false); DebugOutput::setEnabled(true); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void DebugOutputGLTest::messageNoOp() { - if(Context::current().isExtensionSupported() || - Context::current().isExtensionSupported() + if(Context::current().isExtensionSupported() || + Context::current().isExtensionSupported() #ifndef MAGNUM_TARGET_GLES - || Context::current().isExtensionSupported() + || Context::current().isExtensionSupported() #endif ) CORRADE_SKIP("The extensions are supported, cannot test."); @@ -94,12 +94,12 @@ void DebugOutputGLTest::messageNoOp() { DebugMessage::insert(DebugMessage::Source::Application, DebugMessage::Type::Marker, 1337, DebugOutput::Severity::Notification, "Hello from OpenGL command stream!"); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void DebugOutputGLTest::message() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is not supported")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::KHR::debug::string() + std::string(" is not supported")); /* Need to be careful, because the test runner is using debug output too */ std::ostringstream out; @@ -107,16 +107,16 @@ void DebugOutputGLTest::message() { DebugMessage::insert(DebugMessage::Source::Application, DebugMessage::Type::Marker, 1337, DebugOutput::Severity::High, "Hello from OpenGL command stream!"); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(out.str(), "Debug output: high severity application marker (1337): Hello from OpenGL command stream!\n"); } void DebugOutputGLTest::messageFallback() { - if(Context::current().isExtensionSupported() || - (!Context::current().isExtensionSupported() + if(Context::current().isExtensionSupported() || + (!Context::current().isExtensionSupported() #ifndef MAGNUM_TARGET_GLES - && !Context::current().isExtensionSupported() + && !Context::current().isExtensionSupported() #endif )) CORRADE_SKIP("No proper extension is supported"); @@ -124,24 +124,24 @@ void DebugOutputGLTest::messageFallback() { DebugMessage::insert(DebugMessage::Source::Application, DebugMessage::Type::Marker, 1337, DebugOutput::Severity::Notification, "Hello from OpenGL command stream!"); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void DebugOutputGLTest::groupNoOp() { - if(Context::current().isExtensionSupported() || - Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported() || + Context::current().isExtensionSupported()) CORRADE_SKIP("The extensions are supported, cannot test."); { DebugGroup g{DebugGroup::Source::Application, 1337, "Debug group"}; } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void DebugOutputGLTest::group() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::KHR::debug::string() + std::string(" is not supported")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::KHR::debug::string() + std::string(" is not supported")); /* Need to be careful, because the test runner is using debug output too */ std::ostringstream out; @@ -153,7 +153,7 @@ void DebugOutputGLTest::group() { g2.pop(); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(out.str(), "Debug output: application debug group enter (42): Automatic debug group\n" "Debug output: third party debug group enter (1337): Manual debug group\n" @@ -162,17 +162,17 @@ void DebugOutputGLTest::group() { } void DebugOutputGLTest::groupFallback() { - if(Context::current().isExtensionSupported() || - !Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported() || + !Context::current().isExtensionSupported()) CORRADE_SKIP("No proper extension is supported"); { DebugGroup g{DebugGroup::Source::Application, 1337, "Debug group"}; } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::DebugOutputGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::DebugOutputGLTest) diff --git a/src/Magnum/GL/Test/DebugOutputTest.cpp b/src/Magnum/GL/Test/DebugOutputTest.cpp index 943d5a5d5..6d74cd294 100644 --- a/src/Magnum/GL/Test/DebugOutputTest.cpp +++ b/src/Magnum/GL/Test/DebugOutputTest.cpp @@ -26,9 +26,9 @@ #include #include -#include "Magnum/DebugOutput.h" +#include "Magnum/GL/DebugOutput.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct DebugOutputTest: TestSuite::Tester { explicit DebugOutputTest(); @@ -90,6 +90,6 @@ void DebugOutputTest::debugGroupSource() { CORRADE_COMPARE(o.str(), "GL::DebugGroup::Source::ThirdParty GL::DebugGroup::Source(0xdead)\n"); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::DebugOutputTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::DebugOutputTest) diff --git a/src/Magnum/GL/Test/DefaultFramebufferTest.cpp b/src/Magnum/GL/Test/DefaultFramebufferTest.cpp index 74c7c3832..07a0ad603 100644 --- a/src/Magnum/GL/Test/DefaultFramebufferTest.cpp +++ b/src/Magnum/GL/Test/DefaultFramebufferTest.cpp @@ -26,9 +26,9 @@ #include #include -#include "Magnum/DefaultFramebuffer.h" +#include "Magnum/GL/DefaultFramebuffer.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct DefaultFramebufferTest: TestSuite::Tester { explicit DefaultFramebufferTest(); @@ -47,6 +47,6 @@ void DefaultFramebufferTest::debugStatus() { CORRADE_COMPARE(out.str(), "GL::DefaultFramebuffer::Status::Complete GL::DefaultFramebuffer::Status(0xdead)\n"); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::DefaultFramebufferTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::DefaultFramebufferTest) diff --git a/src/Magnum/GL/Test/FramebufferGLTest.cpp b/src/Magnum/GL/Test/FramebufferGLTest.cpp index f60fa04fc..57550e662 100644 --- a/src/Magnum/GL/Test/FramebufferGLTest.cpp +++ b/src/Magnum/GL/Test/FramebufferGLTest.cpp @@ -25,32 +25,32 @@ #include -#include "Magnum/Context.h" -#include "Magnum/CubeMapTexture.h" -#include "Magnum/Extensions.h" -#include "Magnum/Framebuffer.h" #include "Magnum/Image.h" -#include "Magnum/PixelFormat.h" -#include "Magnum/Renderbuffer.h" -#include "Magnum/RenderbufferFormat.h" -#include "Magnum/Texture.h" -#include "Magnum/TextureFormat.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/CubeMapTexture.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Framebuffer.h" +#include "Magnum/GL/OpenGLTester.h" +#include "Magnum/GL/PixelFormat.h" +#include "Magnum/GL/Renderbuffer.h" +#include "Magnum/GL/RenderbufferFormat.h" +#include "Magnum/GL/Texture.h" +#include "Magnum/GL/TextureFormat.h" #include "Magnum/Math/Color.h" -#include "Magnum/OpenGLTester.h" #ifndef MAGNUM_TARGET_GLES2 -#include "Magnum/BufferImage.h" -#include "Magnum/MultisampleTexture.h" -#include "Magnum/TextureArray.h" +#include "Magnum/GL/BufferImage.h" +#include "Magnum/GL/MultisampleTexture.h" +#include "Magnum/GL/TextureArray.h" #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -#include "Magnum/CubeMapTextureArray.h" +#include "Magnum/GL/CubeMapTextureArray.h" #endif #ifndef MAGNUM_TARGET_GLES -#include "Magnum/RectangleTexture.h" +#include "Magnum/GL/RectangleTexture.h" #endif -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct FramebufferGLTest: OpenGLTester { explicit FramebufferGLTest(); @@ -276,7 +276,7 @@ FramebufferGLTest::FramebufferGLTest() { }); #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - if(Context::current().isExtensionSupported()) { + if(Context::current().isExtensionSupported()) { rgbaFormatES2 = TextureFormat::RGBA8; depthStencilFormatES2 = TextureFormat::Depth24Stencil8; } else { @@ -288,19 +288,19 @@ FramebufferGLTest::FramebufferGLTest() { void FramebufferGLTest::construct() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif { const Framebuffer framebuffer({{32, 16}, {128, 256}}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(framebuffer.id() > 0); CORRADE_COMPARE(framebuffer.viewport(), Range2Di({32, 16}, {128, 256})); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void FramebufferGLTest::constructCopy() { @@ -310,14 +310,14 @@ void FramebufferGLTest::constructCopy() { void FramebufferGLTest::constructMove() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif Framebuffer a({{32, 16}, {128, 256}}); const Int id = a.id(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); Framebuffer b(std::move(a)); @@ -330,7 +330,7 @@ void FramebufferGLTest::constructMove() { const Int cId = c.id(); c = std::move(b); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); CORRADE_COMPARE(b.id(), cId); CORRADE_COMPARE(c.id(), id); @@ -339,8 +339,8 @@ void FramebufferGLTest::constructMove() { void FramebufferGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif GLuint id; @@ -360,22 +360,22 @@ void FramebufferGLTest::wrap() { #ifndef MAGNUM_TARGET_WEBGL void FramebufferGLTest::label() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif /* No-Op version is tested in AbstractObjectGLTest */ - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); Framebuffer framebuffer({{}, Vector2i(32)}); CORRADE_COMPARE(framebuffer.label(), ""); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); framebuffer.setLabel("MyFramebuffer"); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.label(), "MyFramebuffer"); } @@ -383,8 +383,8 @@ void FramebufferGLTest::label() { void FramebufferGLTest::attachRenderbuffer() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif Renderbuffer color; @@ -398,11 +398,11 @@ void FramebufferGLTest::attachRenderbuffer() { on my NVidia, thus we need to do this juggling with one renderbuffer */ Renderbuffer depthStencil; #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - if(Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - Debug() << "Using" << Extensions::GL::OES::packed_depth_stencil::string(); + Debug() << "Using" << Extensions::OES::packed_depth_stencil::string(); #endif depthStencil.setStorage( #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) @@ -421,13 +421,13 @@ void FramebufferGLTest::attachRenderbuffer() { .attachRenderbuffer(Framebuffer::BufferAttachment::Depth, depthStencil); #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - if(Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { framebuffer.attachRenderbuffer(Framebuffer::BufferAttachment::Stencil, depthStencil); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } @@ -435,11 +435,11 @@ void FramebufferGLTest::attachRenderbuffer() { #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) void FramebufferGLTest::attachRenderbufferMultisample() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available."); #endif @@ -451,7 +451,7 @@ void FramebufferGLTest::attachRenderbufferMultisample() { #endif #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - MAGNUM_ASSERT_EXTENSION_SUPPORTED(Extensions::GL::OES::packed_depth_stencil); + MAGNUM_ASSERT_GL_EXTENSION_SUPPORTED(Extensions::OES::packed_depth_stencil); #endif Renderbuffer depthStencil; @@ -466,7 +466,7 @@ void FramebufferGLTest::attachRenderbufferMultisample() { .attachRenderbuffer(Framebuffer::BufferAttachment::Stencil, depthStencil); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } @@ -474,8 +474,8 @@ void FramebufferGLTest::attachRenderbufferMultisample() { #ifndef MAGNUM_TARGET_GLES void FramebufferGLTest::attachTexture1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); Texture1D color; color.setStorage(1, TextureFormat::RGBA8, 128); @@ -487,7 +487,7 @@ void FramebufferGLTest::attachTexture1D() { framebuffer.attachTexture(Framebuffer::ColorAttachment(0), color, 0) .attachTexture(Framebuffer::BufferAttachment::DepthStencil, depthStencil, 0); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } @@ -495,15 +495,15 @@ void FramebufferGLTest::attachTexture1D() { void FramebufferGLTest::attachTexture2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Framebuffer framebuffer({{}, Vector2i(128)}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Texture2D color; color.setStorage(1, @@ -516,18 +516,18 @@ void FramebufferGLTest::attachTexture2D() { #endif Vector2i(128)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); framebuffer.attachTexture(Framebuffer::ColorAttachment(0), color, 0); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - if(Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - Debug() << "Using" << Extensions::GL::OES::packed_depth_stencil::string(); + Debug() << "Using" << Extensions::OES::packed_depth_stencil::string(); #endif /** @todo Is there any better way to select proper sized/unsized format on ES2? */ @@ -549,8 +549,8 @@ void FramebufferGLTest::attachTexture2D() { } #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - else if(Context::current().isExtensionSupported()) { - Debug() << "Using" << Extensions::GL::OES::depth_texture::string(); + else if(Context::current().isExtensionSupported()) { + Debug() << "Using" << Extensions::OES::depth_texture::string(); Texture2D depth; depth.setStorage(1, TextureFormat::DepthComponent16, Vector2i(128)); @@ -558,7 +558,7 @@ void FramebufferGLTest::attachTexture2D() { } #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } @@ -566,11 +566,11 @@ void FramebufferGLTest::attachTexture2D() { #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) void FramebufferGLTest::attachTexture3D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_3D::string() + std::string(" is not available.")); #endif Texture3D color; @@ -585,7 +585,7 @@ void FramebufferGLTest::attachTexture3D() { Framebuffer framebuffer({{}, Vector2i(128)}); framebuffer.attachTextureLayer(Framebuffer::ColorAttachment(0), color, 0, 0); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } @@ -593,10 +593,10 @@ void FramebufferGLTest::attachTexture3D() { #ifndef MAGNUM_TARGET_GLES void FramebufferGLTest::attachTexture1DArray() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not available.")); Texture1DArray color; color.setStorage(1, TextureFormat::RGBA8, {128, 8}); @@ -608,7 +608,7 @@ void FramebufferGLTest::attachTexture1DArray() { framebuffer.attachTextureLayer(Framebuffer::ColorAttachment(0), color, 0, 3) .attachTextureLayer(Framebuffer::BufferAttachment::DepthStencil, depthStencil, 0, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } @@ -617,10 +617,10 @@ void FramebufferGLTest::attachTexture1DArray() { #ifndef MAGNUM_TARGET_GLES2 void FramebufferGLTest::attachTexture2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not available.")); #endif Texture2DArray color; @@ -633,7 +633,7 @@ void FramebufferGLTest::attachTexture2DArray() { framebuffer.attachTextureLayer(Framebuffer::ColorAttachment(0), color, 0, 3) .attachTextureLayer(Framebuffer::BufferAttachment::DepthStencil, depthStencil, 0, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } @@ -642,10 +642,10 @@ void FramebufferGLTest::attachTexture2DArray() { #ifndef MAGNUM_TARGET_GLES2 void FramebufferGLTest::attachTexture2DMultisample() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string(" is not available.")); #else if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); @@ -665,7 +665,7 @@ void FramebufferGLTest::attachTexture2DMultisample() { framebuffer.attachTexture(Framebuffer::ColorAttachment(0), color) .attachTexture(Framebuffer::BufferAttachment::DepthStencil, depthStencil); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } @@ -674,13 +674,13 @@ void FramebufferGLTest::attachTexture2DMultisample() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void FramebufferGLTest::attachTexture2DMultisampleArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string(" is not available.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_storage_multisample_2d_array::string() + std::string(" is not available.")); #endif MultisampleTexture2DArray color; @@ -697,7 +697,7 @@ void FramebufferGLTest::attachTexture2DMultisampleArray() { framebuffer.attachTextureLayer(Framebuffer::ColorAttachment(0), color, 3) .attachTextureLayer(Framebuffer::BufferAttachment::DepthStencil, depthStencil, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } @@ -705,10 +705,10 @@ void FramebufferGLTest::attachTexture2DMultisampleArray() { #ifndef MAGNUM_TARGET_GLES void FramebufferGLTest::attachRectangleTexture() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not available.")); RectangleTexture color; color.setStorage(TextureFormat::RGBA8, Vector2i(128)); @@ -720,7 +720,7 @@ void FramebufferGLTest::attachRectangleTexture() { framebuffer.attachTexture(Framebuffer::ColorAttachment(0), color) .attachTexture(Framebuffer::BufferAttachment::DepthStencil, depthStencil); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } @@ -728,8 +728,8 @@ void FramebufferGLTest::attachRectangleTexture() { void FramebufferGLTest::attachCubeMapTexture() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif Framebuffer framebuffer({{}, Vector2i(128)}); @@ -749,11 +749,11 @@ void FramebufferGLTest::attachCubeMapTexture() { CubeMapTexture depthStencil; #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - if(Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - Debug() << "Using" << Extensions::GL::OES::packed_depth_stencil::string(); + Debug() << "Using" << Extensions::OES::packed_depth_stencil::string(); #endif #if !defined(MAGNUM_TARGET_GLES2) || defined(MAGNUM_TARGET_WEBGL) @@ -773,15 +773,15 @@ void FramebufferGLTest::attachCubeMapTexture() { } #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - else if(Context::current().isExtensionSupported()) { - Debug() << "Using" << Extensions::GL::OES::depth_texture::string(); + else if(Context::current().isExtensionSupported()) { + Debug() << "Using" << Extensions::OES::depth_texture::string(); depthStencil.setStorage(1, TextureFormat::DepthComponent16, Vector2i(128)); framebuffer.attachCubeMapTexture(Framebuffer::BufferAttachment::Depth, depthStencil, CubeMapCoordinate::NegativeZ, 0); } #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } @@ -789,13 +789,13 @@ void FramebufferGLTest::attachCubeMapTexture() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void FramebufferGLTest::attachCubeMapTextureArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not available.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not available.")); #endif CubeMapTextureArray color; @@ -808,7 +808,7 @@ void FramebufferGLTest::attachCubeMapTextureArray() { framebuffer.attachTextureLayer(Framebuffer::ColorAttachment(0), color, 0, 3) .attachTextureLayer(Framebuffer::BufferAttachment::DepthStencil, depthStencil, 0, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } @@ -817,13 +817,13 @@ void FramebufferGLTest::attachCubeMapTextureArray() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void FramebufferGLTest::attachLayeredTexture3D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::geometry_shader4::string() + std::string(" is not available.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::geometry_shader::string() + std::string(" is not available.")); #endif Texture3D color; @@ -832,17 +832,17 @@ void FramebufferGLTest::attachLayeredTexture3D() { Framebuffer framebuffer{{{}, Vector2i{128}}}; framebuffer.attachLayeredTexture(Framebuffer::ColorAttachment{0}, color, 0); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } #ifndef MAGNUM_TARGET_GLES void FramebufferGLTest::attachLayeredTexture1DArray() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::geometry_shader4::string() + std::string(" is not available.")); Texture1DArray color; color.setStorage(1, TextureFormat::RGBA8, {128, 8}); @@ -854,7 +854,7 @@ void FramebufferGLTest::attachLayeredTexture1DArray() { framebuffer.attachLayeredTexture(Framebuffer::ColorAttachment{0}, color, 0) .attachLayeredTexture(Framebuffer::BufferAttachment::DepthStencil, depthStencil, 0); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } @@ -862,13 +862,13 @@ void FramebufferGLTest::attachLayeredTexture1DArray() { void FramebufferGLTest::attachLayeredTexture2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::geometry_shader4::string() + std::string(" is not available.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::geometry_shader::string() + std::string(" is not available.")); #endif Texture2DArray color; @@ -881,20 +881,20 @@ void FramebufferGLTest::attachLayeredTexture2DArray() { framebuffer.attachLayeredTexture(Framebuffer::ColorAttachment{0}, color, 0) .attachLayeredTexture(Framebuffer::BufferAttachment::DepthStencil, depthStencil, 0); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } void FramebufferGLTest::attachLayeredCubeMapTexture() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::geometry_shader4::string() + std::string(" is not available.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::geometry_shader::string() + std::string(" is not available.")); #endif CubeMapTexture color; @@ -907,24 +907,24 @@ void FramebufferGLTest::attachLayeredCubeMapTexture() { framebuffer.attachLayeredTexture(Framebuffer::ColorAttachment{0}, color, 0) .attachLayeredTexture(Framebuffer::BufferAttachment::DepthStencil, depthStencil, 0); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } void FramebufferGLTest::attachLayeredCubeMapTextureArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::geometry_shader4::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not available.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::geometry_shader::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not available.")); #endif CubeMapTextureArray color; @@ -937,24 +937,24 @@ void FramebufferGLTest::attachLayeredCubeMapTextureArray() { framebuffer.attachLayeredTexture(Framebuffer::ColorAttachment{0}, color, 0) .attachLayeredTexture(Framebuffer::BufferAttachment::DepthStencil, depthStencil, 0); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } void FramebufferGLTest::attachLayeredTexture2DMultisampleArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::geometry_shader4::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::geometry_shader4::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string(" is not available.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::geometry_shader::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_storage_multisample_2d_array::string() + std::string(" is not available.")); #endif MultisampleTexture2DArray color; @@ -971,7 +971,7 @@ void FramebufferGLTest::attachLayeredTexture2DMultisampleArray() { framebuffer.attachLayeredTexture(Framebuffer::ColorAttachment{0}, color) .attachLayeredTexture(Framebuffer::BufferAttachment::DepthStencil, depthStencil); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } @@ -979,8 +979,8 @@ void FramebufferGLTest::attachLayeredTexture2DMultisampleArray() { void FramebufferGLTest::detach() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif Framebuffer framebuffer({{}, Vector2i(128)}); @@ -988,20 +988,20 @@ void FramebufferGLTest::detach() { .detach(Framebuffer::BufferAttachment::Depth) .detach(Framebuffer::BufferAttachment::Stencil); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void FramebufferGLTest::multipleColorOutputs() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #elif defined(MAGNUM_TARGET_GLES2) #ifdef MAGNUM_TARGET_WEBGL - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::WEBGL::draw_buffers::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::WEBGL::draw_buffers::string() + std::string(" is not available.")); #else - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("No required extension available."); #endif #endif @@ -1041,25 +1041,25 @@ void FramebufferGLTest::multipleColorOutputs() { #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) #ifdef MAGNUM_TARGET_GLES2 - if(Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #ifdef MAGNUM_TARGET_GLES2 - Debug() << "Using" << Extensions::GL::NV::read_buffer::string(); + Debug() << "Using" << Extensions::NV::read_buffer::string(); #endif framebuffer.mapForRead(Framebuffer::ColorAttachment(1)); } #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); } void FramebufferGLTest::clear() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif Renderbuffer color; @@ -1073,11 +1073,11 @@ void FramebufferGLTest::clear() { on my NVidia, thus we need to do this juggling with one renderbuffer */ Renderbuffer depthStencil; #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - if(Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - Debug() << "Using" << Extensions::GL::OES::packed_depth_stencil::string(); + Debug() << "Using" << Extensions::OES::packed_depth_stencil::string(); #endif depthStencil.setStorage( #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) @@ -1096,18 +1096,18 @@ void FramebufferGLTest::clear() { .attachRenderbuffer(Framebuffer::BufferAttachment::Depth, depthStencil); #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - if(Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { framebuffer.attachRenderbuffer(Framebuffer::BufferAttachment::Stencil, depthStencil); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); framebuffer.clear(FramebufferClear::Color|FramebufferClear::Depth|FramebufferClear::Stencil); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #ifndef MAGNUM_TARGET_GLES2 @@ -1123,18 +1123,18 @@ void FramebufferGLTest::clearColorI() { Framebuffer framebuffer({{}, Vector2i{16}}); framebuffer.attachRenderbuffer(Framebuffer::ColorAttachment{0}, color); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); framebuffer.clearColor(0, Vector4i{-124, 67, 37, 17}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image2D colorImage = framebuffer.read({{}, Vector2i{1}}, {PixelFormat::RGBAInteger, PixelType::Int}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(colorImage.data()[0], (Vector4i{-124, 67, 37, 17})); } @@ -1150,18 +1150,18 @@ void FramebufferGLTest::clearColorUI() { Framebuffer framebuffer({{}, Vector2i{16}}); framebuffer.attachRenderbuffer(Framebuffer::ColorAttachment{0}, color); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); framebuffer.clearColor(0, Vector4ui{240, 67, 37, 17}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image2D colorImage = framebuffer.read({{}, Vector2i{1}}, {PixelFormat::RGBAInteger, PixelType::UnsignedInt}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(colorImage.data()[0], (Vector4ui{240, 67, 37, 17})); } @@ -1177,18 +1177,18 @@ void FramebufferGLTest::clearColorF() { Framebuffer framebuffer({{}, Vector2i{16}}); framebuffer.attachRenderbuffer(Framebuffer::ColorAttachment{0}, color); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); framebuffer.clearColor(0, Math::unpack(Color4ub{128, 64, 32, 17})); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image2D colorImage = framebuffer.read({{}, Vector2i{1}}, {PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(colorImage.data()[0], (Color4ub{128, 64, 32, 17})); } @@ -1210,25 +1210,25 @@ void FramebufferGLTest::clearDepth() { framebuffer.attachRenderbuffer(Framebuffer::ColorAttachment{0}, color) .attachRenderbuffer(Framebuffer::BufferAttachment::DepthStencil, depthStencil); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); framebuffer.clearDepth(Math::unpack(48352)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifdef MAGNUM_TARGET_GLES - if(Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #ifdef MAGNUM_TARGET_GLES - Debug() << "Using" << Extensions::GL::NV::read_depth::string(); + Debug() << "Using" << Extensions::NV::read_depth::string(); #endif Image2D depthImage = framebuffer.read({{}, Vector2i{1}}, {PixelFormat::DepthComponent, PixelType::UnsignedShort}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(depthImage.data()[0], 48352); } } @@ -1249,25 +1249,25 @@ void FramebufferGLTest::clearStencil() { framebuffer.attachRenderbuffer(Framebuffer::ColorAttachment{0}, color) .attachRenderbuffer(Framebuffer::BufferAttachment::DepthStencil, depthStencil); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); framebuffer.clearStencil(67); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifdef MAGNUM_TARGET_GLES - if(Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #ifdef MAGNUM_TARGET_GLES - Debug() << "Using" << Extensions::GL::NV::read_stencil::string(); + Debug() << "Using" << Extensions::NV::read_stencil::string(); #endif Image2D stencilImage = framebuffer.read({{}, Vector2i{1}}, {PixelFormat::StencilIndex, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(stencilImage.data()[0], 67); } } @@ -1290,23 +1290,23 @@ void FramebufferGLTest::clearDepthStencil() { framebuffer.attachRenderbuffer(Framebuffer::ColorAttachment{0}, color) .attachRenderbuffer(Framebuffer::BufferAttachment::DepthStencil, depthStencil); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); framebuffer.clearDepthStencil(Math::unpack(48352), 67); #ifdef MAGNUM_TARGET_GLES - if(Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #ifdef MAGNUM_TARGET_GLES - Debug() << "Using" << Extensions::GL::NV::read_depth_stencil::string(); + Debug() << "Using" << Extensions::NV::read_depth_stencil::string(); #endif Image2D depthStencilImage = framebuffer.read({{}, Vector2i{1}}, {PixelFormat::DepthStencil, PixelType::UnsignedInt248}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo This will probably fail on different systems */ CORRADE_COMPARE(depthStencilImage.data()[0] >> 8, 12378300); CORRADE_COMPARE(depthStencilImage.data()[0], 67); @@ -1317,8 +1317,8 @@ void FramebufferGLTest::clearDepthStencil() { #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) void FramebufferGLTest::invalidate() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif Renderbuffer color; @@ -1335,19 +1335,19 @@ void FramebufferGLTest::invalidate() { framebuffer.attachRenderbuffer(Framebuffer::ColorAttachment(0), color) .attachRenderbuffer(Framebuffer::BufferAttachment::Stencil, stencil); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); framebuffer.invalidate({Framebuffer::InvalidationAttachment::Depth, Framebuffer::ColorAttachment(0)}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #ifndef MAGNUM_TARGET_GLES2 void FramebufferGLTest::invalidateSub() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif Renderbuffer color; @@ -1360,14 +1360,14 @@ void FramebufferGLTest::invalidateSub() { framebuffer.attachRenderbuffer(Framebuffer::ColorAttachment(0), color) .attachRenderbuffer(Framebuffer::BufferAttachment::Depth, depth); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); framebuffer.invalidate({Framebuffer::InvalidationAttachment::Depth, Framebuffer::ColorAttachment(0)}, {{32, 16}, {79, 64}}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif @@ -1378,8 +1378,8 @@ namespace { void FramebufferGLTest::read() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif Renderbuffer color; @@ -1393,11 +1393,11 @@ void FramebufferGLTest::read() { on my NVidia, thus we need to do this juggling with one renderbuffer */ Renderbuffer depthStencil; #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - if(Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - Debug() << "Using" << Extensions::GL::OES::packed_depth_stencil::string(); + Debug() << "Using" << Extensions::OES::packed_depth_stencil::string(); #endif depthStencil.setStorage( #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) @@ -1416,13 +1416,13 @@ void FramebufferGLTest::read() { .attachRenderbuffer(Framebuffer::BufferAttachment::Depth, depthStencil); #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - if(Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { framebuffer.attachRenderbuffer(Framebuffer::BufferAttachment::Stencil, depthStencil); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); @@ -1434,51 +1434,51 @@ void FramebufferGLTest::read() { Image2D colorImage = framebuffer.read(Range2Di::fromSize({16, 8}, {8, 16}), {DataStorage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(colorImage.size(), Vector2i(8, 16)); CORRADE_COMPARE(colorImage.data().size(), (DataOffset + 8*16)*sizeof(Color4ub)); CORRADE_COMPARE(colorImage.data()[DataOffset], Color4ub(128, 64, 32, 17)); #ifndef MAGNUM_TARGET_WEBGL #ifdef MAGNUM_TARGET_GLES - if(Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #ifdef MAGNUM_TARGET_GLES - Debug() << "Using" << Extensions::GL::NV::read_depth::string(); + Debug() << "Using" << Extensions::NV::read_depth::string(); #endif Image2D depthImage = framebuffer.read({{}, Vector2i{1}}, {PixelFormat::DepthComponent, PixelType::UnsignedShort}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(depthImage.data()[0], 48352); } #ifdef MAGNUM_TARGET_GLES - if(Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #ifdef MAGNUM_TARGET_GLES - Debug() << "Using" << Extensions::GL::NV::read_stencil::string(); + Debug() << "Using" << Extensions::NV::read_stencil::string(); #endif Image2D stencilImage = framebuffer.read({{}, Vector2i{1}}, {PixelFormat::StencilIndex, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(stencilImage.data()[0], 67); } #ifdef MAGNUM_TARGET_GLES - if(Context::current().isExtensionSupported()) + if(Context::current().isExtensionSupported()) #endif { #ifdef MAGNUM_TARGET_GLES - Debug() << "Using" << Extensions::GL::NV::read_depth_stencil::string(); + Debug() << "Using" << Extensions::NV::read_depth_stencil::string(); #endif Image2D depthStencilImage = framebuffer.read({{}, Vector2i{1}}, {PixelFormat::DepthStencil, PixelType::UnsignedInt248}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo This will probably fail on different systems */ CORRADE_COMPARE(depthStencilImage.data()[0] >> 8, 12378300); CORRADE_COMPARE(depthStencilImage.data()[0], 67); @@ -1489,8 +1489,8 @@ void FramebufferGLTest::read() { #ifndef MAGNUM_TARGET_GLES2 void FramebufferGLTest::readBuffer() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif Renderbuffer color; @@ -1503,7 +1503,7 @@ void FramebufferGLTest::readBuffer() { framebuffer.attachRenderbuffer(Framebuffer::ColorAttachment(0), color) .attachRenderbuffer(Framebuffer::BufferAttachment::DepthStencil, depthStencil); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(framebuffer.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); @@ -1516,7 +1516,7 @@ void FramebufferGLTest::readBuffer() { {DataStorage, PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); CORRADE_COMPARE(colorImage.size(), Vector2i(8, 16)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES auto colorData = colorImage.buffer().data(); @@ -1539,8 +1539,8 @@ namespace { #ifndef MAGNUM_TARGET_GLES void FramebufferGLTest::copyImageTexture1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); Texture2D storage; storage.setStorage(1, TextureFormat::RGBA8, Vector2i{4}) @@ -1552,7 +1552,7 @@ void FramebufferGLTest::copyImageTexture1D() { Texture1D texture; fb.copyImage(Range2Di::fromSize(Vector2i{1}, {2, 1}), texture, 0, TextureFormat::RGBA8); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.imageSize(0)[0], 2); CORRADE_COMPARE_AS(texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}).release(), @@ -1563,8 +1563,8 @@ void FramebufferGLTest::copyImageTexture1D() { void FramebufferGLTest::copyImageTexture2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif Texture2D storage; @@ -1593,7 +1593,7 @@ void FramebufferGLTest::copyImageTexture2D() { #endif ); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(texture.imageSize(0), Vector2i{2}); @@ -1607,10 +1607,10 @@ void FramebufferGLTest::copyImageTexture2D() { #ifndef MAGNUM_TARGET_GLES void FramebufferGLTest::copyImageTexture1DArray() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not available.")); Texture2D storage; storage.setStorage(1, TextureFormat::RGBA8, Vector2i{4}) @@ -1622,7 +1622,7 @@ void FramebufferGLTest::copyImageTexture1DArray() { Texture1DArray texture; fb.copyImage(Range2Di::fromSize(Vector2i{1}, Vector2i{2}), texture, 0, TextureFormat::RGBA8); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.imageSize(0), Vector2i{2}); CORRADE_COMPARE_AS(texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}).release(), @@ -1633,10 +1633,10 @@ void FramebufferGLTest::copyImageTexture1DArray() { } void FramebufferGLTest::copyImageRectangleTexture() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not available.")); Texture2D storage; storage.setStorage(1, TextureFormat::RGBA8, Vector2i{4}) @@ -1648,7 +1648,7 @@ void FramebufferGLTest::copyImageRectangleTexture() { RectangleTexture texture; fb.copyImage(Range2Di::fromSize(Vector2i{1}, Vector2i{2}), texture, TextureFormat::RGBA8); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.imageSize(), Vector2i{2}); CORRADE_COMPARE_AS(texture.image({PixelFormat::RGBA, PixelType::UnsignedByte}).release(), @@ -1661,8 +1661,8 @@ void FramebufferGLTest::copyImageRectangleTexture() { void FramebufferGLTest::copyImageCubeMapTexture() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif #ifndef MAGNUM_TARGET_GLES2 @@ -1698,7 +1698,7 @@ void FramebufferGLTest::copyImageCubeMapTexture() { fb.copyImage(Range2Di::fromSize(Vector2i{1}, Vector2i{2}), texture, CubeMapCoordinate::PositiveX, 0, format); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(texture.imageSize(0), Vector2i{2}); @@ -1712,8 +1712,8 @@ void FramebufferGLTest::copyImageCubeMapTexture() { #ifndef MAGNUM_TARGET_GLES void FramebufferGLTest::copySubImageTexture1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); Texture2D storage; storage.setStorage(1, TextureFormat::RGBA8, Vector2i{4}) @@ -1727,7 +1727,7 @@ void FramebufferGLTest::copySubImageTexture1D() { .setSubImage(0, {}, ImageView1D{PixelFormat::RGBA, PixelType::UnsignedByte, 4, ZeroStorage}); fb.copySubImage(Range2Di::fromSize(Vector2i{1}, {2, 1}), texture, 0, 1); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_AS(texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}).release(), (Containers::Array{Containers::InPlaceInit, { @@ -1738,8 +1738,8 @@ void FramebufferGLTest::copySubImageTexture1D() { void FramebufferGLTest::copySubImageTexture2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif Texture2D storage; @@ -1770,7 +1770,7 @@ void FramebufferGLTest::copySubImageTexture2D() { .setSubImage(0, {}, ImageView2D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i{4}, ZeroStorage}); fb.copySubImage(Range2Di::fromSize(Vector2i{1}, Vector2i{2}), texture, 0, Vector2i{1}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE_AS(texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}).release(), @@ -1786,11 +1786,11 @@ void FramebufferGLTest::copySubImageTexture2D() { #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) void FramebufferGLTest::copySubImageTexture3D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_3D::string() + std::string(" is not available.")); #endif Texture2D storage; @@ -1817,7 +1817,7 @@ void FramebufferGLTest::copySubImageTexture3D() { .setSubImage(0, {}, ImageView3D{PixelFormat::RGBA, PixelType::UnsignedByte, {4, 4, 2}, ZeroStorage}); fb.copySubImage(Range2Di::fromSize(Vector2i{1}, Vector2i{2}), texture, 0, Vector3i{1}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE_AS(texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}).release(), @@ -1838,10 +1838,10 @@ void FramebufferGLTest::copySubImageTexture3D() { #ifndef MAGNUM_TARGET_GLES void FramebufferGLTest::copySubImageTexture1DArray() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not available.")); Texture2D storage; storage.setStorage(1, TextureFormat::RGBA8, Vector2i{4}) @@ -1855,7 +1855,7 @@ void FramebufferGLTest::copySubImageTexture1DArray() { .setSubImage(0, {}, ImageView2D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i{4}, ZeroStorage}); fb.copySubImage(Range2Di::fromSize(Vector2i{1}, Vector2i{2}), texture, 0, Vector2i{1}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_AS(texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}).release(), (Containers::Array{Containers::InPlaceInit, { @@ -1870,10 +1870,10 @@ void FramebufferGLTest::copySubImageTexture1DArray() { #ifndef MAGNUM_TARGET_GLES2 void FramebufferGLTest::copySubImageTexture2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not available.")); #endif Texture2D storage; @@ -1888,7 +1888,7 @@ void FramebufferGLTest::copySubImageTexture2DArray() { .setSubImage(0, {}, ImageView3D{PixelFormat::RGBA, PixelType::UnsignedByte, {4, 4, 2}, ZeroStorage}); fb.copySubImage(Range2Di::fromSize(Vector2i{1}, Vector2i{2}), texture, 0, Vector3i{1}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE_AS(texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}).release(), @@ -1909,10 +1909,10 @@ void FramebufferGLTest::copySubImageTexture2DArray() { #ifndef MAGNUM_TARGET_GLES void FramebufferGLTest::copySubImageRectangleTexture() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not available.")); Texture2D storage; storage.setStorage(1, TextureFormat::RGBA8, Vector2i{4}) @@ -1926,7 +1926,7 @@ void FramebufferGLTest::copySubImageRectangleTexture() { .setSubImage({}, ImageView2D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i{4}, ZeroStorage}); fb.copySubImage(Range2Di::fromSize(Vector2i{1}, Vector2i{2}), texture, Vector2i{1}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_AS(texture.image({PixelFormat::RGBA, PixelType::UnsignedByte}).release(), (Containers::Array{Containers::InPlaceInit, { @@ -1940,8 +1940,8 @@ void FramebufferGLTest::copySubImageRectangleTexture() { void FramebufferGLTest::copySubImageCubeMapTexture() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif Texture2D storage; @@ -1972,7 +1972,7 @@ void FramebufferGLTest::copySubImageCubeMapTexture() { .setSubImage(CubeMapCoordinate::NegativeY, 0, {}, ImageView2D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i{4}, ZeroStorage}); fb.copySubImage(Range2Di::fromSize(Vector2i{1}, Vector2i{2}), texture, 0, {1, 1, 3}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE_AS(texture.image(CubeMapCoordinate::NegativeY, 0, {PixelFormat::RGBA, PixelType::UnsignedByte}).release(), @@ -1988,13 +1988,13 @@ void FramebufferGLTest::copySubImageCubeMapTexture() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void FramebufferGLTest::copySubImageCubeMapTextureArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_cube_map_array::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_cube_map_array::string() + std::string(" is not available.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_cube_map_array::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_cube_map_array::string() + std::string(" is not available.")); #endif Texture2D storage; @@ -2009,7 +2009,7 @@ void FramebufferGLTest::copySubImageCubeMapTextureArray() { .setSubImage(0, {}, ImageView3D{PixelFormat::RGBA, PixelType::UnsignedByte, {4, 4, 6}, ZeroStorage}); fb.copySubImage(Range2Di::fromSize(Vector2i{1}, Vector2i{2}), texture, 0, {1, 1, 3}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE_AS(texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}).release(), @@ -2051,11 +2051,11 @@ void FramebufferGLTest::copySubImageCubeMapTextureArray() { #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) void FramebufferGLTest::blit() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available."); #endif @@ -2072,7 +2072,7 @@ void FramebufferGLTest::blit() { a.attachRenderbuffer(Framebuffer::ColorAttachment(0), colorA); b.attachRenderbuffer(Framebuffer::ColorAttachment(0), colorB); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(a.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); CORRADE_COMPARE(a.checkStatus(FramebufferTarget::Draw), Framebuffer::Status::Complete); CORRADE_COMPARE(b.checkStatus(FramebufferTarget::Read), Framebuffer::Status::Complete); @@ -2087,18 +2087,18 @@ void FramebufferGLTest::blit() { /* The framebuffer should be black before */ Image2D imageBefore = b.read({{}, Vector2i{1}}, {PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(imageBefore.data()[0], Color4ub()); /* And have given color after */ Framebuffer::blit(a, b, a.viewport(), FramebufferBlit::Color); Image2D imageAfter = b.read({{}, Vector2i{1}}, {PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(imageAfter.data()[0], Color4ub(128, 64, 32, 17)); } #endif -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::FramebufferGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::FramebufferGLTest) diff --git a/src/Magnum/GL/Test/FramebufferTest.cpp b/src/Magnum/GL/Test/FramebufferTest.cpp index 5dd772666..fd7af2b34 100644 --- a/src/Magnum/GL/Test/FramebufferTest.cpp +++ b/src/Magnum/GL/Test/FramebufferTest.cpp @@ -26,9 +26,9 @@ #include #include -#include "Magnum/Framebuffer.h" +#include "Magnum/GL/Framebuffer.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct FramebufferTest: TestSuite::Tester { explicit FramebufferTest(); @@ -60,6 +60,6 @@ void FramebufferTest::debugStatus() { CORRADE_COMPARE(out.str(), "GL::Framebuffer::Status::IncompleteMissingAttachment GL::Framebuffer::Status(0xdead)\n"); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::FramebufferTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::FramebufferTest) diff --git a/src/Magnum/GL/Test/MeshGLTest.cpp b/src/Magnum/GL/Test/MeshGLTest.cpp index e4c60f11b..8fe2c71e8 100644 --- a/src/Magnum/GL/Test/MeshGLTest.cpp +++ b/src/Magnum/GL/Test/MeshGLTest.cpp @@ -23,19 +23,20 @@ DEALINGS IN THE SOFTWARE. */ -#include "Magnum/AbstractShaderProgram.h" -#include "Magnum/Buffer.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/Framebuffer.h" #include "Magnum/Image.h" #include "Magnum/Mesh.h" -#include "Magnum/MeshView.h" -#include "Magnum/OpenGLTester.h" -#include "Magnum/PixelFormat.h" -#include "Magnum/Renderbuffer.h" -#include "Magnum/RenderbufferFormat.h" -#include "Magnum/Shader.h" +#include "Magnum/GL/AbstractShaderProgram.h" +#include "Magnum/GL/Buffer.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Framebuffer.h" +#include "Magnum/GL/Mesh.h" +#include "Magnum/GL/MeshView.h" +#include "Magnum/GL/OpenGLTester.h" +#include "Magnum/GL/PixelFormat.h" +#include "Magnum/GL/Renderbuffer.h" +#include "Magnum/GL/RenderbufferFormat.h" +#include "Magnum/GL/Shader.h" #include "Magnum/Math/Color.h" #include "Magnum/Math/Half.h" #include "Magnum/Math/Matrix.h" @@ -264,7 +265,7 @@ void MeshGLTest::construct() { { const Mesh mesh; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES if(Context::current().isExtensionSupported()) @@ -276,7 +277,7 @@ void MeshGLTest::construct() { } } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void MeshGLTest::constructCopy() { @@ -288,7 +289,7 @@ void MeshGLTest::constructMove() { Mesh a; const Int id = a.id(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES if(Context::current().isExtensionSupported()) @@ -308,7 +309,7 @@ void MeshGLTest::constructMove() { const Int cId = c.id(); c = std::move(b); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES if(Context::current().isExtensionSupported()) @@ -379,10 +380,10 @@ void MeshGLTest::label() { Mesh mesh; CORRADE_COMPARE(mesh.label(), ""); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); mesh.setLabel("MyMesh"); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(mesh.label(), "MyMesh"); } @@ -608,12 +609,12 @@ void MeshGLTest::addVertexBufferUnsignedInt() { DynamicAttribute::DataType::UnsignedInt}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(IntegerShader("uint"), RenderbufferFormat::R32UI, mesh) .get(PixelFormat::RedInteger, PixelType::UnsignedInt); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 35681); } @@ -641,12 +642,12 @@ void MeshGLTest::addVertexBufferInt() { DynamicAttribute::DataType::Int}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(IntegerShader("int"), RenderbufferFormat::R32I, mesh) .get(PixelFormat::RedInteger, PixelType::Int); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 27530); } #endif @@ -670,7 +671,7 @@ void MeshGLTest::addVertexBufferFloat() { DynamicAttribute::DataType::Float}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(FloatShader("float", "vec4(valueInterpolated, 0.0, 0.0, 0.0)"), #ifndef MAGNUM_TARGET_GLES2 @@ -680,7 +681,7 @@ void MeshGLTest::addVertexBufferFloat() { #endif mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 96); } @@ -707,12 +708,12 @@ void MeshGLTest::addVertexBufferDouble() { DynamicAttribute::DataType::Double}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(DoubleShader("double", "float", "float(value)"), RenderbufferFormat::R16, mesh).get(PixelFormat::Red, PixelType::UnsignedShort); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 45828); } #endif @@ -742,12 +743,12 @@ void MeshGLTest::addVertexBufferVectorNui() { DynamicAttribute::DataType::UnsignedInt}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(IntegerShader("uvec3"), RenderbufferFormat::RGBA32UI, mesh) .get(PixelFormat::RGBAInteger, PixelType::UnsignedInt); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, Vector3ui(27592, 157, 25)); } @@ -775,12 +776,12 @@ void MeshGLTest::addVertexBufferVectorNi() { DynamicAttribute::DataType::Int}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(IntegerShader("ivec2"), RenderbufferFormat::RG32I, mesh) .get(PixelFormat::RGInteger, PixelType::Int); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, Vector2i(27592, -157)); } #endif @@ -804,7 +805,7 @@ void MeshGLTest::addVertexBufferVectorN() { DynamicAttribute::DataType::Float}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(FloatShader("vec3", "vec4(valueInterpolated, 0.0)"), #ifndef MAGNUM_TARGET_GLES2 @@ -814,7 +815,7 @@ void MeshGLTest::addVertexBufferVectorN() { #endif mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, Color3ub(96, 24, 156)); } @@ -844,12 +845,12 @@ void MeshGLTest::addVertexBufferVectorNd() { DynamicAttribute::DataType::Double}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(DoubleShader("dvec4", "vec4", "vec4(value)"), RenderbufferFormat::RGBA16, mesh).get>(PixelFormat::RGBA, PixelType::UnsignedShort); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, Math::Vector4(315, 65201, 2576, 12)); } #endif @@ -885,7 +886,7 @@ void MeshGLTest::addVertexBufferMatrixNxN() { DynamicAttribute::DataType::Float}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(FloatShader("mat3", "vec4(valueInterpolated[0][0], valueInterpolated[1][1], valueInterpolated[2][2], 0.0)"), @@ -896,7 +897,7 @@ void MeshGLTest::addVertexBufferMatrixNxN() { #endif mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, Color3ub(96, 24, 156)); } @@ -935,13 +936,13 @@ void MeshGLTest::addVertexBufferMatrixNxNd() { DynamicAttribute::DataType::Double}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(DoubleShader("dmat3", "vec4", "vec4(value[0][0], value[1][1], value[2][2], 0.0)"), RenderbufferFormat::RGBA16, mesh).get>(PixelFormat::RGB, PixelType::UnsignedShort); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); { CORRADE_EXPECT_FAIL_IF(Context::current().detectedDriver() & (Context::DetectedDriver::Amd|Context::DetectedDriver::NVidia), "Somehow only first two values are extracted"); @@ -987,13 +988,13 @@ void MeshGLTest::addVertexBufferMatrixMxN() { DynamicAttribute::DataType::Float}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(FloatShader("mat3x4", "vec4(valueInterpolated[0][0], valueInterpolated[1][1], valueInterpolated[2][2], 0.0)"), RenderbufferFormat::RGBA8, mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, Color3ub(96, 24, 156)); } #endif @@ -1033,13 +1034,13 @@ void MeshGLTest::addVertexBufferMatrixMxNd() { DynamicAttribute::DataType::Double}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(DoubleShader("dmat3x4", "vec4", "vec4(value[0][0], value[1][1], value[2][2], 0.0)"), RenderbufferFormat::RGBA16, mesh).get>(PixelFormat::RGB, PixelType::UnsignedShort); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); { CORRADE_EXPECT_FAIL_IF(Context::current().detectedDriver() & (Context::DetectedDriver::Amd|Context::DetectedDriver::NVidia), "Somehow only first two values are extracted"); @@ -1078,12 +1079,12 @@ void MeshGLTest::addVertexBufferUnsignedIntWithUnsignedShort() { DynamicAttribute::DataType::UnsignedShort}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(IntegerShader("uint"), RenderbufferFormat::R16UI, mesh) .get(PixelFormat::RedInteger, PixelType::UnsignedShort); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 16583); } @@ -1111,12 +1112,12 @@ void MeshGLTest::addVertexBufferUnsignedIntWithShort() { DynamicAttribute::DataType::Short}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(IntegerShader("uint"), RenderbufferFormat::R16I, mesh) .get(PixelFormat::RedInteger, PixelType::Short); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 16583); } @@ -1144,12 +1145,12 @@ void MeshGLTest::addVertexBufferIntWithUnsignedShort() { DynamicAttribute::DataType::UnsignedShort}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(IntegerShader("int"), RenderbufferFormat::R16UI, mesh) .get(PixelFormat::RedInteger, PixelType::UnsignedShort); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 16583); } @@ -1177,12 +1178,12 @@ void MeshGLTest::addVertexBufferIntWithShort() { DynamicAttribute::DataType::Short}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(IntegerShader("int"), RenderbufferFormat::R16I, mesh) .get(PixelFormat::RedInteger, PixelType::Short); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, -16583); } #endif @@ -1217,12 +1218,12 @@ void MeshGLTest::addVertexBufferFloatWithHalfFloat() { DynamicAttribute::DataType::HalfFloat}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(FloatShader("float", "vec4(valueInterpolated, 0.0, 0.0, 0.0)"), RenderbufferFormat::RGBA8, mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 186); } #endif @@ -1248,12 +1249,12 @@ void MeshGLTest::addVertexBufferFloatWithDouble() { DynamicAttribute::DataType::Double}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(FloatShader("float", "vec4(valueInterpolated, 0.0, 0.0, 0.0)"), RenderbufferFormat::RGBA8, mesh).get(PixelFormat::RGBA, PixelType::UnsignedShort); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 186); } @@ -1280,7 +1281,7 @@ void MeshGLTest::addVertexBufferVector3WithUnsignedInt10f11f11fRev() { DynamicAttribute::DataType::UnsignedInt10f11f11fRev}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /* Won't test the actual values */ } #endif @@ -1309,7 +1310,7 @@ void MeshGLTest::addVertexBufferVector4WithUnsignedInt2101010Rev() { DynamicAttribute::DataType::UnsignedInt2101010Rev}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /* Won't test the actual values */ } @@ -1336,7 +1337,7 @@ void MeshGLTest::addVertexBufferVector4WithInt2101010Rev() { DynamicAttribute::DataType::Int2101010Rev}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /* Won't test the actual values */ } #endif @@ -1363,7 +1364,7 @@ void MeshGLTest::addVertexBufferLessVectorComponents() { DynamicAttribute::DataType::Float}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(FloatShader("vec4", "valueInterpolated"), #ifndef MAGNUM_TARGET_GLES2 @@ -1373,7 +1374,7 @@ void MeshGLTest::addVertexBufferLessVectorComponents() { #endif mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, Color4ub(96, 24, 156, 255)); } @@ -1397,7 +1398,7 @@ void MeshGLTest::addVertexBufferNormalized() { DynamicAttribute::DataType::UnsignedByte}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(FloatShader("vec3", "vec4(valueInterpolated, 0.0)"), #ifndef MAGNUM_TARGET_GLES2 @@ -1407,7 +1408,7 @@ void MeshGLTest::addVertexBufferNormalized() { #endif mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, Color3ub(32, 156, 228)); } @@ -1437,12 +1438,12 @@ void MeshGLTest::addVertexBufferBGRA() { DynamicAttribute::DataType::UnsignedByte}); } else CORRADE_ASSERT_UNREACHABLE(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(FloatShader("vec4", "valueInterpolated"), RenderbufferFormat::RGBA8, mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, Color4ub(156, 24, 96, 225)); } #endif @@ -1549,7 +1550,7 @@ void MeshGLTest::addVertexBufferMultiple() { .addVertexBuffer(buffer, 1*4, MultipleShader::Position(), MultipleShader::Normal(), MultipleShader::TextureCoordinates()); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(MultipleShader(), #ifndef MAGNUM_TARGET_GLES2 @@ -1559,7 +1560,7 @@ void MeshGLTest::addVertexBufferMultiple() { #endif mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, Color4ub(64 + 15 + 97, 17 + 164 + 28, 56 + 17, 255)); } @@ -1592,7 +1593,7 @@ void MeshGLTest::addVertexBufferMultipleGaps() { MultipleShader::Normal(), 1*4, MultipleShader::TextureCoordinates(), 2*4); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(MultipleShader(), #ifndef MAGNUM_TARGET_GLES2 @@ -1602,7 +1603,7 @@ void MeshGLTest::addVertexBufferMultipleGaps() { #endif mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, Color4ub(64 + 15 + 97, 17 + 164 + 28, 56 + 17, 255)); } @@ -1677,7 +1678,7 @@ template void MeshGLTest::setIndexBuffer() { MultipleShader::Normal(), MultipleShader::TextureCoordinates()) .setIndexBuffer(indices, 2, T::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(mesh.indexType(), MeshIndexType::UnsignedByte); CORRADE_COMPARE(mesh.indexTypeSize(), 1); @@ -1689,7 +1690,7 @@ template void MeshGLTest::setIndexBuffer() { #endif mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, indexedResult); } @@ -1710,7 +1711,7 @@ template void MeshGLTest::setIndexBufferRange() { MultipleShader::Normal(), MultipleShader::TextureCoordinates()) .setIndexBuffer(indices, 2, T::UnsignedShort, 0, 1); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(mesh.indexType(), GL::MeshIndexType::UnsignedShort); CORRADE_COMPARE(mesh.indexTypeSize(), 2); @@ -1722,7 +1723,7 @@ template void MeshGLTest::setIndexBufferRange() { #endif mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, indexedResult); } @@ -1742,9 +1743,9 @@ void MeshGLTest::setIndexBufferUnsignedInt() { Mesh mesh; mesh.addVertexBuffer(vertices, 1*4, MultipleShader::Position(), MultipleShader::Normal(), MultipleShader::TextureCoordinates()) - .setIndexBuffer(indices, 4, Mesh::IndexType::UnsignedInt); + .setIndexBuffer(indices, 4, MeshIndexType::UnsignedInt); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(mesh.indexType(), GL::MeshIndexType::UnsignedInt); CORRADE_COMPARE(mesh.indexTypeSize(), 4); @@ -1756,7 +1757,7 @@ void MeshGLTest::setIndexBufferUnsignedInt() { #endif mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, indexedResult); } @@ -1784,13 +1785,13 @@ void MeshGLTest::unbindVAOWhenSettingIndexBufferData() { Mesh mesh; mesh.addVertexBuffer(buffer, 4, Attribute{}) - .setIndexBuffer(indices, 0, Mesh::IndexType::UnsignedByte); + .setIndexBuffer(indices, 0, MeshIndexType::UnsignedByte); /* This buffer should have no effect on the mesh above */ Buffer otherIndices{Buffer::TargetHint::ElementArray}; otherIndices.setData(std::vector{100, 1}, BufferUsage::StaticDraw); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(FloatShader("float", "vec4(valueInterpolated, 0.0, 0.0, 0.0)"), #ifndef MAGNUM_TARGET_GLES2 @@ -1800,7 +1801,7 @@ void MeshGLTest::unbindVAOWhenSettingIndexBufferData() { #endif mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 92); } @@ -1824,7 +1825,7 @@ void MeshGLTest::unbindVAOBeforeEnteringExternalSection() { Mesh mesh; mesh.addVertexBuffer(buffer, 4, Attribute{}) - .setIndexBuffer(indices, 0, Mesh::IndexType::UnsignedByte); + .setIndexBuffer(indices, 0, MeshIndexType::UnsignedByte); { /* Comment this out to watch the world burn */ @@ -1836,7 +1837,7 @@ void MeshGLTest::unbindVAOBeforeEnteringExternalSection() { Context::current().resetState(Context::State::ExitExternal); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(FloatShader("float", "vec4(valueInterpolated, 0.0, 0.0, 0.0)"), #ifndef MAGNUM_TARGET_GLES2 @@ -1846,7 +1847,7 @@ void MeshGLTest::unbindVAOBeforeEnteringExternalSection() { #endif mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 92); } @@ -1866,14 +1867,14 @@ void MeshGLTest::setBaseVertex() { mesh.setBaseVertex(2) .addVertexBuffer(vertices, 2*4, MultipleShader::Position(), MultipleShader::Normal(), MultipleShader::TextureCoordinates()) - .setIndexBuffer(indices, 2, Mesh::IndexType::UnsignedShort); + .setIndexBuffer(indices, 2, MeshIndexType::UnsignedShort); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(MultipleShader{}, RenderbufferFormat::RGBA8, mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, indexedResult); } #endif @@ -1910,7 +1911,7 @@ void MeshGLTest::setInstanceCount() { .setInstanceCount(3) .addVertexBuffer(buffer, 4, Attribute()); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(FloatShader("float", "vec4(valueInterpolated, 0.0, 0.0, 0.0)"), #ifndef MAGNUM_TARGET_GLES2 @@ -1920,7 +1921,7 @@ void MeshGLTest::setInstanceCount() { #endif mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 96); } @@ -1956,9 +1957,9 @@ void MeshGLTest::setInstanceCountIndexed() { mesh.setInstanceCount(3) .addVertexBuffer(vertices, 1*4, MultipleShader::Position(), MultipleShader::Normal(), MultipleShader::TextureCoordinates()) - .setIndexBuffer(indices, 2, Mesh::IndexType::UnsignedShort); + .setIndexBuffer(indices, 2, MeshIndexType::UnsignedShort); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(MultipleShader{}, #ifndef MAGNUM_TARGET_GLES2 @@ -1968,7 +1969,7 @@ void MeshGLTest::setInstanceCountIndexed() { #endif mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, indexedResult); } @@ -1996,13 +1997,13 @@ void MeshGLTest::setInstanceCountBaseInstance() { .setBaseInstance(72) .addVertexBuffer(buffer, 4, Attribute()); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(FloatShader("float", "vec4(valueInterpolated, 0.0, 0.0, 0.0)"), RenderbufferFormat::RGBA8, mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 96); } @@ -2029,14 +2030,14 @@ void MeshGLTest::setInstanceCountBaseInstanceIndexed() { .setBaseInstance(72) .addVertexBuffer(vertices, 1*4, MultipleShader::Position(), MultipleShader::Normal(), MultipleShader::TextureCoordinates()) - .setIndexBuffer(indices, 2, Mesh::IndexType::UnsignedShort); + .setIndexBuffer(indices, 2, MeshIndexType::UnsignedShort); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(MultipleShader{}, RenderbufferFormat::RGBA8, mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, indexedResult); } @@ -2063,14 +2064,14 @@ void MeshGLTest::setInstanceCountBaseVertex() { .setInstanceCount(3) .addVertexBuffer(vertices, 2*4, MultipleShader::Position(), MultipleShader::Normal(), MultipleShader::TextureCoordinates()) - .setIndexBuffer(indices, 2, Mesh::IndexType::UnsignedShort); + .setIndexBuffer(indices, 2, MeshIndexType::UnsignedShort); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(MultipleShader{}, RenderbufferFormat::RGBA8, mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, indexedResult); } @@ -2100,14 +2101,14 @@ void MeshGLTest::setInstanceCountBaseVertexBaseInstance() { .setBaseInstance(72) .addVertexBuffer(vertices, 2*4, MultipleShader::Position(), MultipleShader::Normal(), MultipleShader::TextureCoordinates()) - .setIndexBuffer(indices, 2, Mesh::IndexType::UnsignedShort); + .setIndexBuffer(indices, 2, MeshIndexType::UnsignedShort); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(MultipleShader{}, RenderbufferFormat::RGBA8, mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, indexedResult); } #endif @@ -2151,7 +2152,7 @@ void MeshGLTest::addVertexBufferInstancedFloat() { mesh.setInstanceCount(3) .addVertexBufferInstanced(buffer, 1, 4, Attribute{}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(FloatShader("float", "vec4(valueInterpolated, 0.0, 0.0, 0.0)"), #ifndef MAGNUM_TARGET_GLES2 @@ -2161,7 +2162,7 @@ void MeshGLTest::addVertexBufferInstancedFloat() { #endif mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 96); } #endif @@ -2193,12 +2194,12 @@ void MeshGLTest::addVertexBufferInstancedInteger() { mesh.setInstanceCount(3) .addVertexBufferInstanced(buffer, 1, 4, Attribute{}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(IntegerShader("uint"), RenderbufferFormat::R32UI, mesh) .get(PixelFormat::RedInteger, PixelType::UnsignedInt); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 35681); } #endif @@ -2228,12 +2229,12 @@ void MeshGLTest::addVertexBufferInstancedDouble() { mesh.setInstanceCount(3) .addVertexBufferInstanced(buffer, 1, 8, Attribute{}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = Checker(DoubleShader("double", "float", "float(value)"), RenderbufferFormat::R16, mesh).get(PixelFormat::Red, PixelType::UnsignedShort); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 45828); } #endif @@ -2303,12 +2304,12 @@ void MeshGLTest::multiDraw() { Mesh mesh; mesh.addVertexBuffer(buffer, 4, Attribute()); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = MultiChecker(FloatShader("float", "vec4(valueInterpolated, 0.0, 0.0, 0.0)"), mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, 96); } @@ -2328,13 +2329,13 @@ void MeshGLTest::multiDrawIndexed() { Mesh mesh; mesh.addVertexBuffer(vertices, 1*4, MultipleShader::Position(), MultipleShader::Normal(), MultipleShader::TextureCoordinates()) - .setIndexBuffer(indices, 2, Mesh::IndexType::UnsignedShort); + .setIndexBuffer(indices, 2, MeshIndexType::UnsignedShort); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = MultiChecker(MultipleShader{}, mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, indexedResult); } @@ -2354,13 +2355,13 @@ void MeshGLTest::multiDrawBaseVertex() { mesh.setBaseVertex(2) .addVertexBuffer(vertices, 2*4, MultipleShader::Position(), MultipleShader::Normal(), MultipleShader::TextureCoordinates()) - .setIndexBuffer(indices, 2, Mesh::IndexType::UnsignedShort); + .setIndexBuffer(indices, 2, MeshIndexType::UnsignedShort); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); const auto value = MultiChecker(MultipleShader{}, mesh).get(PixelFormat::RGBA, PixelType::UnsignedByte); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(value, indexedResult); } #endif diff --git a/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp b/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp index eebdf32ee..94023dac4 100644 --- a/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp +++ b/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp @@ -25,16 +25,16 @@ #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/ImageFormat.h" -#include "Magnum/MultisampleTexture.h" -#include "Magnum/OpenGLTester.h" -#include "Magnum/TextureFormat.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/ImageFormat.h" +#include "Magnum/GL/MultisampleTexture.h" +#include "Magnum/GL/OpenGLTester.h" +#include "Magnum/GL/TextureFormat.h" #include "Magnum/Math/Vector3.h" #include "Magnum/Math/Functions.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct MultisampleTextureGLTest: OpenGLTester { explicit MultisampleTextureGLTest(); @@ -86,8 +86,8 @@ MultisampleTextureGLTest::MultisampleTextureGLTest() { void MultisampleTextureGLTest::construct2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string(" is not supported.")); #else if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); @@ -96,36 +96,36 @@ void MultisampleTextureGLTest::construct2D() { { MultisampleTexture2D texture; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(texture.id() > 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void MultisampleTextureGLTest::construct2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); #endif { MultisampleTexture2DArray texture; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(texture.id() > 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void MultisampleTextureGLTest::wrap2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string{" is not supported."}); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string{" is not supported."}); #else if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); @@ -147,11 +147,11 @@ void MultisampleTextureGLTest::wrap2D() { void MultisampleTextureGLTest::wrap2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); #endif GLuint id; @@ -170,8 +170,8 @@ void MultisampleTextureGLTest::wrap2DArray() { void MultisampleTextureGLTest::bind2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string(" is not supported.")); #else if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); @@ -180,57 +180,57 @@ void MultisampleTextureGLTest::bind2D() { MultisampleTexture2D texture; texture.bind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::bind(7, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(7, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void MultisampleTextureGLTest::bind2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); #endif MultisampleTexture2DArray texture; texture.bind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::bind(7, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(7, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void MultisampleTextureGLTest::bindImage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::shader_image_load_store::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif @@ -241,32 +241,32 @@ void MultisampleTextureGLTest::bindImage2D() { TextureFormat::RGBA8, Vector2i{32}) .bindImage(2, ImageAccess::ReadWrite, ImageFormat::RGBA8); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbindImage(2); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbindImages(1, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #endif } void MultisampleTextureGLTest::bindImage2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::shader_image_load_store::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif @@ -277,30 +277,30 @@ void MultisampleTextureGLTest::bindImage2DArray() { TextureFormat::RGBA8, {32, 32, 4}) .bindImage(2, 1, ImageAccess::ReadWrite, ImageFormat::RGBA8); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); texture.bindImageLayered(3, ImageAccess::ReadWrite, ImageFormat::RGBA8); AbstractTexture::unbindImage(2); AbstractTexture::unbindImage(3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbindImages(1, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #endif } void MultisampleTextureGLTest::storage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string(" is not supported.")); #else if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); @@ -311,20 +311,20 @@ void MultisampleTextureGLTest::storage2D() { texture.setStorage(Math::min(4, MultisampleTexture2D::maxColorSamples()), TextureFormat::RGBA8, {16, 16}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.imageSize(), Vector2i(16, 16)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void MultisampleTextureGLTest::storage2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); #endif MultisampleTexture2DArray texture; @@ -332,17 +332,17 @@ void MultisampleTextureGLTest::storage2DArray() { texture.setStorage(Math::min(4, MultisampleTexture2DArray::maxColorSamples()), TextureFormat::RGBA8, {16, 16, 5}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.imageSize(), Vector3i(16, 16, 5)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void MultisampleTextureGLTest::invalidateImage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string(" is not supported.")); #else if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); @@ -354,16 +354,16 @@ void MultisampleTextureGLTest::invalidateImage2D() { TextureFormat::RGBA8, {16, 16}); texture.invalidateImage(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void MultisampleTextureGLTest::invalidateImage2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); #endif MultisampleTexture2DArray texture; @@ -372,13 +372,13 @@ void MultisampleTextureGLTest::invalidateImage2DArray() { TextureFormat::RGBA8, {16, 16, 5}); texture.invalidateImage(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void MultisampleTextureGLTest::invalidateSubImage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string(" is not supported.")); #else if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); @@ -390,16 +390,16 @@ void MultisampleTextureGLTest::invalidateSubImage2D() { TextureFormat::RGBA8, {16, 16}); texture.invalidateSubImage({3, 4}, {5, 6}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void MultisampleTextureGLTest::invalidateSubImage2DArray() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_multisample::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_multisample::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_storage_multisample_2d_array::string() + std::string(" is not supported.")); #endif MultisampleTexture2DArray texture; @@ -408,9 +408,9 @@ void MultisampleTextureGLTest::invalidateSubImage2DArray() { TextureFormat::RGBA8, {16, 16, 5}); texture.invalidateSubImage({3, 4, 1}, {5, 6, 3}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::MultisampleTextureGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::MultisampleTextureGLTest) diff --git a/src/Magnum/GL/Test/MultisampleTextureTest.cpp b/src/Magnum/GL/Test/MultisampleTextureTest.cpp index 09c26f965..a861d64d6 100644 --- a/src/Magnum/GL/Test/MultisampleTextureTest.cpp +++ b/src/Magnum/GL/Test/MultisampleTextureTest.cpp @@ -25,9 +25,9 @@ #include -#include "Magnum/MultisampleTexture.h" +#include "Magnum/GL/MultisampleTexture.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct MultisampleTextureTest: TestSuite::Tester { explicit MultisampleTextureTest(); @@ -59,6 +59,6 @@ void MultisampleTextureTest::construct2DArrayNoCreate() { CORRADE_VERIFY(true); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::MultisampleTextureTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::MultisampleTextureTest) diff --git a/src/Magnum/GL/Test/PixelStorageGLTest.cpp b/src/Magnum/GL/Test/PixelStorageGLTest.cpp index 79497e5bd..e13b59dde 100644 --- a/src/Magnum/GL/Test/PixelStorageGLTest.cpp +++ b/src/Magnum/GL/Test/PixelStorageGLTest.cpp @@ -25,22 +25,22 @@ #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" #include "Magnum/Image.h" -#include "Magnum/OpenGLTester.h" -#include "Magnum/PixelFormat.h" -#include "Magnum/Texture.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/OpenGLTester.h" +#include "Magnum/GL/PixelFormat.h" +#include "Magnum/GL/Texture.h" #ifndef MAGNUM_TARGET_GLES2 -#include "Magnum/TextureArray.h" +#include "Magnum/GL/TextureArray.h" #endif -#include "Magnum/TextureFormat.h" +#include "Magnum/GL/TextureFormat.h" #ifdef MAGNUM_TARGET_GLES -#include "Magnum/Framebuffer.h" +#include "Magnum/GL/Framebuffer.h" #endif -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct PixelStorageGLTest: OpenGLTester { explicit PixelStorageGLTest(); @@ -104,8 +104,8 @@ namespace { void PixelStorageGLTest::unpack2D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::unpack_subimage::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::unpack_subimage::string() + std::string(" is not supported.")); #endif PixelStorage storage; @@ -119,7 +119,7 @@ void PixelStorageGLTest::unpack2D() { texture.setStorage(1, TextureFormat::RGB8, {2, 3}) .setSubImage(0, {}, image); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /* Read into zero-initialized array to avoid comparing random memory in padding bytes (confirmed on NVidia 355.11, AMD 15.300.1025.0) */ @@ -134,7 +134,7 @@ void PixelStorageGLTest::unpack2D() { fb.read(fb.viewport(), actual); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_AS(actual.data(), Containers::arrayView(ActualData), TestSuite::Compare::Container); @@ -142,8 +142,8 @@ void PixelStorageGLTest::unpack2D() { void PixelStorageGLTest::pack2D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::NV::pack_subimage::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::NV::pack_subimage::string() + std::string(" is not supported.")); #endif ImageView2D actual{PixelFormat::RGB, PixelType::UnsignedByte, {2, 3}, ActualData}; @@ -152,7 +152,7 @@ void PixelStorageGLTest::pack2D() { texture.setStorage(1, TextureFormat::RGB8, {2, 3}) .setSubImage(0, {}, actual); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /* Pre-allocate and zero out the data array so we can conveniently compare */ Image2D image{PixelStorage{} @@ -169,7 +169,7 @@ void PixelStorageGLTest::pack2D() { fb.read(fb.viewport(), image); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_AS(image.data(), Containers::arrayView(Data2D), TestSuite::Compare::Container); @@ -212,7 +212,7 @@ void PixelStorageGLTest::unpack3D() { texture.setStorage(1, TextureFormat::RGB8, {2, 3, 1}) .setSubImage(0, {}, image); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /* Testing mainly image height here, which is not available as pack parameter in ES */ @@ -224,7 +224,7 @@ void PixelStorageGLTest::unpack3D() { texture.image(0, actual); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /* Clear padding in the last row (the driver might leave them untouched, confirmed on NVidia 358.16) */ @@ -247,7 +247,7 @@ void PixelStorageGLTest::pack3D() { texture.setStorage(1, TextureFormat::RGB8, {2, 3, 1}) .setSubImage(0, {}, actual); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image3D image{PixelStorage{} .setAlignment(2) @@ -257,7 +257,7 @@ void PixelStorageGLTest::pack3D() { PixelFormat::RGB, PixelType::UnsignedByte, {}, Containers::Array{Containers::ValueInit, sizeof(Data3D)}}; texture.image(0, image); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_AS(image.data(), Containers::arrayView(Data3D), TestSuite::Compare::Container); @@ -290,8 +290,8 @@ namespace { } void PixelStorageGLTest::unpackCompressed2D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); CompressedPixelStorage storage; storage.setCompressedBlockSize({4, 4, 1}) @@ -305,11 +305,11 @@ void PixelStorageGLTest::unpackCompressed2D() { texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, {4, 4}) .setCompressedSubImage(0, {}, image); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedImage2D actual = texture.compressedImage(0, {}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_AS(Containers::arrayCast(actual.data()), Containers::arrayView(ActualCompressedData), @@ -317,8 +317,8 @@ void PixelStorageGLTest::unpackCompressed2D() { } void PixelStorageGLTest::packCompressed2D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); CompressedImageView2D actual{CompressedPixelFormat::RGBAS3tcDxt3, {4, 4}, ActualCompressedData}; @@ -326,7 +326,7 @@ void PixelStorageGLTest::packCompressed2D() { texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, {4, 4}) .setCompressedSubImage(0, {}, actual); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /* Pre-allocate and zero out the data array so we can conveniently compare */ CompressedImage2D image{CompressedPixelStorage{} @@ -337,7 +337,7 @@ void PixelStorageGLTest::packCompressed2D() { CompressedPixelFormat::RGBAS3tcDxt3, {}, Containers::Array{Containers::ValueInit, sizeof(CompressedData2D)}}; texture.compressedImage(0, image); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()), Containers::arrayView(CompressedData2D), @@ -398,8 +398,8 @@ namespace { } void PixelStorageGLTest::unpackCompressed3D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); CompressedPixelStorage storage; storage.setCompressedBlockSize({4, 4, 1}) @@ -414,11 +414,11 @@ void PixelStorageGLTest::unpackCompressed3D() { texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, {4, 4, 1}) .setCompressedSubImage(0, {}, image); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedImage3D actual = texture.compressedImage(0, {}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_AS(Containers::arrayCast(actual.data()), Containers::arrayView(ActualCompressedData), @@ -426,8 +426,8 @@ void PixelStorageGLTest::unpackCompressed3D() { } void PixelStorageGLTest::packCompressed3D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); CompressedImageView3D actual{CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 1}, ActualCompressedData}; @@ -435,7 +435,7 @@ void PixelStorageGLTest::packCompressed3D() { texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, {4, 4, 1}) .setCompressedSubImage(0, {}, actual); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /* Pre-allocate and zero out the data array so we can conveniently compare */ CompressedImage3D image{CompressedPixelStorage{} @@ -447,7 +447,7 @@ void PixelStorageGLTest::packCompressed3D() { CompressedPixelFormat::RGBAS3tcDxt3, {}, Containers::Array{Containers::ValueInit, sizeof(CompressedData3D)}}; texture.compressedImage(0, image); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()), Containers::arrayView(CompressedData3D), @@ -455,6 +455,6 @@ void PixelStorageGLTest::packCompressed3D() { } #endif -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::PixelStorageGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::PixelStorageGLTest) diff --git a/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp b/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp index 7609e6247..d4a22aad8 100644 --- a/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp +++ b/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp @@ -26,21 +26,21 @@ #include #include -#include "Magnum/AbstractShaderProgram.h" -#include "Magnum/Buffer.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/Framebuffer.h" -#include "Magnum/Mesh.h" -#include "Magnum/OpenGLTester.h" -#include "Magnum/PrimitiveQuery.h" -#include "Magnum/Renderbuffer.h" -#include "Magnum/RenderbufferFormat.h" -#include "Magnum/Shader.h" -#include "Magnum/TransformFeedback.h" +#include "Magnum/GL/AbstractShaderProgram.h" +#include "Magnum/GL/Buffer.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Framebuffer.h" +#include "Magnum/GL/Mesh.h" +#include "Magnum/GL/OpenGLTester.h" +#include "Magnum/GL/PrimitiveQuery.h" +#include "Magnum/GL/Renderbuffer.h" +#include "Magnum/GL/RenderbufferFormat.h" +#include "Magnum/GL/Shader.h" +#include "Magnum/GL/TransformFeedback.h" #include "Magnum/Math/Vector2.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct PrimitiveQueryGLTest: OpenGLTester { explicit PrimitiveQueryGLTest(); @@ -77,8 +77,8 @@ PrimitiveQueryGLTest::PrimitiveQueryGLTest() { void PrimitiveQueryGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::transform_feedback2::string() + std::string(" is not available.")); #endif GLuint id; @@ -98,11 +98,11 @@ void PrimitiveQueryGLTest::wrap() { #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void PrimitiveQueryGLTest::primitivesGenerated() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::transform_feedback::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::transform_feedback::string() + std::string(" is not available.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::geometry_shader::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::geometry_shader::string() + std::string(" is not available.")); #endif /* Bind some FB to avoid errors on contexts w/o default FB */ @@ -155,7 +155,7 @@ void PrimitiveQueryGLTest::primitivesGenerated() { .setCount(9) .addVertexBuffer(vertices, 0, MyShader::Position()); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); PrimitiveQuery q{PrimitiveQuery::Target::PrimitivesGenerated}; q.begin(); @@ -168,7 +168,7 @@ void PrimitiveQueryGLTest::primitivesGenerated() { const UnsignedInt count = q.result(); const bool availableAfter = q.resultAvailable(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(!availableBefore); CORRADE_VERIFY(availableAfter); CORRADE_COMPARE(count, 3); @@ -177,8 +177,8 @@ void PrimitiveQueryGLTest::primitivesGenerated() { #ifndef MAGNUM_TARGET_GLES void PrimitiveQueryGLTest::primitivesGeneratedIndexed() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::transform_feedback3::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::transform_feedback3::string() + std::string(" is not available.")); /* Bind some FB to avoid errors on contexts w/o default FB */ Renderbuffer color; @@ -222,7 +222,7 @@ void PrimitiveQueryGLTest::primitivesGeneratedIndexed() { .setCount(9) .addVertexBuffer(vertices, 0, MyShader::Position()); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); PrimitiveQuery q{PrimitiveQuery::Target::PrimitivesGenerated}; q.begin(0); @@ -233,15 +233,15 @@ void PrimitiveQueryGLTest::primitivesGeneratedIndexed() { q.end(); const UnsignedInt count = q.result(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(count, 3); } #endif void PrimitiveQueryGLTest::transformFeedbackPrimitivesWritten() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::transform_feedback2::string() + std::string(" is not available.")); #endif /* Bind some FB to avoid errors on contexts w/o default FB */ @@ -294,7 +294,7 @@ void PrimitiveQueryGLTest::transformFeedbackPrimitivesWritten() { mesh.setPrimitive(MeshPrimitive::Triangles) .setCount(9); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); TransformFeedback feedback; feedback.attachBuffer(0, output); @@ -312,15 +312,15 @@ void PrimitiveQueryGLTest::transformFeedbackPrimitivesWritten() { q.end(); const UnsignedInt count = q.result(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(count, 3); /* Three triangles (9 vertices) */ } #ifndef MAGNUM_TARGET_GLES void PrimitiveQueryGLTest::transformFeedbackOverflow() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::transform_feedback_overflow_query::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::transform_feedback_overflow_query::string() + std::string(" is not available.")); #endif /* Bind some FB to avoid errors on contexts w/o default FB */ @@ -373,7 +373,7 @@ void PrimitiveQueryGLTest::transformFeedbackOverflow() { mesh.setPrimitive(MeshPrimitive::Triangles) .setCount(9); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); TransformFeedback feedback; /* Deliberately one vertex smaller to not fit two of them */ @@ -395,12 +395,12 @@ void PrimitiveQueryGLTest::transformFeedbackOverflow() { const bool overflown1 = q1.result(); const bool overflown2 = q2.result(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(!overflown1); CORRADE_VERIFY(overflown2); /* Got space for only 17 vertices instead of 2*9 */ } #endif -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::PrimitiveQueryGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::PrimitiveQueryGLTest) diff --git a/src/Magnum/GL/Test/PrimitiveQueryTest.cpp b/src/Magnum/GL/Test/PrimitiveQueryTest.cpp index fce37f569..d5ae73de9 100644 --- a/src/Magnum/GL/Test/PrimitiveQueryTest.cpp +++ b/src/Magnum/GL/Test/PrimitiveQueryTest.cpp @@ -25,9 +25,9 @@ #include -#include "Magnum/PrimitiveQuery.h" +#include "Magnum/GL/PrimitiveQuery.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct PrimitiveQueryTest: TestSuite::Tester { explicit PrimitiveQueryTest(); @@ -48,6 +48,6 @@ void PrimitiveQueryTest::constructNoCreate() { CORRADE_VERIFY(true); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::PrimitiveQueryTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::PrimitiveQueryTest) diff --git a/src/Magnum/GL/Test/RectangleTextureGLTest.cpp b/src/Magnum/GL/Test/RectangleTextureGLTest.cpp index d7f1a11cd..e94163654 100644 --- a/src/Magnum/GL/Test/RectangleTextureGLTest.cpp +++ b/src/Magnum/GL/Test/RectangleTextureGLTest.cpp @@ -26,20 +26,19 @@ #include #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/BufferImage.h" #include "Magnum/Image.h" -#include "Magnum/ImageFormat.h" -#include "Magnum/OpenGLTester.h" -#include "Magnum/PixelFormat.h" -#include "Magnum/RectangleTexture.h" -#include "Magnum/TextureFormat.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/BufferImage.h" +#include "Magnum/GL/ImageFormat.h" +#include "Magnum/GL/OpenGLTester.h" +#include "Magnum/GL/PixelFormat.h" +#include "Magnum/GL/RectangleTexture.h" +#include "Magnum/GL/TextureFormat.h" #include "Magnum/Math/Color.h" #include "Magnum/Math/Range.h" -#include "Magnum/OpenGLTester.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct RectangleTextureGLTest: OpenGLTester { explicit RectangleTextureGLTest(); @@ -147,22 +146,22 @@ RectangleTextureGLTest::RectangleTextureGLTest() { } void RectangleTextureGLTest::construct() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); { RectangleTexture texture; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(texture.id() > 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void RectangleTextureGLTest::wrap() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); GLuint id; glGenTextures(1, &id); @@ -179,58 +178,58 @@ void RectangleTextureGLTest::wrap() { } void RectangleTextureGLTest::bind() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; texture.bind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::bind(7, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(7, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void RectangleTextureGLTest::bindImage() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::shader_image_load_store::string() + std::string(" is not supported.")); RectangleTexture texture; texture.setStorage(TextureFormat::RGBA8, Vector2i{32}) .bindImage(2, ImageAccess::ReadWrite, ImageFormat::RGBA8); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbindImage(2); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbindImages(1, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } template void RectangleTextureGLTest::sampling() { setTestCaseName(std::is_same::value ? "sampling" : "sampling"); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; texture.setMinificationFilter(T::Filter::Linear) @@ -238,83 +237,83 @@ template void RectangleTextureGLTest::sampling() { .setWrapping(T::Wrapping::ClampToBorder) .setBorderColor(Color3(0.5f)) .setMaxAnisotropy(Sampler::maxMaxAnisotropy()) - .setCompareMode(Sampler::CompareMode::CompareRefToTexture) - .setCompareFunction(Sampler::CompareFunction::GreaterOrEqual); + .setCompareMode(SamplerCompareMode::CompareRefToTexture) + .setCompareFunction(SamplerCompareFunction::GreaterOrEqual); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void RectangleTextureGLTest::samplingSRGBDecode() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); RectangleTexture texture; texture.setSRGBDecode(false); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void RectangleTextureGLTest::samplingBorderInteger() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_integer::string() + std::string(" is not supported.")); RectangleTexture a; - a.setWrapping(Sampler::Wrapping::ClampToBorder) + a.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Vector4i(1, 56, 78, -2)); RectangleTexture b; - b.setWrapping(Sampler::Wrapping::ClampToBorder) + b.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Vector4ui(35, 56, 78, 15)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void RectangleTextureGLTest::samplingSwizzle() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_swizzle::string() + std::string(" is not supported.")); RectangleTexture texture; texture.setSwizzle<'b', 'g', 'r', '0'>(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void RectangleTextureGLTest::samplingDepthStencilMode() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::stencil_texturing::string() + std::string(" is not supported.")); RectangleTexture texture; - texture.setDepthStencilMode(Sampler::DepthStencilMode::StencilIndex); + texture.setDepthStencilMode(SamplerDepthStencilMode::StencilIndex); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void RectangleTextureGLTest::storage() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; texture.setStorage(TextureFormat::RGBA8, Vector2i(32)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.imageSize(), Vector2i(32)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void RectangleTextureGLTest::image() { setTestCaseDescription(PixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; texture.setImage(TextureFormat::RGBA8, ImageView2D{ @@ -322,12 +321,12 @@ void RectangleTextureGLTest::image() { PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(2), PixelStorageData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image2D image = texture.image({PixelStorageData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), @@ -338,8 +337,8 @@ void RectangleTextureGLTest::image() { void RectangleTextureGLTest::imageBuffer() { setTestCaseDescription(PixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; texture.setImage(TextureFormat::RGBA8, BufferImage2D{ @@ -348,13 +347,13 @@ void RectangleTextureGLTest::imageBuffer() { PixelStorageData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); BufferImage2D image = texture.image({PixelStorageData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorageData[testCaseInstanceId()].offset), @@ -375,8 +374,8 @@ namespace { void RectangleTextureGLTest::subImage() { setTestCaseDescription(PixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; texture.setImage(TextureFormat::RGBA8, @@ -386,11 +385,11 @@ void RectangleTextureGLTest::subImage() { PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(2), PixelStorageData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image2D image = texture.image({PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(4)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()), @@ -400,8 +399,8 @@ void RectangleTextureGLTest::subImage() { void RectangleTextureGLTest::subImageBuffer() { setTestCaseDescription(PixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; texture.setImage(TextureFormat::RGBA8, @@ -412,12 +411,12 @@ void RectangleTextureGLTest::subImageBuffer() { PixelStorageData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); BufferImage2D image = texture.image({PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(4)); CORRADE_COMPARE_AS(Containers::arrayCast(imageData), @@ -428,22 +427,22 @@ void RectangleTextureGLTest::subImageBuffer() { void RectangleTextureGLTest::subImageQuery() { setTestCaseDescription(PixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); RectangleTexture texture; texture.setStorage(TextureFormat::RGBA8, Vector2i{4}) .setSubImage({}, ImageView2D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i{4}, SubDataComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image2D image = texture.subImage(Range2Di::fromSize(Vector2i{1}, Vector2i{2}), {PixelStorageData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{2}); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorageData[testCaseInstanceId()].offset), @@ -454,23 +453,23 @@ void RectangleTextureGLTest::subImageQuery() { void RectangleTextureGLTest::subImageQueryBuffer() { setTestCaseDescription(PixelStorageData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); RectangleTexture texture; texture.setStorage(TextureFormat::RGBA8, Vector2i{4}) .setSubImage({}, ImageView2D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i{4}, SubDataComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); BufferImage2D image = texture.subImage(Range2Di::fromSize(Vector2i{1}, Vector2i{2}), {PixelStorageData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{2}); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorageData[testCaseInstanceId()].offset), @@ -503,27 +502,27 @@ void RectangleTextureGLTest::compressedSubImageQueryBuffer() { } void RectangleTextureGLTest::invalidateImage() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; texture.setStorage(TextureFormat::RGBA8, Vector2i(32)); texture.invalidateImage(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void RectangleTextureGLTest::invalidateSubImage() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_rectangle::string() + std::string(" is not supported.")); RectangleTexture texture; texture.setStorage(TextureFormat::RGBA8, Vector2i(32)); texture.invalidateSubImage(Vector2i(4), Vector2i(16)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::RectangleTextureGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::RectangleTextureGLTest) diff --git a/src/Magnum/GL/Test/RectangleTextureTest.cpp b/src/Magnum/GL/Test/RectangleTextureTest.cpp index 9b0ef6d46..a228311df 100644 --- a/src/Magnum/GL/Test/RectangleTextureTest.cpp +++ b/src/Magnum/GL/Test/RectangleTextureTest.cpp @@ -25,9 +25,9 @@ #include -#include "Magnum/RectangleTexture.h" +#include "Magnum/GL/RectangleTexture.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct RectangleTextureTest: TestSuite::Tester { explicit RectangleTextureTest(); @@ -48,6 +48,6 @@ void RectangleTextureTest::constructNoCreate() { CORRADE_VERIFY(true); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::RectangleTextureTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::RectangleTextureTest) diff --git a/src/Magnum/GL/Test/RenderbufferGLTest.cpp b/src/Magnum/GL/Test/RenderbufferGLTest.cpp index 9ec45885a..0cb0b7906 100644 --- a/src/Magnum/GL/Test/RenderbufferGLTest.cpp +++ b/src/Magnum/GL/Test/RenderbufferGLTest.cpp @@ -23,14 +23,14 @@ DEALINGS IN THE SOFTWARE. */ +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/OpenGLTester.h" +#include "Magnum/GL/Renderbuffer.h" +#include "Magnum/GL/RenderbufferFormat.h" #include "Magnum/Math/Vector2.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/Renderbuffer.h" -#include "Magnum/RenderbufferFormat.h" -#include "Magnum/OpenGLTester.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct RenderbufferGLTest: OpenGLTester { explicit RenderbufferGLTest(); @@ -70,18 +70,18 @@ RenderbufferGLTest::RenderbufferGLTest() { void RenderbufferGLTest::construct() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif { const Renderbuffer renderbuffer; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(renderbuffer.id() > 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void RenderbufferGLTest::constructCopy() { @@ -91,14 +91,14 @@ void RenderbufferGLTest::constructCopy() { void RenderbufferGLTest::constructMove() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif Renderbuffer a; const Int id = a.id(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); Renderbuffer b(std::move(a)); @@ -110,7 +110,7 @@ void RenderbufferGLTest::constructMove() { const Int cId = c.id(); c = std::move(b); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); CORRADE_COMPARE(b.id(), cId); CORRADE_COMPARE(c.id(), id); @@ -118,8 +118,8 @@ void RenderbufferGLTest::constructMove() { void RenderbufferGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif GLuint id; @@ -139,20 +139,20 @@ void RenderbufferGLTest::wrap() { #ifndef MAGNUM_TARGET_WEBGL void RenderbufferGLTest::label() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); Renderbuffer renderbuffer; CORRADE_COMPARE(renderbuffer.label(), ""); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); renderbuffer.setLabel("MyRenderbuffer"); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(renderbuffer.label(), "MyRenderbuffer"); } @@ -160,8 +160,8 @@ void RenderbufferGLTest::label() { void RenderbufferGLTest::setStorage() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #endif Renderbuffer renderbuffer; @@ -172,17 +172,17 @@ void RenderbufferGLTest::setStorage() { renderbuffer.setStorage(RenderbufferFormat::RGBA4, {128, 128}); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) void RenderbufferGLTest::setStorageMultisample() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not available.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available."); #endif @@ -194,10 +194,10 @@ void RenderbufferGLTest::setStorageMultisample() { renderbuffer.setStorageMultisample(Renderbuffer::maxSamples(), RenderbufferFormat::RGBA4, {128, 128}); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::RenderbufferGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::RenderbufferGLTest) diff --git a/src/Magnum/GL/Test/RenderbufferTest.cpp b/src/Magnum/GL/Test/RenderbufferTest.cpp index b894f16e9..c7f7b8d05 100644 --- a/src/Magnum/GL/Test/RenderbufferTest.cpp +++ b/src/Magnum/GL/Test/RenderbufferTest.cpp @@ -25,9 +25,9 @@ #include -#include "Magnum/Renderbuffer.h" +#include "Magnum/GL/Renderbuffer.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct RenderbufferTest: TestSuite::Tester { explicit RenderbufferTest(); @@ -48,6 +48,6 @@ void RenderbufferTest::constructNoCreate() { CORRADE_VERIFY(true); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::RenderbufferTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::RenderbufferTest) diff --git a/src/Magnum/GL/Test/RendererTest.cpp b/src/Magnum/GL/Test/RendererTest.cpp index 478c30bfb..9c1c69e2f 100644 --- a/src/Magnum/GL/Test/RendererTest.cpp +++ b/src/Magnum/GL/Test/RendererTest.cpp @@ -26,9 +26,9 @@ #include #include -#include "Magnum/Renderer.h" +#include "Magnum/GL/Renderer.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct RendererTest: TestSuite::Tester { explicit RendererTest(); @@ -72,6 +72,6 @@ void RendererTest::debugGraphicsResetStatus() { } #endif -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::RendererTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::RendererTest) diff --git a/src/Magnum/GL/Test/SampleQueryGLTest.cpp b/src/Magnum/GL/Test/SampleQueryGLTest.cpp index c41f520a0..f2494406e 100644 --- a/src/Magnum/GL/Test/SampleQueryGLTest.cpp +++ b/src/Magnum/GL/Test/SampleQueryGLTest.cpp @@ -26,19 +26,19 @@ #include #include -#include "Magnum/AbstractShaderProgram.h" -#include "Magnum/Buffer.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/Framebuffer.h" -#include "Magnum/Mesh.h" -#include "Magnum/OpenGLTester.h" -#include "Magnum/Renderbuffer.h" -#include "Magnum/RenderbufferFormat.h" -#include "Magnum/SampleQuery.h" -#include "Magnum/Shader.h" - -namespace Magnum { namespace Test { +#include "Magnum/GL/AbstractShaderProgram.h" +#include "Magnum/GL/Buffer.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Framebuffer.h" +#include "Magnum/GL/Mesh.h" +#include "Magnum/GL/OpenGLTester.h" +#include "Magnum/GL/Renderbuffer.h" +#include "Magnum/GL/RenderbufferFormat.h" +#include "Magnum/GL/SampleQuery.h" +#include "Magnum/GL/Shader.h" + +namespace Magnum { namespace GL { namespace Test { struct SampleQueryGLTest: OpenGLTester { explicit SampleQueryGLTest(); @@ -63,8 +63,8 @@ SampleQueryGLTest::SampleQueryGLTest() { void SampleQueryGLTest::wrap() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::occlusion_query_boolean::string() + std::string(" is not available.")); #endif GLuint id; @@ -150,8 +150,8 @@ MyShader::MyShader() { void SampleQueryGLTest::querySamplesPassed() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::occlusion_query_boolean::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::occlusion_query_boolean::string() + std::string(" is not available.")); #endif Renderbuffer renderbuffer; @@ -175,7 +175,7 @@ void SampleQueryGLTest::querySamplesPassed() { MyShader shader; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); framebuffer.bind(); @@ -193,7 +193,7 @@ void SampleQueryGLTest::querySamplesPassed() { const UnsignedInt count = q.result(); const bool availableAfter = q.resultAvailable(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(!availableBefore); CORRADE_VERIFY(availableAfter); #ifndef MAGNUM_TARGET_GLES @@ -205,8 +205,8 @@ void SampleQueryGLTest::querySamplesPassed() { #ifndef MAGNUM_TARGET_GLES void SampleQueryGLTest::conditionalRender() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::NV::conditional_render::string() + std::string(" is not available.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::NV::conditional_render::string() + std::string(" is not available.")); Renderbuffer renderbuffer; renderbuffer.setStorage(RenderbufferFormat::RGBA8, Vector2i(32)); @@ -226,7 +226,7 @@ void SampleQueryGLTest::conditionalRender() { MyShader shader; framebuffer.bind(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); SampleQuery qYes{SampleQuery::Target::SamplesPassed}, qNo{SampleQuery::Target::SamplesPassed}, @@ -244,7 +244,7 @@ void SampleQueryGLTest::conditionalRender() { q.end(); qYes.endConditionalRender(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(qYes.result()); CORRADE_VERIFY(q.result()); @@ -259,12 +259,12 @@ void SampleQueryGLTest::conditionalRender() { q.end(); qNo.endConditionalRender(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(!qNo.result()); CORRADE_VERIFY(!q.result()); } #endif -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::SampleQueryGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::SampleQueryGLTest) diff --git a/src/Magnum/GL/Test/SampleQueryTest.cpp b/src/Magnum/GL/Test/SampleQueryTest.cpp index a3b11a7dd..24d2d2df5 100644 --- a/src/Magnum/GL/Test/SampleQueryTest.cpp +++ b/src/Magnum/GL/Test/SampleQueryTest.cpp @@ -25,9 +25,9 @@ #include -#include "Magnum/SampleQuery.h" +#include "Magnum/GL/SampleQuery.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct SampleQueryTest: TestSuite::Tester { explicit SampleQueryTest(); @@ -48,6 +48,6 @@ void SampleQueryTest::constructNoCreate() { CORRADE_VERIFY(true); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::SampleQueryTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::SampleQueryTest) diff --git a/src/Magnum/GL/Test/ShaderGLTest.cpp b/src/Magnum/GL/Test/ShaderGLTest.cpp index 7643d5e52..cca23260d 100644 --- a/src/Magnum/GL/Test/ShaderGLTest.cpp +++ b/src/Magnum/GL/Test/ShaderGLTest.cpp @@ -25,14 +25,14 @@ #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/Shader.h" -#include "Magnum/OpenGLTester.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Shader.h" +#include "Magnum/GL/OpenGLTester.h" #include "configure.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct ShaderGLTest: OpenGLTester { explicit ShaderGLTest(); @@ -80,7 +80,7 @@ void ShaderGLTest::construct() { const Shader shader(Version::GLES300, Shader::Type::Fragment); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(shader.id() > 0); CORRADE_COMPARE(shader.type(), Shader::Type::Fragment); #ifndef MAGNUM_TARGET_GLES @@ -90,7 +90,7 @@ void ShaderGLTest::construct() { #endif } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void ShaderGLTest::constructNoVersion() { @@ -111,7 +111,7 @@ void ShaderGLTest::constructMove() { #endif const Int id = a.id(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); Shader b(std::move(a)); @@ -133,7 +133,7 @@ void ShaderGLTest::constructMove() { const Int cId = c.id(); c = std::move(b); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); CORRADE_COMPARE(b.id(), cId); CORRADE_COMPARE(c.id(), id); @@ -148,8 +148,8 @@ void ShaderGLTest::constructMove() { #ifndef MAGNUM_TARGET_WEBGL void ShaderGLTest::label() { /* No-Op version is tested in AbstractObjectGLTest */ - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); #ifndef MAGNUM_TARGET_GLES @@ -162,7 +162,7 @@ void ShaderGLTest::label() { shader.setLabel("MyShader"); CORRADE_COMPARE(shader.label(), "MyShader"); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif @@ -305,6 +305,6 @@ void ShaderGLTest::compileNoVersion() { CORRADE_VERIFY(shader.compile()); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::ShaderGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::ShaderGLTest) diff --git a/src/Magnum/GL/Test/ShaderTest.cpp b/src/Magnum/GL/Test/ShaderTest.cpp index aabb95eb9..efa0a00f1 100644 --- a/src/Magnum/GL/Test/ShaderTest.cpp +++ b/src/Magnum/GL/Test/ShaderTest.cpp @@ -26,9 +26,9 @@ #include #include -#include "Magnum/Shader.h" +#include "Magnum/GL/Shader.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct ShaderTest: TestSuite::Tester { explicit ShaderTest(); @@ -47,6 +47,6 @@ void ShaderTest::debugType() { CORRADE_COMPARE(out.str(), "GL::Shader::Type::Fragment GL::Shader::Type(0xdead)\n"); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::ShaderTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::ShaderTest) diff --git a/src/Magnum/GL/Test/TextureArrayGLTest.cpp b/src/Magnum/GL/Test/TextureArrayGLTest.cpp index 315de307c..01800dffe 100644 --- a/src/Magnum/GL/Test/TextureArrayGLTest.cpp +++ b/src/Magnum/GL/Test/TextureArrayGLTest.cpp @@ -25,19 +25,19 @@ #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/BufferImage.h" #include "Magnum/Image.h" -#include "Magnum/ImageFormat.h" -#include "Magnum/OpenGLTester.h" -#include "Magnum/PixelFormat.h" -#include "Magnum/TextureArray.h" -#include "Magnum/TextureFormat.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/BufferImage.h" +#include "Magnum/GL/ImageFormat.h" +#include "Magnum/GL/OpenGLTester.h" +#include "Magnum/GL/PixelFormat.h" +#include "Magnum/GL/TextureArray.h" +#include "Magnum/GL/TextureFormat.h" #include "Magnum/Math/Color.h" #include "Magnum/Math/Range.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct TextureArrayGLTest: OpenGLTester { explicit TextureArrayGLTest(); @@ -375,34 +375,34 @@ TextureArrayGLTest::TextureArrayGLTest() { #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::construct1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); { Texture1DArray texture; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(texture.id() > 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif void TextureArrayGLTest::construct2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif { Texture2DArray texture; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(texture.id() > 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #ifndef MAGNUM_TARGET_GLES @@ -424,8 +424,8 @@ void TextureArrayGLTest::wrap1D() { void TextureArrayGLTest::wrap2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif GLuint id; @@ -444,85 +444,85 @@ void TextureArrayGLTest::wrap2D() { #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::bind1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; texture.bind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::bind(7, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(7, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif void TextureArrayGLTest::bind2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif Texture2DArray texture; texture.bind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::bind(7, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(7, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::bindImage1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::shader_image_load_store::string() + std::string(" is not supported.")); Texture1DArray texture; texture.setStorage(1, TextureFormat::RGBA8, {32, 4}) .bindImage(2, 0, 1, ImageAccess::ReadWrite, ImageFormat::RGBA8); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); texture.bindImageLayered(3, 0, ImageAccess::ReadWrite, ImageFormat::RGBA8); AbstractTexture::unbindImage(2); AbstractTexture::unbindImage(3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbindImages(1, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif void TextureArrayGLTest::bindImage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::shader_image_load_store::string() + std::string(" is not supported.")); #else if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); @@ -532,23 +532,23 @@ void TextureArrayGLTest::bindImage2D() { texture.setStorage(1, TextureFormat::RGBA8, {32, 32, 4}) .bindImage(2, 0, 1, ImageAccess::ReadWrite, ImageFormat::RGBA8); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); texture.bindImageLayered(3, 0, ImageAccess::ReadWrite, ImageFormat::RGBA8); AbstractTexture::unbindImage(2); AbstractTexture::unbindImage(3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbindImages(1, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #endif } #endif @@ -558,8 +558,8 @@ template void TextureArrayGLTest::sampling1D() { setTestCaseName(std::is_same::value ? "sampling1D" : "sampling1D"); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; texture.setMinificationFilter(T::Filter::Linear, T::Mipmap::Linear) @@ -572,62 +572,62 @@ template void TextureArrayGLTest::sampling1D() { .setWrapping(T::Wrapping::ClampToBorder) .setBorderColor(Color3(0.5f)) .setMaxAnisotropy(Sampler::maxMaxAnisotropy()) - .setCompareMode(Sampler::CompareMode::CompareRefToTexture) - .setCompareFunction(Sampler::CompareFunction::GreaterOrEqual); + .setCompareMode(SamplerCompareMode::CompareRefToTexture) + .setCompareFunction(SamplerCompareFunction::GreaterOrEqual); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void TextureArrayGLTest::samplingSRGBDecode1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); Texture1DArray texture; texture.setSRGBDecode(false); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void TextureArrayGLTest::samplingSwizzle1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_swizzle::string() + std::string(" is not supported.")); Texture1DArray texture; texture.setSwizzle<'b', 'g', 'r', '0'>(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void TextureArrayGLTest::samplingBorderInteger1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_integer::string() + std::string(" is not supported.")); Texture1DArray a; - a.setWrapping(Sampler::Wrapping::ClampToBorder) + a.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Vector4i(1, 56, 78, -2)); Texture1DArray b; - b.setWrapping(Sampler::Wrapping::ClampToBorder) + b.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Vector4ui(35, 56, 78, 15)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void TextureArrayGLTest::samplingDepthStencilMode1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::stencil_texturing::string() + std::string(" is not supported.")); Texture1DArray texture; - texture.setDepthStencilMode(Sampler::DepthStencilMode::StencilIndex); + texture.setDepthStencilMode(SamplerDepthStencilMode::StencilIndex); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif @@ -636,8 +636,8 @@ template void TextureArrayGLTest::sampling2D() { "sampling2D" : "sampling2D"); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif Texture2DArray texture; @@ -660,131 +660,131 @@ template void TextureArrayGLTest::sampling2D() { #endif .setMaxAnisotropy(Sampler::maxMaxAnisotropy()) #ifndef MAGNUM_TARGET_GLES - .setCompareMode(Sampler::CompareMode::CompareRefToTexture) - .setCompareFunction(Sampler::CompareFunction::GreaterOrEqual) + .setCompareMode(SamplerCompareMode::CompareRefToTexture) + .setCompareFunction(SamplerCompareFunction::GreaterOrEqual) #endif ; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void TextureArrayGLTest::samplingSRGBDecode2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); Texture2DArray texture; texture.setSRGBDecode(false); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #ifndef MAGNUM_TARGET_GLES2 void TextureArrayGLTest::samplingSwizzle2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_swizzle::string() + std::string(" is not supported.")); #endif Texture2DArray texture; texture.setSwizzle<'b', 'g', 'r', '0'>(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #else void TextureArrayGLTest::samplingMaxLevel2D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::APPLE::texture_max_level::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::APPLE::texture_max_level::string() + std::string(" is not supported.")); Texture2DArray texture; texture.setMaxLevel(750); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void TextureArrayGLTest::samplingCompare2D() { - if(!Context::current().isExtensionSupported() || - !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::NV::shadow_samplers_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported() || + !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::NV::shadow_samplers_array::string() + std::string(" is not supported.")); Texture2DArray texture; - texture.setCompareMode(Sampler::CompareMode::CompareRefToTexture) - .setCompareFunction(Sampler::CompareFunction::GreaterOrEqual); + texture.setCompareMode(SamplerCompareMode::CompareRefToTexture) + .setCompareFunction(SamplerCompareFunction::GreaterOrEqual); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureArrayGLTest::samplingBorderInteger2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_integer::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_border_clamp::string() + std::string(" is not supported.")); #endif Texture2DArray a; - a.setWrapping(Sampler::Wrapping::ClampToBorder) + a.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Vector4i(1, 56, 78, -2)); Texture2DArray b; - b.setWrapping(Sampler::Wrapping::ClampToBorder) + b.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Vector4ui(35, 56, 78, 15)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #ifndef MAGNUM_TARGET_GLES2 void TextureArrayGLTest::samplingDepthStencilMode2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::stencil_texturing::string() + std::string(" is not supported.")); #else if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif Texture2DArray texture; - texture.setDepthStencilMode(Sampler::DepthStencilMode::StencilIndex); + texture.setDepthStencilMode(SamplerDepthStencilMode::StencilIndex); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #ifdef MAGNUM_TARGET_GLES void TextureArrayGLTest::samplingBorder2D() { - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("No required extension is supported."); Texture2DArray texture; - texture.setWrapping(Sampler::Wrapping::ClampToBorder) + texture.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Color3(0.5f)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::storage1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; texture.setStorage(5, TextureFormat::RGBA8, Vector2i(32)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.imageSize(0), Vector2i(32, 32)); CORRADE_COMPARE(texture.imageSize(1), Vector2i(16, 32)); @@ -793,20 +793,20 @@ void TextureArrayGLTest::storage1D() { CORRADE_COMPARE(texture.imageSize(4), Vector2i( 2, 32)); CORRADE_COMPARE(texture.imageSize(5), Vector2i( 0, 0)); /* not available */ - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif void TextureArrayGLTest::storage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif Texture2DArray texture; texture.setStorage(5, TextureFormat::RGBA8, Vector3i(32)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES @@ -821,7 +821,7 @@ void TextureArrayGLTest::storage2D() { CORRADE_COMPARE(texture.imageSize(4), Vector3i( 2, 2, 32)); CORRADE_COMPARE(texture.imageSize(5), Vector3i( 0, 0, 0)); /* not available */ - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #endif } @@ -829,20 +829,20 @@ void TextureArrayGLTest::storage2D() { void TextureArrayGLTest::image1D() { setTestCaseDescription(PixelStorage1DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; texture.setImage(0, TextureFormat::RGBA8, ImageView2D{ PixelStorage1DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(2), PixelStorage1DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image2D image = texture.image(0, {PixelStorage1DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage1DData[testCaseInstanceId()].offset), @@ -853,8 +853,8 @@ void TextureArrayGLTest::image1D() { void TextureArrayGLTest::image1DBuffer() { setTestCaseDescription(PixelStorage1DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; texture.setImage(0, TextureFormat::RGBA8, BufferImage2D{ @@ -862,14 +862,14 @@ void TextureArrayGLTest::image1DBuffer() { PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(2), PixelStorage1DData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); BufferImage2D image = texture.image(0, {PixelStorage1DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage1DData[testCaseInstanceId()].offset), @@ -890,8 +890,8 @@ namespace { void TextureArrayGLTest::subImage1D() { setTestCaseDescription(PixelStorage1DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; texture.setImage(0, TextureFormat::RGBA8, @@ -900,11 +900,11 @@ void TextureArrayGLTest::subImage1D() { PixelStorage1DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(2), PixelStorage1DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image2D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(4)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()), @@ -915,8 +915,8 @@ void TextureArrayGLTest::subImage1D() { void TextureArrayGLTest::subImage1DBuffer() { setTestCaseDescription(PixelStorage1DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; texture.setImage(0, TextureFormat::RGBA8, @@ -927,12 +927,12 @@ void TextureArrayGLTest::subImage1DBuffer() { PixelStorage1DData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); BufferImage2D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(4)); CORRADE_COMPARE_AS(Containers::arrayCast(imageData), @@ -943,22 +943,22 @@ void TextureArrayGLTest::subImage1DBuffer() { void TextureArrayGLTest::subImage1DQuery() { setTestCaseDescription(PixelStorage1DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture1DArray texture; texture.setStorage(1, TextureFormat::RGBA8, Vector2i{4}) .setSubImage(0, {}, ImageView2D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i{4}, SubData1DComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image2D image = texture.subImage(0, Range2Di::fromSize(Vector2i{1}, Vector2i{2}), {PixelStorage1DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{2}); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage1DData[testCaseInstanceId()].offset), @@ -969,23 +969,23 @@ void TextureArrayGLTest::subImage1DQuery() { void TextureArrayGLTest::subImage1DQueryBuffer() { setTestCaseDescription(PixelStorage1DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture1DArray texture; texture.setStorage(1, TextureFormat::RGBA8, Vector2i{4}) .setSubImage(0, {}, ImageView2D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i{4}, SubData1DComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); BufferImage2D image = texture.subImage(0, Range2Di::fromSize(Vector2i{1}, Vector2i{2}), {PixelStorage1DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{2}); @@ -1024,8 +1024,8 @@ void TextureArrayGLTest::image2D() { setTestCaseDescription(PixelStorage2DData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif Texture2DArray texture; @@ -1034,14 +1034,14 @@ void TextureArrayGLTest::image2D() { PixelFormat::RGBA, PixelType::UnsignedByte, Vector3i(2), PixelStorage2DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES Image3D image = texture.image(0, {PixelStorage2DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage2DData[testCaseInstanceId()].offset), @@ -1054,8 +1054,8 @@ void TextureArrayGLTest::image2DBuffer() { setTestCaseDescription(PixelStorage2DData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif Texture2DArray texture; @@ -1065,7 +1065,7 @@ void TextureArrayGLTest::image2DBuffer() { PixelStorage2DData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES @@ -1073,7 +1073,7 @@ void TextureArrayGLTest::image2DBuffer() { PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2)); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage2DData[testCaseInstanceId()].offset), @@ -1114,8 +1114,8 @@ void TextureArrayGLTest::subImage2D() { setTestCaseDescription(PixelStorage2DData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif Texture2DArray texture; @@ -1126,13 +1126,13 @@ void TextureArrayGLTest::subImage2D() { PixelFormat::RGBA, PixelType::UnsignedByte, Vector3i(2), PixelStorage2DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES Image3D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(4)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()), @@ -1145,8 +1145,8 @@ void TextureArrayGLTest::subImage2DBuffer() { setTestCaseDescription(PixelStorage2DData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif Texture2DArray texture; @@ -1158,14 +1158,14 @@ void TextureArrayGLTest::subImage2DBuffer() { PixelStorage2DData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES BufferImage3D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(4)); CORRADE_COMPARE_AS(Containers::arrayCast(imageData), @@ -1178,22 +1178,22 @@ void TextureArrayGLTest::subImage2DBuffer() { void TextureArrayGLTest::subImage2DQuery() { setTestCaseDescription(PixelStorage2DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture2DArray texture; texture.setStorage(1, TextureFormat::RGBA8, Vector3i{4}) .setSubImage(0, {}, ImageView3D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector3i{4}, SubData2DComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image3D image = texture.subImage(0, Range3Di::fromSize(Vector3i{1}, Vector3i{2}), {PixelStorage2DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{2}); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage2DData[testCaseInstanceId()].offset), @@ -1204,23 +1204,23 @@ void TextureArrayGLTest::subImage2DQuery() { void TextureArrayGLTest::subImage2DQueryBuffer() { setTestCaseDescription(PixelStorage2DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture2DArray texture; texture.setStorage(1, TextureFormat::RGBA8, Vector3i{4}) .setSubImage(0, {}, ImageView3D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector3i{4}, SubData2DComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); BufferImage3D image = texture.subImage(0, Range3Di::fromSize(Vector3i{1}, Vector3i{2}), {PixelStorage2DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{2}); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage2DData[testCaseInstanceId()].offset), @@ -1233,20 +1233,20 @@ void TextureArrayGLTest::compressedImage2D() { setTestCaseDescription(CompressedPixelStorage2DData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif Texture2DArray texture; @@ -1257,12 +1257,12 @@ void TextureArrayGLTest::compressedImage2D() { CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 2}, CompressedPixelStorage2DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CompressedImage3D image = texture.compressedImage(0, {CompressedPixelStorage2DData[testCaseInstanceId()].storage}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 2})); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), @@ -1275,20 +1275,20 @@ void TextureArrayGLTest::compressedImage2DBuffer() { setTestCaseDescription(CompressedPixelStorage2DData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif Texture2DArray texture; @@ -1300,13 +1300,13 @@ void TextureArrayGLTest::compressedImage2DBuffer() { CompressedPixelStorage2DData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CompressedBufferImage3D image = texture.compressedImage(0, {CompressedPixelStorage2DData[testCaseInstanceId()].storage}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 2})); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), @@ -1357,20 +1357,20 @@ void TextureArrayGLTest::compressedSubImage2D() { setTestCaseDescription(CompressedPixelStorage2DData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif Texture2DArray texture; @@ -1383,12 +1383,12 @@ void TextureArrayGLTest::compressedSubImage2D() { CompressedPixelFormat::RGBAS3tcDxt3, {4, 4, 2}, CompressedPixelStorage2DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CompressedImage3D image = texture.compressedImage(0, {}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{12, 4, 4})); @@ -1407,20 +1407,20 @@ void TextureArrayGLTest::compressedSubImage2DBuffer() { setTestCaseDescription(CompressedPixelStorage2DData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif Texture2DArray texture; @@ -1434,13 +1434,13 @@ void TextureArrayGLTest::compressedSubImage2DBuffer() { CompressedPixelStorage2DData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CompressedBufferImage3D image = texture.compressedImage(0, {}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{12, 4, 4})); CORRADE_COMPARE_AS(Containers::arrayCast(imageData), @@ -1453,27 +1453,27 @@ void TextureArrayGLTest::compressedSubImage2DBuffer() { void TextureArrayGLTest::compressedSubImage2DQuery() { setTestCaseDescription(CompressedPixelStorage2DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); - if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); - if(CompressedPixelStorage2DData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::internalformat_query2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorage2DData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::internalformat_query2::string() + std::string(" is not supported.")); Texture2DArray texture; texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, {12, 4, 4}) .setCompressedSubImage(0, {}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 4, 4}, CompressedSubData2DComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 1}, {4, 4, 2}), {CompressedPixelStorage2DData[testCaseInstanceId()].storage}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 2})); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), @@ -1484,23 +1484,23 @@ void TextureArrayGLTest::compressedSubImage2DQuery() { void TextureArrayGLTest::compressedSubImage2DQueryBuffer() { setTestCaseDescription(CompressedPixelStorage2DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); - if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); - if(CompressedPixelStorage2DData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::internalformat_query2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorage2DData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::internalformat_query2::string() + std::string(" is not supported.")); Texture2DArray texture; texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, {12, 4, 4}) .setCompressedSubImage(0, {}, CompressedImageView3D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 4, 4}, CompressedSubData2DComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 1}, {4, 4, 2}), { #ifndef MAGNUM_TARGET_GLES @@ -1509,7 +1509,7 @@ void TextureArrayGLTest::compressedSubImage2DQueryBuffer() { }, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4, 4, 2})); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), @@ -1518,10 +1518,10 @@ void TextureArrayGLTest::compressedSubImage2DQueryBuffer() { } void TextureArrayGLTest::generateMipmap1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; texture.setImage(0, TextureFormat::RGBA8, @@ -1532,7 +1532,7 @@ void TextureArrayGLTest::generateMipmap1D() { texture.generateMipmap(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.imageSize(0), Vector2i(32, 32)); CORRADE_COMPARE(texture.imageSize(1), Vector2i(16, 32)); @@ -1541,16 +1541,16 @@ void TextureArrayGLTest::generateMipmap1D() { CORRADE_COMPARE(texture.imageSize(4), Vector2i( 2, 32)); CORRADE_COMPARE(texture.imageSize(5), Vector2i( 1, 32)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif void TextureArrayGLTest::generateMipmap2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif Texture2DArray texture; @@ -1565,7 +1565,7 @@ void TextureArrayGLTest::generateMipmap2D() { texture.generateMipmap(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(texture.imageSize(0), Vector3i(32, 32, 32)); @@ -1575,62 +1575,62 @@ void TextureArrayGLTest::generateMipmap2D() { CORRADE_COMPARE(texture.imageSize(4), Vector3i( 2, 2, 32)); CORRADE_COMPARE(texture.imageSize(5), Vector3i( 1, 1, 32)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #endif } #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::invalidateImage1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; texture.setStorage(2, TextureFormat::RGBA8, Vector2i(32)); texture.invalidateImage(1); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif void TextureArrayGLTest::invalidateImage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif Texture2DArray texture; texture.setStorage(2, TextureFormat::RGBA8, Vector3i(32)); texture.invalidateImage(1); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::invalidateSubImage1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); Texture1DArray texture; texture.setStorage(2, TextureFormat::RGBA8, Vector2i(32)); texture.invalidateSubImage(1, Vector2i(2), Vector2i(8)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif void TextureArrayGLTest::invalidateSubImage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_array::string() + std::string(" is not supported.")); #endif Texture2DArray texture; texture.setStorage(2, TextureFormat::RGBA8, Vector3i(32)); texture.invalidateSubImage(1, Vector3i(2), Vector3i(8)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::TextureArrayGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::TextureArrayGLTest) diff --git a/src/Magnum/GL/Test/TextureArrayTest.cpp b/src/Magnum/GL/Test/TextureArrayTest.cpp index 961cba1d6..e340832ec 100644 --- a/src/Magnum/GL/Test/TextureArrayTest.cpp +++ b/src/Magnum/GL/Test/TextureArrayTest.cpp @@ -25,9 +25,9 @@ #include -#include "Magnum/TextureArray.h" +#include "Magnum/GL/TextureArray.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct TextureArrayTest: TestSuite::Tester { explicit TextureArrayTest(); @@ -66,6 +66,6 @@ void TextureArrayTest::construct2DNoCreate() { CORRADE_VERIFY(true); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::TextureArrayTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::TextureArrayTest) diff --git a/src/Magnum/GL/Test/TextureGLTest.cpp b/src/Magnum/GL/Test/TextureGLTest.cpp index 3da1d1e23..50b9cf92a 100644 --- a/src/Magnum/GL/Test/TextureGLTest.cpp +++ b/src/Magnum/GL/Test/TextureGLTest.cpp @@ -25,23 +25,23 @@ #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" +#include "Magnum/Image.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" #ifndef MAGNUM_TARGET_GLES2 -#include "Magnum/BufferImage.h" +#include "Magnum/GL/BufferImage.h" #endif -#include "Magnum/Image.h" #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -#include "Magnum/ImageFormat.h" +#include "Magnum/GL/ImageFormat.h" #endif -#include "Magnum/OpenGLTester.h" -#include "Magnum/PixelFormat.h" -#include "Magnum/Texture.h" -#include "Magnum/TextureFormat.h" +#include "Magnum/GL/OpenGLTester.h" +#include "Magnum/GL/PixelFormat.h" +#include "Magnum/GL/Texture.h" +#include "Magnum/GL/TextureFormat.h" #include "Magnum/Math/Color.h" #include "Magnum/Math/Range.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct TextureGLTest: OpenGLTester { explicit TextureGLTest(); @@ -635,11 +635,11 @@ void TextureGLTest::construct1D() { { Texture1D texture; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(texture.id() > 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif @@ -647,28 +647,28 @@ void TextureGLTest::construct2D() { { Texture2D texture; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(texture.id() > 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) void TextureGLTest::construct3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_3D::string() + std::string(" is not supported.")); #endif { Texture3D texture; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(texture.id() > 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif @@ -707,8 +707,8 @@ void TextureGLTest::wrap2D() { #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) void TextureGLTest::wrap3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_3D::string() + std::string(" is not supported.")); #endif GLuint id; @@ -731,19 +731,19 @@ void TextureGLTest::bind1D() { Texture1D texture; texture.bind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::bind(7, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(7, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif @@ -751,77 +751,77 @@ void TextureGLTest::bind2D() { Texture2D texture; texture.bind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::bind(7, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(7, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) void TextureGLTest::bind3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_3D::string() + std::string(" is not supported.")); #endif Texture3D texture; texture.bind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(15); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::bind(7, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbind(7, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #ifndef MAGNUM_TARGET_GLES void TextureGLTest::bindImage1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::shader_image_load_store::string() + std::string(" is not supported.")); Texture1D texture; texture.setStorage(1, TextureFormat::RGBA8, 32) .bindImage(2, 0, ImageAccess::ReadWrite, ImageFormat::RGBA8); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbindImage(2); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbindImages(1, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif void TextureGLTest::bindImage2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::shader_image_load_store::string() + std::string(" is not supported.")); #else if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); @@ -831,27 +831,27 @@ void TextureGLTest::bindImage2D() { texture.setStorage(1, TextureFormat::RGBA8, Vector2i{32}) .bindImage(2, 0, ImageAccess::ReadWrite, ImageFormat::RGBA8); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbindImage(2); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbindImages(1, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #endif } void TextureGLTest::bindImage3D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::shader_image_load_store::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::shader_image_load_store::string() + std::string(" is not supported.")); #else if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); @@ -861,23 +861,23 @@ void TextureGLTest::bindImage3D() { texture.setStorage(1, TextureFormat::RGBA8, {32, 32, 4}) .bindImage(2, 0, 1, ImageAccess::ReadWrite, ImageFormat::RGBA8); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); texture.bindImageLayered(3, 0, ImageAccess::ReadWrite, ImageFormat::RGBA8); AbstractTexture::unbindImage(2); AbstractTexture::unbindImage(3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES AbstractTexture::bindImages(1, {&texture, nullptr, &texture}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); AbstractTexture::unbindImages(1, 3); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #endif } #endif @@ -898,54 +898,54 @@ template void TextureGLTest::sampling1D() { .setWrapping(T::Wrapping::ClampToBorder) .setBorderColor(Color3(0.5f)) .setMaxAnisotropy(Sampler::maxMaxAnisotropy()) - .setCompareMode(Sampler::CompareMode::CompareRefToTexture) - .setCompareFunction(Sampler::CompareFunction::GreaterOrEqual); + .setCompareMode(SamplerCompareMode::CompareRefToTexture) + .setCompareFunction(SamplerCompareFunction::GreaterOrEqual); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void TextureGLTest::samplingSRGBDecode1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); Texture1D texture; texture.setSRGBDecode(false); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void TextureGLTest::samplingSwizzle1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_swizzle::string() + std::string(" is not supported.")); Texture1D texture; texture.setSwizzle<'b', 'g', 'r', '0'>(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void TextureGLTest::samplingBorderInteger1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_integer::string() + std::string(" is not supported.")); Texture1D a; - a.setWrapping(Sampler::Wrapping::ClampToBorder) + a.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Vector4i(1, 56, 78, -2)); Texture1D b; - b.setWrapping(Sampler::Wrapping::ClampToBorder) + b.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Vector4ui(35, 56, 78, 15)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void TextureGLTest::samplingDepthStencilMode1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::stencil_texturing::string() + std::string(" is not supported.")); Texture1D texture; - texture.setDepthStencilMode(Sampler::DepthStencilMode::StencilIndex); + texture.setDepthStencilMode(SamplerDepthStencilMode::StencilIndex); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif @@ -973,114 +973,114 @@ template void TextureGLTest::sampling2D() { #endif .setMaxAnisotropy(Sampler::maxMaxAnisotropy()) #ifndef MAGNUM_TARGET_GLES2 - .setCompareMode(Sampler::CompareMode::CompareRefToTexture) - .setCompareFunction(Sampler::CompareFunction::GreaterOrEqual) + .setCompareMode(SamplerCompareMode::CompareRefToTexture) + .setCompareFunction(SamplerCompareFunction::GreaterOrEqual) #endif ; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #ifndef MAGNUM_TARGET_WEBGL void TextureGLTest::samplingSRGBDecode2D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::sRGB::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::sRGB::string() + std::string(" is not supported.")); #endif - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); Texture2D texture; texture.setSRGBDecode(false); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #ifndef MAGNUM_TARGET_GLES2 void TextureGLTest::samplingSwizzle2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_swizzle::string() + std::string(" is not supported.")); #endif Texture2D texture; texture.setSwizzle<'b', 'g', 'r', '0'>(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #elif !defined(MAGNUM_TARGET_WEBGL) void TextureGLTest::samplingMaxLevel2D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::APPLE::texture_max_level::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::APPLE::texture_max_level::string() + std::string(" is not supported.")); Texture2D texture; texture.setMaxLevel(750); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void TextureGLTest::samplingCompare2D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::shadow_samplers::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::shadow_samplers::string() + std::string(" is not supported.")); Texture2D texture; - texture.setCompareMode(Sampler::CompareMode::CompareRefToTexture) - .setCompareFunction(Sampler::CompareFunction::GreaterOrEqual); + texture.setCompareMode(SamplerCompareMode::CompareRefToTexture) + .setCompareFunction(SamplerCompareFunction::GreaterOrEqual); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureGLTest::samplingBorderInteger2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_integer::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_border_clamp::string() + std::string(" is not supported.")); #endif Texture2D a; - a.setWrapping(Sampler::Wrapping::ClampToBorder) + a.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Vector4i(1, 56, 78, -2)); Texture2D b; - b.setWrapping(Sampler::Wrapping::ClampToBorder) + b.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Vector4ui(35, 56, 78, 15)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #ifndef MAGNUM_TARGET_GLES2 void TextureGLTest::samplingDepthStencilMode2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::stencil_texturing::string() + std::string(" is not supported.")); #else if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif Texture2D texture; - texture.setDepthStencilMode(Sampler::DepthStencilMode::StencilIndex); + texture.setDepthStencilMode(SamplerDepthStencilMode::StencilIndex); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) void TextureGLTest::samplingBorder2D() { - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("No required extension is supported."); Texture2D texture; - texture.setWrapping(Sampler::Wrapping::ClampToBorder) + texture.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Color3(0.5f)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif @@ -1090,8 +1090,8 @@ template void TextureGLTest::sampling3D() { "sampling3D" : "sampling3D"); #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_3D::string() + std::string(" is not supported.")); #endif Texture3D texture; @@ -1114,105 +1114,105 @@ template void TextureGLTest::sampling3D() { #endif .setMaxAnisotropy(Sampler::maxMaxAnisotropy()); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void TextureGLTest::samplingSRGBDecode3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::sRGB::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_3D::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::sRGB::string() + std::string(" is not supported.")); #endif - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_sRGB_decode::string() + std::string(" is not supported.")); Texture3D texture; texture.setSRGBDecode(false); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #ifndef MAGNUM_TARGET_GLES2 void TextureGLTest::samplingSwizzle3D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_swizzle::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_swizzle::string() + std::string(" is not supported.")); #endif Texture3D texture; texture.setSwizzle<'b', 'g', 'r', '0'>(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #else void TextureGLTest::samplingMaxLevel3D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::APPLE::texture_max_level::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_3D::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::APPLE::texture_max_level::string() + std::string(" is not supported.")); Texture3D texture; texture.setMaxLevel(750); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureGLTest::samplingBorderInteger3D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_integer::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_border_clamp::string() + std::string(" is not supported.")); #endif Texture3D a; - a.setWrapping(Sampler::Wrapping::ClampToBorder) + a.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Vector4i(1, 56, 78, -2)); Texture3D b; - b.setWrapping(Sampler::Wrapping::ClampToBorder) + b.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Vector4ui(35, 56, 78, 15)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #ifndef MAGNUM_TARGET_GLES2 void TextureGLTest::samplingDepthStencilMode3D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::stencil_texturing::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::stencil_texturing::string() + std::string(" is not supported.")); #else if(!Context::current().isVersionSupported(Version::GLES310)) CORRADE_SKIP("OpenGL ES 3.1 is not supported."); #endif Texture3D texture; - texture.setDepthStencilMode(Sampler::DepthStencilMode::StencilIndex); + texture.setDepthStencilMode(SamplerDepthStencilMode::StencilIndex); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #ifdef MAGNUM_TARGET_GLES void TextureGLTest::samplingBorder3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_3D::string() + std::string(" is not supported.")); #endif - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("No required extension is supported."); Texture3D texture; - texture.setWrapping(Sampler::Wrapping::ClampToBorder) + texture.setWrapping(SamplerWrapping::ClampToBorder) .setBorderColor(Color3(0.5f)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif #endif @@ -1222,7 +1222,7 @@ void TextureGLTest::storage1D() { Texture1D texture; texture.setStorage(5, TextureFormat::RGBA8, 32); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.imageSize(0), 32); CORRADE_COMPARE(texture.imageSize(1), 16); @@ -1231,7 +1231,7 @@ void TextureGLTest::storage1D() { CORRADE_COMPARE(texture.imageSize(4), 2); CORRADE_COMPARE(texture.imageSize(5), 0); /* not available */ - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif @@ -1245,7 +1245,7 @@ void TextureGLTest::storage2D() { #endif Vector2i(32)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES @@ -1260,21 +1260,21 @@ void TextureGLTest::storage2D() { CORRADE_COMPARE(texture.imageSize(4), Vector2i( 2)); CORRADE_COMPARE(texture.imageSize(5), Vector2i( 0)); /* not available */ - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #endif } #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) void TextureGLTest::storage3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_3D::string() + std::string(" is not supported.")); #endif Texture3D texture; texture.setStorage(5, TextureFormat::RGBA8, Vector3i(32)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES @@ -1289,7 +1289,7 @@ void TextureGLTest::storage3D() { CORRADE_COMPARE(texture.imageSize(4), Vector3i( 2)); CORRADE_COMPARE(texture.imageSize(5), Vector3i( 0)); /* not available */ - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #endif } #endif @@ -1308,12 +1308,12 @@ void TextureGLTest::image1D() { PixelFormat::RGBA, PixelType::UnsignedByte, 2, PixelStorage1DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image1D image = texture.image(0, {PixelStorage1DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), 2); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage1DData[testCaseInstanceId()].offset), @@ -1331,13 +1331,13 @@ void TextureGLTest::image1DBuffer() { PixelStorage1DData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); BufferImage1D image = texture.image(0, {PixelStorage1DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticDraw); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), 2); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage1DData[testCaseInstanceId()].offset), @@ -1363,11 +1363,11 @@ void TextureGLTest::subImage1D() { PixelFormat::RGBA, PixelType::UnsignedByte, 2, PixelStorage1DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image1D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), 4); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()), @@ -1387,12 +1387,12 @@ void TextureGLTest::subImage1DBuffer() { PixelStorage1DData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); BufferImage1D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), 4); CORRADE_COMPARE_AS(Containers::arrayCast(imageData), Containers::arrayView(SubData1DComplete), @@ -1402,20 +1402,20 @@ void TextureGLTest::subImage1DBuffer() { void TextureGLTest::subImage1DQuery() { setTestCaseDescription(PixelStorage1DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture1D texture; texture.setStorage(1, TextureFormat::RGBA8, 4) .setSubImage(0, {}, ImageView1D{PixelFormat::RGBA, PixelType::UnsignedByte, 4, SubData1DComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image1D image = texture.subImage(0, Range1Di::fromSize(1, 2), {PixelStorage1DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), 2); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage1DData[testCaseInstanceId()].offset), @@ -1426,21 +1426,21 @@ void TextureGLTest::subImage1DQuery() { void TextureGLTest::subImage1DQueryBuffer() { setTestCaseDescription(PixelStorage1DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture1D texture; texture.setStorage(1, TextureFormat::RGBA8, 4) .setSubImage(0, {}, ImageView1D{PixelFormat::RGBA, PixelType::UnsignedByte, 4, SubData1DComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); BufferImage1D image = texture.subImage(0, Range1Di::fromSize(1, 2), {PixelStorage1DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), 2); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage1DData[testCaseInstanceId()].offset), @@ -1478,8 +1478,8 @@ void TextureGLTest::image2D() { #ifdef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_WEBGL - if(PixelStorage2DData[testCaseInstanceId()].storage != PixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::unpack_subimage::string() + std::string(" is not supported.")); + if(PixelStorage2DData[testCaseInstanceId()].storage != PixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::unpack_subimage::string() + std::string(" is not supported.")); #else if(PixelStorage2DData[testCaseInstanceId()].storage != PixelStorage{}) CORRADE_SKIP("Image unpack is not supported in WebGL 1."); @@ -1498,14 +1498,14 @@ void TextureGLTest::image2D() { PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(2), PixelStorage2DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES Image2D image = texture.image(0, {PixelStorage2DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage2DData[testCaseInstanceId()].offset), @@ -1525,7 +1525,7 @@ void TextureGLTest::image2DBuffer() { PixelStorage2DData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES @@ -1534,7 +1534,7 @@ void TextureGLTest::image2DBuffer() { PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(2)); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage2DData[testCaseInstanceId()].offset), @@ -1562,8 +1562,8 @@ void TextureGLTest::subImage2D() { #ifdef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_WEBGL - if(PixelStorage2DData[testCaseInstanceId()].storage != PixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::unpack_subimage::string() + std::string(" is not supported.")); + if(PixelStorage2DData[testCaseInstanceId()].storage != PixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::unpack_subimage::string() + std::string(" is not supported.")); #else if(PixelStorage2DData[testCaseInstanceId()].storage != PixelStorage{}) CORRADE_SKIP("Image unpack is not supported in WebGL 1."); @@ -1582,13 +1582,13 @@ void TextureGLTest::subImage2D() { PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i(2), PixelStorage2DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES Image2D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(4)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()), @@ -1609,14 +1609,14 @@ void TextureGLTest::subImage2DBuffer() { PixelStorage2DData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES BufferImage2D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i(4)); CORRADE_COMPARE_AS(Containers::arrayCast(imageData), Containers::arrayView(SubData2DComplete), @@ -1629,20 +1629,20 @@ void TextureGLTest::subImage2DBuffer() { void TextureGLTest::subImage2DQuery() { setTestCaseDescription(PixelStorage2DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture2D texture; texture.setStorage(1, TextureFormat::RGBA8, Vector2i{4}) .setSubImage(0, {}, ImageView2D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i{4}, SubData2DComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image2D image = texture.subImage(0, Range2Di::fromSize(Vector2i{1}, Vector2i{2}), {PixelStorage2DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{2}); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage2DData[testCaseInstanceId()].offset), @@ -1653,21 +1653,21 @@ void TextureGLTest::subImage2DQuery() { void TextureGLTest::subImage2DQueryBuffer() { setTestCaseDescription(PixelStorage2DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture2D texture; texture.setStorage(1, TextureFormat::RGBA8, Vector2i{4}) .setSubImage(0, {}, ImageView2D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector2i{4}, SubData2DComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); BufferImage2D image = texture.subImage(0, Range2Di::fromSize(Vector2i{1}, Vector2i{2}), {PixelStorage2DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{2}); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage2DData[testCaseInstanceId()].offset), @@ -1680,16 +1680,16 @@ void TextureGLTest::compressedImage2D() { setTestCaseDescription(CompressedPixelStorage2DData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif Texture2D texture; @@ -1700,12 +1700,12 @@ void TextureGLTest::compressedImage2D() { CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, CompressedPixelStorage2DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CompressedImage2D image = texture.compressedImage(0, {CompressedPixelStorage2DData[testCaseInstanceId()].storage}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{4}); @@ -1720,16 +1720,16 @@ void TextureGLTest::compressedImage2DBuffer() { setTestCaseDescription(CompressedPixelStorage2DData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif Texture2D texture; @@ -1741,13 +1741,13 @@ void TextureGLTest::compressedImage2DBuffer() { CompressedPixelStorage2DData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CompressedBufferImage2D image = texture.compressedImage(0, {CompressedPixelStorage2DData[testCaseInstanceId()].storage}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{4}); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), @@ -1778,16 +1778,16 @@ void TextureGLTest::compressedSubImage2D() { setTestCaseDescription(CompressedPixelStorage2DData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif Texture2D texture; @@ -1800,12 +1800,12 @@ void TextureGLTest::compressedSubImage2D() { CompressedPixelFormat::RGBAS3tcDxt3, Vector2i{4}, CompressedPixelStorage2DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CompressedImage2D image = texture.compressedImage(0, {}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector2i{12, 4})); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()), @@ -1819,16 +1819,16 @@ void TextureGLTest::compressedSubImage2DBuffer() { setTestCaseDescription(CompressedPixelStorage2DData[testCaseInstanceId()].name); #ifndef MAGNUM_TARGET_WEBGL - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::WEBGL::compressed_texture_s3tc::string() + std::string(" is not supported.")); #endif #ifndef MAGNUM_TARGET_GLES - if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); #endif Texture2D texture; @@ -1842,13 +1842,13 @@ void TextureGLTest::compressedSubImage2DBuffer() { CompressedPixelStorage2DData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #ifndef MAGNUM_TARGET_GLES CompressedBufferImage2D image = texture.compressedImage(0, {}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector2i{12, 4})); CORRADE_COMPARE_AS(Containers::arrayCast(imageData), @@ -1862,25 +1862,25 @@ void TextureGLTest::compressedSubImage2DBuffer() { void TextureGLTest::compressedSubImage2DQuery() { setTestCaseDescription(CompressedPixelStorage2DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); - if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); - if(CompressedPixelStorage2DData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::internalformat_query2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorage2DData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::internalformat_query2::string() + std::string(" is not supported.")); Texture2D texture; texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, {12, 4}) .setCompressedSubImage(0, {}, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 4}, CompressedSubData2DComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedImage2D image = texture.compressedSubImage(0, Range2Di::fromSize({4, 0}, Vector2i{4}), {CompressedPixelStorage2DData[testCaseInstanceId()].storage}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{4}); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), @@ -1891,26 +1891,26 @@ void TextureGLTest::compressedSubImage2DQuery() { void TextureGLTest::compressedSubImage2DQueryBuffer() { setTestCaseDescription(CompressedPixelStorage2DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); - if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); - if(CompressedPixelStorage2DData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::internalformat_query2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::texture_compression_s3tc::string() + std::string(" is not supported.")); + if(CompressedPixelStorage2DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorage2DData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::internalformat_query2::string() + std::string(" is not supported.")); Texture2D texture; texture.setStorage(1, TextureFormat::CompressedRGBAS3tcDxt3, {12, 4}) .setCompressedSubImage(0, {}, CompressedImageView2D{CompressedPixelFormat::RGBAS3tcDxt3, {12, 4}, CompressedSubData2DComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedBufferImage2D image = texture.compressedSubImage(0, Range2Di::fromSize({4, 0}, Vector2i{4}), {CompressedPixelStorage2DData[testCaseInstanceId()].storage}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector2i{4}); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedPixelStorage2DData[testCaseInstanceId()].offset), @@ -1924,10 +1924,10 @@ void TextureGLTest::image3D() { setTestCaseDescription(PixelStorage3DData[testCaseInstanceId()].name); #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); - if(PixelStorage3DData[testCaseInstanceId()].storage != PixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::unpack_subimage::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_3D::string() + std::string(" is not supported.")); + if(PixelStorage3DData[testCaseInstanceId()].storage != PixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::unpack_subimage::string() + std::string(" is not supported.")); #endif Texture3D texture; @@ -1936,14 +1936,14 @@ void TextureGLTest::image3D() { PixelFormat::RGBA, PixelType::UnsignedByte, Vector3i(2), PixelStorage3DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES Image3D image = texture.image(0, {PixelStorage3DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage3DData[testCaseInstanceId()].offset), @@ -1963,7 +1963,7 @@ void TextureGLTest::image3DBuffer() { PixelStorage3DData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES @@ -1972,7 +1972,7 @@ void TextureGLTest::image3DBuffer() { BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(2)); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage3DData[testCaseInstanceId()].offset), @@ -2014,10 +2014,10 @@ void TextureGLTest::subImage3D() { setTestCaseDescription(PixelStorage3DData[testCaseInstanceId()].name); #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); - if(PixelStorage3DData[testCaseInstanceId()].storage != PixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::unpack_subimage::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_3D::string() + std::string(" is not supported.")); + if(PixelStorage3DData[testCaseInstanceId()].storage != PixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::unpack_subimage::string() + std::string(" is not supported.")); #endif Texture3D texture; @@ -2027,13 +2027,13 @@ void TextureGLTest::subImage3D() { PixelFormat::RGBA, PixelType::UnsignedByte, Vector3i(2), PixelStorage3DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES Image3D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(4)); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()), @@ -2055,14 +2055,14 @@ void TextureGLTest::subImage3DBuffer() { PixelStorage3DData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES BufferImage3D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i(4)); CORRADE_COMPARE_AS(Containers::arrayCast(imageData), @@ -2076,20 +2076,20 @@ void TextureGLTest::subImage3DBuffer() { void TextureGLTest::subImage3DQuery() { setTestCaseDescription(PixelStorage3DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture3D texture; texture.setStorage(1, TextureFormat::RGBA8, Vector3i{4}) .setSubImage(0, {}, ImageView3D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector3i{4}, SubData3DComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Image3D image = texture.subImage(0, Range3Di::fromSize(Vector3i{1}, Vector3i{2}), {PixelStorage3DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{2}); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(PixelStorage3DData[testCaseInstanceId()].offset), @@ -2100,21 +2100,21 @@ void TextureGLTest::subImage3DQuery() { void TextureGLTest::subImage3DQueryBuffer() { setTestCaseDescription(PixelStorage3DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); Texture3D texture; texture.setStorage(1, TextureFormat::RGBA8, Vector3i{4}) .setSubImage(0, {}, ImageView3D{PixelFormat::RGBA, PixelType::UnsignedByte, Vector3i{4}, SubData3DComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); BufferImage3D image = texture.subImage(0, Range3Di::fromSize(Vector3i{1}, Vector3i{2}), {PixelStorage3DData[testCaseInstanceId()].storage, PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{2}); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(PixelStorage3DData[testCaseInstanceId()].offset), @@ -2130,10 +2130,10 @@ 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()) - CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); - if(CompressedPixelStorage3DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); + if(CompressedPixelStorage3DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); Texture3D texture; texture.setCompressedImage(0, CompressedImageView3D{ @@ -2141,11 +2141,11 @@ void TextureGLTest::compressedImage3D() { CompressedPixelFormat::RGBABptcUnorm, Vector3i{4}, CompressedPixelStorage3DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedImage3D image = texture.compressedImage(0, {CompressedPixelStorage3DData[testCaseInstanceId()].storage}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{4}); CORRADE_COMPARE_AS(Containers::arrayCast(image.data()).suffix(CompressedPixelStorage3DData[testCaseInstanceId()].offset), @@ -2162,10 +2162,10 @@ 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()) - CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); - if(CompressedPixelStorage3DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); + if(CompressedPixelStorage3DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); Texture3D texture; texture.setCompressedImage(0, CompressedBufferImage3D{ @@ -2174,12 +2174,12 @@ void TextureGLTest::compressedImage3DBuffer() { CompressedPixelStorage3DData[testCaseInstanceId()].dataSparse, BufferUsage::StaticDraw}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedBufferImage3D image = texture.compressedImage(0, {CompressedPixelStorage3DData[testCaseInstanceId()].storage}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{4}); CORRADE_COMPARE_AS(Containers::arrayCast(imageData).suffix(CompressedPixelStorage3DData[testCaseInstanceId()].offset), @@ -2242,10 +2242,10 @@ 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()) - CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); - if(CompressedPixelStorage3DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); + if(CompressedPixelStorage3DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); Texture3D texture; texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBABptcUnorm, @@ -2254,11 +2254,11 @@ void TextureGLTest::compressedSubImage3D() { CompressedPixelFormat::RGBABptcUnorm, Vector3i{4}, CompressedPixelStorage3DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedImage3D image = texture.compressedImage(0, {}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{12, 4, 4})); @@ -2281,10 +2281,10 @@ 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()) - CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); - if(CompressedPixelStorage3DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); + if(CompressedPixelStorage3DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); Texture3D texture; texture.setCompressedImage(0, CompressedImageView3D{CompressedPixelFormat::RGBABptcUnorm, @@ -2293,12 +2293,12 @@ void TextureGLTest::compressedSubImage3DBuffer() { CompressedPixelFormat::RGBABptcUnorm, Vector3i{4}, CompressedPixelStorage3DData[testCaseInstanceId()].dataSparse}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedBufferImage3D image = texture.compressedImage(0, {}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{12, 4, 4})); @@ -2318,25 +2318,25 @@ void TextureGLTest::compressedSubImage3DBuffer() { void TextureGLTest::compressedSubImage3DQuery() { setTestCaseDescription(CompressedPixelStorage3DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); - if(CompressedPixelStorage3DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); - if(CompressedPixelStorage3DData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::internalformat_query2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); + if(CompressedPixelStorage3DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorage3DData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::internalformat_query2::string() + std::string(" is not supported.")); Texture3D texture; texture.setStorage(1, TextureFormat::CompressedRGBABptcUnorm, {12, 4, 4}) .setCompressedSubImage(0, {}, CompressedImageView3D{CompressedPixelFormat::RGBABptcUnorm, {12, 4, 4}, CompressedSubData3DComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 0}, Vector3i{4}), {CompressedPixelStorage3DData[testCaseInstanceId()].storage}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), (Vector3i{4})); @@ -2353,26 +2353,26 @@ void TextureGLTest::compressedSubImage3DQuery() { void TextureGLTest::compressedSubImage3DQueryBuffer() { setTestCaseDescription(CompressedPixelStorage3DData[testCaseInstanceId()].name); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); - if(CompressedPixelStorage3DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); - if(CompressedPixelStorage3DData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::internalformat_query2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::get_texture_sub_image::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::texture_compression_bptc::string() + std::string(" is not supported.")); + if(CompressedPixelStorage3DData[testCaseInstanceId()].storage != CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::compressed_texture_pixel_storage::string() + std::string(" is not supported.")); + if(CompressedPixelStorage3DData[testCaseInstanceId()].storage == CompressedPixelStorage{} && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::internalformat_query2::string() + std::string(" is not supported.")); Texture3D texture; texture.setStorage(1, TextureFormat::CompressedRGBABptcUnorm, {12, 4, 4}) .setCompressedSubImage(0, {}, CompressedImageView3D{CompressedPixelFormat::RGBABptcUnorm, {12, 4, 4}, CompressedSubData3DComplete}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CompressedBufferImage3D image = texture.compressedSubImage(0, Range3Di::fromSize({4, 0, 0}, Vector3i{4}), {CompressedPixelStorage3DData[testCaseInstanceId()].storage}, BufferUsage::StaticRead); const auto imageData = image.buffer().data(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(image.size(), Vector3i{4}); @@ -2390,8 +2390,8 @@ void TextureGLTest::compressedSubImage3DQueryBuffer() { #ifndef MAGNUM_TARGET_GLES void TextureGLTest::generateMipmap1D() { - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not supported.")); Texture1D texture; texture.setImage(0, TextureFormat::RGBA8, @@ -2402,7 +2402,7 @@ void TextureGLTest::generateMipmap1D() { texture.generateMipmap(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(texture.imageSize(0), 32); CORRADE_COMPARE(texture.imageSize(1), 16); @@ -2411,14 +2411,14 @@ void TextureGLTest::generateMipmap1D() { CORRADE_COMPARE(texture.imageSize(4), 2); CORRADE_COMPARE(texture.imageSize(5), 1); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif void TextureGLTest::generateMipmap2D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not supported.")); #endif Texture2D texture; @@ -2438,7 +2438,7 @@ void TextureGLTest::generateMipmap2D() { texture.generateMipmap(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES @@ -2449,18 +2449,18 @@ void TextureGLTest::generateMipmap2D() { CORRADE_COMPARE(texture.imageSize(4), Vector2i( 2)); CORRADE_COMPARE(texture.imageSize(5), Vector2i( 1)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #endif } #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) void TextureGLTest::generateMipmap3D() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::framebuffer_object::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::framebuffer_object::string() + std::string(" is not supported.")); #elif defined(MAGNUM_TARGET_GLES2) - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_3D::string() + std::string(" is not supported.")); #endif Texture3D texture; @@ -2475,7 +2475,7 @@ void TextureGLTest::generateMipmap3D() { texture.generateMipmap(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); /** @todo How to test this on ES? */ #ifndef MAGNUM_TARGET_GLES @@ -2486,7 +2486,7 @@ void TextureGLTest::generateMipmap3D() { CORRADE_COMPARE(texture.imageSize(4), Vector3i( 2)); CORRADE_COMPARE(texture.imageSize(5), Vector3i( 1)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); #endif } #endif @@ -2497,7 +2497,7 @@ void TextureGLTest::invalidateImage1D() { texture.setStorage(2, TextureFormat::RGBA8, 32); texture.invalidateImage(1); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif @@ -2512,21 +2512,21 @@ void TextureGLTest::invalidateImage2D() { Vector2i(32)); texture.invalidateImage(1); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) void TextureGLTest::invalidateImage3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_3D::string() + std::string(" is not supported.")); #endif Texture3D texture; texture.setStorage(2, TextureFormat::RGBA8, Vector3i(32)); texture.invalidateImage(1); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif @@ -2536,7 +2536,7 @@ void TextureGLTest::invalidateSubImage1D() { texture.setStorage(2, TextureFormat::RGBA8, 32); texture.invalidateSubImage(1, 2, 8); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif @@ -2551,28 +2551,28 @@ void TextureGLTest::invalidateSubImage2D() { Vector2i(32)); texture.invalidateSubImage(1, Vector2i(2), Vector2i(8)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) void TextureGLTest::invalidateSubImage3D() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::OES::texture_3D::string() + std::string(" is not supported.")); #endif Texture3D texture; texture.setStorage(2, TextureFormat::RGBA8, Vector3i(32)); texture.invalidateSubImage(1, Vector3i(2), Vector3i(8)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif void TextureGLTest::srgbStorage() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::sRGB::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::sRGB::string() + std::string(" is not supported.")); #endif Texture2D texture; @@ -2590,7 +2590,7 @@ void TextureGLTest::srgbStorage() { #endif , PixelType::UnsignedByte, Vector2i{32}, nullptr}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); texture.setStorage(1, #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) @@ -2600,13 +2600,13 @@ void TextureGLTest::srgbStorage() { #endif Vector2i{32}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void TextureGLTest::srgbAlphaStorage() { #ifdef MAGNUM_TARGET_GLES2 - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::sRGB::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::sRGB::string() + std::string(" is not supported.")); #endif Texture2D texture; @@ -2624,7 +2624,7 @@ void TextureGLTest::srgbAlphaStorage() { #endif , PixelType::UnsignedByte, Vector2i{32}, nullptr}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); texture.setStorage(1, #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) @@ -2634,9 +2634,9 @@ void TextureGLTest::srgbAlphaStorage() { #endif Vector2i{32}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::TextureGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::TextureGLTest) diff --git a/src/Magnum/GL/Test/TextureTest.cpp b/src/Magnum/GL/Test/TextureTest.cpp index 1276347e5..a16d1dac9 100644 --- a/src/Magnum/GL/Test/TextureTest.cpp +++ b/src/Magnum/GL/Test/TextureTest.cpp @@ -25,9 +25,9 @@ #include -#include "Magnum/Texture.h" +#include "Magnum/GL/Texture.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct TextureTest: TestSuite::Tester { explicit TextureTest(); @@ -84,6 +84,6 @@ void TextureTest::construct3DNoCreate() { } #endif -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::TextureTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::TextureTest) diff --git a/src/Magnum/GL/Test/TimeQueryGLTest.cpp b/src/Magnum/GL/Test/TimeQueryGLTest.cpp index e4130c081..8018bf4c1 100644 --- a/src/Magnum/GL/Test/TimeQueryGLTest.cpp +++ b/src/Magnum/GL/Test/TimeQueryGLTest.cpp @@ -25,12 +25,12 @@ #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/OpenGLTester.h" -#include "Magnum/TimeQuery.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/OpenGLTester.h" +#include "Magnum/GL/TimeQuery.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct TimeQueryGLTest: OpenGLTester { explicit TimeQueryGLTest(); @@ -50,11 +50,11 @@ TimeQueryGLTest::TimeQueryGLTest() { void TimeQueryGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::timer_query::string() + std::string(" is not available")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::timer_query::string() + std::string(" is not available")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::disjoint_timer_query::string() + std::string(" is not available")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::disjoint_timer_query::string() + std::string(" is not available")); #endif GLuint id; @@ -81,11 +81,11 @@ void TimeQueryGLTest::wrap() { void TimeQueryGLTest::queryTime() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::timer_query::string() + std::string(" is not available")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::timer_query::string() + std::string(" is not available")); #else - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::disjoint_timer_query::string() + std::string(" is not available")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::disjoint_timer_query::string() + std::string(" is not available")); #endif TimeQuery q1{TimeQuery::Target::TimeElapsed}; @@ -93,7 +93,7 @@ void TimeQueryGLTest::queryTime() { q1.end(); const auto result1 = q1.result(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); TimeQuery q2{TimeQuery::Target::TimeElapsed}; q2.begin(); @@ -102,14 +102,14 @@ void TimeQueryGLTest::queryTime() { q2.end(); const auto result2 = q2.result(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_AS(result2, result1, TestSuite::Compare::GreaterOrEqual); } void TimeQueryGLTest::queryTimestamp() { #ifdef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::EXT::disjoint_timer_query::string() + std::string(" is not available")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::EXT::disjoint_timer_query::string() + std::string(" is not available")); #endif TimeQuery q1{TimeQuery::Target::Timestamp}, @@ -129,11 +129,11 @@ void TimeQueryGLTest::queryTimestamp() { const auto result1 = q1.result(); const auto result2 = q2.result(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_AS(result2, result1, TestSuite::Compare::GreaterOrEqual); CORRADE_COMPARE_AS(result2 - result1, result, TestSuite::Compare::GreaterOrEqual); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::TimeQueryGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::TimeQueryGLTest) diff --git a/src/Magnum/GL/Test/TimeQueryTest.cpp b/src/Magnum/GL/Test/TimeQueryTest.cpp index 2bbebd56d..b3452202f 100644 --- a/src/Magnum/GL/Test/TimeQueryTest.cpp +++ b/src/Magnum/GL/Test/TimeQueryTest.cpp @@ -25,9 +25,9 @@ #include -#include "Magnum/TimeQuery.h" +#include "Magnum/GL/TimeQuery.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct TimeQueryTest: TestSuite::Tester { explicit TimeQueryTest(); @@ -48,6 +48,6 @@ void TimeQueryTest::constructNoCreate() { CORRADE_VERIFY(true); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::TimeQueryTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::TimeQueryTest) diff --git a/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp b/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp index 4c0d14305..39ab69c73 100644 --- a/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp +++ b/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp @@ -23,24 +23,24 @@ DEALINGS IN THE SOFTWARE. */ -#include "Magnum/AbstractShaderProgram.h" -#include "Magnum/Buffer.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/Framebuffer.h" #include "Magnum/Image.h" -#include "Magnum/Mesh.h" -#include "Magnum/OpenGLTester.h" -#include "Magnum/PixelFormat.h" -#include "Magnum/PrimitiveQuery.h" -#include "Magnum/SampleQuery.h" -#include "Magnum/Renderbuffer.h" -#include "Magnum/RenderbufferFormat.h" -#include "Magnum/Shader.h" -#include "Magnum/TransformFeedback.h" +#include "Magnum/GL/AbstractShaderProgram.h" +#include "Magnum/GL/Buffer.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Framebuffer.h" +#include "Magnum/GL/Mesh.h" +#include "Magnum/GL/OpenGLTester.h" +#include "Magnum/GL/PixelFormat.h" +#include "Magnum/GL/PrimitiveQuery.h" +#include "Magnum/GL/SampleQuery.h" +#include "Magnum/GL/Renderbuffer.h" +#include "Magnum/GL/RenderbufferFormat.h" +#include "Magnum/GL/Shader.h" +#include "Magnum/GL/TransformFeedback.h" #include "Magnum/Math/Vector2.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct TransformFeedbackGLTest: OpenGLTester { explicit TransformFeedbackGLTest(); @@ -111,18 +111,18 @@ TransformFeedbackGLTest::TransformFeedbackGLTest() { void TransformFeedbackGLTest::construct() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif { TransformFeedback feedback; - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(feedback.id() > 0); } - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } void TransformFeedbackGLTest::constructCopy() { @@ -132,14 +132,14 @@ void TransformFeedbackGLTest::constructCopy() { void TransformFeedbackGLTest::constructMove() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif TransformFeedback a; const Int id = a.id(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(id > 0); TransformFeedback b{std::move(a)}; @@ -151,7 +151,7 @@ void TransformFeedbackGLTest::constructMove() { const Int cId = c.id(); c = std::move(b); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(cId > 0); CORRADE_COMPARE(b.id(), cId); CORRADE_COMPARE(c.id(), id); @@ -159,8 +159,8 @@ void TransformFeedbackGLTest::constructMove() { void TransformFeedbackGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif GLuint id; @@ -180,11 +180,11 @@ void TransformFeedbackGLTest::wrap() { void TransformFeedbackGLTest::label() { /* No-Op version is tested in AbstractObjectGLTest */ #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif - if(!Context::current().isExtensionSupported() && - !Context::current().isExtensionSupported()) + if(!Context::current().isExtensionSupported() && + !Context::current().isExtensionSupported()) CORRADE_SKIP("Required extension is not available"); TransformFeedback feedback; @@ -193,23 +193,23 @@ void TransformFeedbackGLTest::label() { { #ifdef MAGNUM_TARGET_GLES CORRADE_EXPECT_FAIL_IF(Context::current().detectedDriver() & Context::DetectedDriver::NVidia && - !Context::current().isExtensionSupported(), + !Context::current().isExtensionSupported(), "NVidia 387.34 ES3.2 complains that GL_TRANSFORM_FEEDBACK can't be used with glGetObjectLabelEXT()."); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } feedback.setLabel("MyXfb"); { #ifdef MAGNUM_TARGET_GLES CORRADE_EXPECT_FAIL_IF(Context::current().detectedDriver() & Context::DetectedDriver::NVidia && - !Context::current().isExtensionSupported(), + !Context::current().isExtensionSupported(), "NVidia 387.34 ES3.2 complains that GL_TRANSFORM_FEEDBACK can't be used with glGetObjectLabelEXT()."); #endif - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(feedback.label(), "MyXfb"); - MAGNUM_VERIFY_NO_ERROR(); /* Check for errors again to flush the error state */ + MAGNUM_VERIFY_NO_GL_ERROR(); /* Check for errors again to flush the error state */ } } @@ -264,8 +264,8 @@ XfbShader::XfbShader() { void TransformFeedbackGLTest::attachBase() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif /* Bind some FB to avoid errors on contexts w/o default FB */ @@ -290,14 +290,14 @@ void TransformFeedbackGLTest::attachBase() { TransformFeedback feedback; feedback.attachBuffer(0, output); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Renderer::enable(Renderer::Feature::RasterizerDiscard); feedback.begin(shader, TransformFeedback::PrimitiveMode::Points); mesh.draw(shader); feedback.end(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); auto data = Containers::arrayCast(output.mapRead(0, 2*sizeof(Vector2))); CORRADE_COMPARE(data[0], Vector2(1.0f, -1.0f)); @@ -307,8 +307,8 @@ void TransformFeedbackGLTest::attachBase() { void TransformFeedbackGLTest::attachRange() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif /* Bind some FB to avoid errors on contexts w/o default FB */ @@ -333,14 +333,14 @@ void TransformFeedbackGLTest::attachRange() { TransformFeedback feedback; feedback.attachBuffer(0, output, 256, 2*sizeof(Vector2)); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Renderer::enable(Renderer::Feature::RasterizerDiscard); feedback.begin(shader, TransformFeedback::PrimitiveMode::Points); mesh.draw(shader); feedback.end(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); auto data = Containers::arrayCast(output.mapRead(256, 2*sizeof(Vector2))); CORRADE_COMPARE(data[0], Vector2(1.0f, -1.0f)); @@ -396,8 +396,8 @@ XfbMultiShader::XfbMultiShader() { void TransformFeedbackGLTest::attachBases() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif /* Bind some FB to avoid errors on contexts w/o default FB */ @@ -423,14 +423,14 @@ void TransformFeedbackGLTest::attachBases() { TransformFeedback feedback; feedback.attachBuffers(0, {&output1, &output2}); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Renderer::enable(Renderer::Feature::RasterizerDiscard); feedback.begin(shader, TransformFeedback::PrimitiveMode::Points); mesh.draw(shader); feedback.end(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); auto data1 = Containers::arrayCast(output1.mapRead(0, 2*sizeof(Vector2))); CORRADE_COMPARE(data1[0], Vector2(1.0f, -1.0f)); @@ -445,8 +445,8 @@ void TransformFeedbackGLTest::attachBases() { void TransformFeedbackGLTest::attachRanges() { #ifndef MAGNUM_TARGET_GLES - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::transform_feedback2::string() + std::string(" is not supported.")); #endif /* Bind some FB to avoid errors on contexts w/o default FB */ @@ -475,14 +475,14 @@ void TransformFeedbackGLTest::attachRanges() { std::make_tuple(&output2, 512, 2*sizeof(Float)) }); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Renderer::enable(Renderer::Feature::RasterizerDiscard); feedback.begin(shader, TransformFeedback::PrimitiveMode::Points); mesh.draw(shader); feedback.end(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); auto data1 = Containers::arrayCast(output1.mapRead(256, 2*sizeof(Vector2))); CORRADE_COMPARE(data1[0], Vector2(1.0f, -1.0f)); @@ -498,8 +498,8 @@ void TransformFeedbackGLTest::attachRanges() { #ifndef MAGNUM_TARGET_GLES void TransformFeedbackGLTest::interleaved() { /* ARB_transform_feedback3 needed for gl_SkipComponents1 */ - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::transform_feedback3::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::transform_feedback3::string() + std::string(" is not supported.")); /* Bind some FB to avoid errors on contexts w/o default FB */ Renderbuffer color; @@ -550,14 +550,14 @@ void TransformFeedbackGLTest::interleaved() { TransformFeedback feedback; feedback.attachBuffer(0, output); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); Renderer::enable(Renderer::Feature::RasterizerDiscard); feedback.begin(shader, TransformFeedback::PrimitiveMode::Points); mesh.draw(shader); feedback.end(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); auto data = Containers::arrayCast(output.mapRead(0, 4*sizeof(Vector2))); CORRADE_COMPARE(data[0], Vector2(1.0f, -1.0f)); @@ -571,12 +571,12 @@ void TransformFeedbackGLTest::draw() { setTestCaseDescription(DrawData[testCaseInstanceId()].name); /* ARB_transform_feedback2 needed as base, other optional */ - if(!Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::transform_feedback2::string() + std::string(" is not supported.")); - if(DrawData[testCaseInstanceId()].stream && (!Context::current().isExtensionSupported() || TransformFeedback::maxVertexStreams() < 2)) - CORRADE_SKIP(Extensions::GL::ARB::transform_feedback3::string() + std::string(" is not supported well enough.")); - if(DrawData[testCaseInstanceId()].instances && !Context::current().isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::ARB::transform_feedback_instanced::string() + std::string(" is not supported.")); + if(!Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::transform_feedback2::string() + std::string(" is not supported.")); + if(DrawData[testCaseInstanceId()].stream && (!Context::current().isExtensionSupported() || TransformFeedback::maxVertexStreams() < 2)) + CORRADE_SKIP(Extensions::ARB::transform_feedback3::string() + std::string(" is not supported well enough.")); + if(DrawData[testCaseInstanceId()].instances && !Context::current().isExtensionSupported()) + CORRADE_SKIP(Extensions::ARB::transform_feedback_instanced::string() + std::string(" is not supported.")); /* Bind some FB to avoid errors on contexts w/o default FB */ Renderbuffer color; @@ -630,7 +630,7 @@ void TransformFeedbackGLTest::draw() { TransformFeedback feedback; feedback.attachBuffer(0, outputBuffer); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); PrimitiveQuery queryStream0{PrimitiveQuery::Target::TransformFeedbackPrimitivesWritten}, queryStreamN{PrimitiveQuery::Target::TransformFeedbackPrimitivesWritten}; @@ -649,7 +649,7 @@ void TransformFeedbackGLTest::draw() { queryStreamN.end(); queryStream0.end(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(queryStream0.result(), DrawData[testCaseInstanceId()].countStream0); if(DrawData[testCaseInstanceId()].stream) @@ -694,15 +694,15 @@ void TransformFeedbackGLTest::draw() { outputMesh.draw(drawShader, feedback, DrawData[testCaseInstanceId()].stream); q.end(); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE(q.result(), DrawData[testCaseInstanceId()].countDraw); CORRADE_COMPARE(fb.read({{}, Vector2i{1}}, {PixelFormat::RGBA, PixelType::UnsignedByte}).data()[0], 153); - MAGNUM_VERIFY_NO_ERROR(); + MAGNUM_VERIFY_NO_GL_ERROR(); } #endif -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::TransformFeedbackGLTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::TransformFeedbackGLTest) diff --git a/src/Magnum/GL/Test/TransformFeedbackTest.cpp b/src/Magnum/GL/Test/TransformFeedbackTest.cpp index 3cadc7b5e..d61879e74 100644 --- a/src/Magnum/GL/Test/TransformFeedbackTest.cpp +++ b/src/Magnum/GL/Test/TransformFeedbackTest.cpp @@ -25,9 +25,9 @@ #include -#include "Magnum/TransformFeedback.h" +#include "Magnum/GL/TransformFeedback.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct TransformFeedbackTest: TestSuite::Tester { explicit TransformFeedbackTest(); @@ -48,6 +48,6 @@ void TransformFeedbackTest::constructNoCreate() { CORRADE_VERIFY(true); } -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::TransformFeedbackTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::TransformFeedbackTest) diff --git a/src/Magnum/GL/Test/VersionTest.cpp b/src/Magnum/GL/Test/VersionTest.cpp index f33558d2d..21d67a58d 100644 --- a/src/Magnum/GL/Test/VersionTest.cpp +++ b/src/Magnum/GL/Test/VersionTest.cpp @@ -26,9 +26,9 @@ #include #include -#include "Magnum/Version.h" +#include "Magnum/GL/Version.h" -namespace Magnum { namespace Test { +namespace Magnum { namespace GL { namespace Test { struct VersionTest: TestSuite::Tester { explicit VersionTest(); @@ -126,6 +126,6 @@ void VersionTest::debugES() { } #endif -}} +}}} -CORRADE_TEST_MAIN(Magnum::Test::VersionTest) +CORRADE_TEST_MAIN(Magnum::GL::Test::VersionTest)