diff --git a/src/Magnum/Buffer.h b/src/Magnum/Buffer.h index 72bfd3715..b85f3fbaf 100644 --- a/src/Magnum/Buffer.h +++ b/src/Magnum/Buffer.h @@ -863,6 +863,9 @@ class MAGNUM_EXPORT Buffer: public AbstractObject { * The constructed instance is equivalent to moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. + * + * This function can be safely used for constructing (and later + * destructing) objects even without any OpenGL context being active. * @see @ref Buffer(TargetHint), @ref wrap() */ explicit Buffer(NoCreateT) noexcept; diff --git a/src/Magnum/BufferImage.h b/src/Magnum/BufferImage.h index 42c58a40f..59876811c 100644 --- a/src/Magnum/BufferImage.h +++ b/src/Magnum/BufferImage.h @@ -135,6 +135,9 @@ template class BufferImage { * @ref PixelFormat::RGBA and @ref PixelType::UnsignedByte. Useful in * cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. + * + * This function can be safely used for constructing (and later + * destructing) objects even without any OpenGL context being active. * @see @ref BufferImage(), @ref Buffer::wrap() */ explicit BufferImage(NoCreateT) noexcept; diff --git a/src/Magnum/BufferTexture.h b/src/Magnum/BufferTexture.h index 6c324f5a4..4e274e388 100644 --- a/src/Magnum/BufferTexture.h +++ b/src/Magnum/BufferTexture.h @@ -148,6 +148,9 @@ class MAGNUM_EXPORT BufferTexture: public AbstractTexture { * The constructed instance is equivalent to moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. + * + * This function can be safely used for constructing (and later + * destructing) objects even without any OpenGL context being active. * @see @ref BufferTexture(), @ref wrap() */ explicit BufferTexture(NoCreateT) noexcept: diff --git a/src/Magnum/CubeMapTexture.h b/src/Magnum/CubeMapTexture.h index 9f89993a6..2881eeeac 100644 --- a/src/Magnum/CubeMapTexture.h +++ b/src/Magnum/CubeMapTexture.h @@ -174,6 +174,9 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * The constructed instance is equivalent to moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. + * + * This function can be safely used for constructing (and later + * destructing) objects even without any OpenGL context being active. * @see @ref CubeMapTexture(), @ref wrap() */ explicit CubeMapTexture(NoCreateT) noexcept: AbstractTexture{NoCreate, GL_TEXTURE_CUBE_MAP} {} diff --git a/src/Magnum/CubeMapTextureArray.h b/src/Magnum/CubeMapTextureArray.h index fecbb4b19..0863bcc6c 100644 --- a/src/Magnum/CubeMapTextureArray.h +++ b/src/Magnum/CubeMapTextureArray.h @@ -164,6 +164,9 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture { * The constructed instance is equivalent to moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. + * + * This function can be safely used for constructing (and later + * destructing) objects even without any OpenGL context being active. * @see @ref CubeMapTextureArray(), @ref wrap() */ explicit CubeMapTextureArray(NoCreateT) noexcept: diff --git a/src/Magnum/Framebuffer.h b/src/Magnum/Framebuffer.h index d6fad0949..2f9ab83a7 100644 --- a/src/Magnum/Framebuffer.h +++ b/src/Magnum/Framebuffer.h @@ -353,6 +353,9 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje * The constructed instance is equivalent to moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. + * + * This function can be safely used for constructing (and later + * destructing) objects even without any OpenGL context being active. * @see @ref Framebuffer(const Range2Di&), @ref wrap() */ explicit Framebuffer(NoCreateT) noexcept { _id = 0; } diff --git a/src/Magnum/Mesh.h b/src/Magnum/Mesh.h index f20c3e342..b8abc8aca 100644 --- a/src/Magnum/Mesh.h +++ b/src/Magnum/Mesh.h @@ -474,6 +474,9 @@ class MAGNUM_EXPORT Mesh: public AbstractObject { * The constructed instance is equivalent to moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. + * + * This function can be safely used for constructing (and later + * destructing) objects even without any OpenGL context being active. * @see @ref Mesh(MeshPrimitive), @ref wrap() */ explicit Mesh(NoCreateT) noexcept; diff --git a/src/Magnum/MultisampleTexture.h b/src/Magnum/MultisampleTexture.h index 7d03446ca..b750b60c6 100644 --- a/src/Magnum/MultisampleTexture.h +++ b/src/Magnum/MultisampleTexture.h @@ -156,6 +156,9 @@ template class MultisampleTexture: public AbstractTextur * The constructed instance is equivalent to moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. + * + * This function can be safely used for constructing (and later + * destructing) objects even without any OpenGL context being active. * @see @ref MultisampleTexture(), @ref wrap() */ explicit MultisampleTexture(NoCreateT) noexcept: AbstractTexture{NoCreate, Implementation::multisampleTextureTarget()} {} diff --git a/src/Magnum/PrimitiveQuery.h b/src/Magnum/PrimitiveQuery.h index 344dfdae4..8670e342f 100644 --- a/src/Magnum/PrimitiveQuery.h +++ b/src/Magnum/PrimitiveQuery.h @@ -161,6 +161,9 @@ class MAGNUM_EXPORT PrimitiveQuery: public AbstractQuery { * The constructed instance is equivalent to moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. + * + * This function can be safely used for constructing (and later + * destructing) objects even without any OpenGL context being active. * @see @ref PrimitiveQuery(Target), @ref wrap() */ explicit PrimitiveQuery(NoCreateT) noexcept: AbstractQuery{NoCreate, GLenum(Target::TransformFeedbackPrimitivesWritten)} {} diff --git a/src/Magnum/RectangleTexture.h b/src/Magnum/RectangleTexture.h index c7c5f377f..2ab8397b2 100644 --- a/src/Magnum/RectangleTexture.h +++ b/src/Magnum/RectangleTexture.h @@ -135,6 +135,9 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture { * The constructed instance is equivalent to moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. + * + * This function can be safely used for constructing (and later + * destructing) objects even without any OpenGL context being active. * @see @ref RectangleTexture(), @ref wrap() */ explicit RectangleTexture(NoCreateT) noexcept: AbstractTexture{NoCreate, GL_TEXTURE_RECTANGLE} {} diff --git a/src/Magnum/Renderbuffer.h b/src/Magnum/Renderbuffer.h index 0569f1046..60915f4ae 100644 --- a/src/Magnum/Renderbuffer.h +++ b/src/Magnum/Renderbuffer.h @@ -121,6 +121,9 @@ class MAGNUM_EXPORT Renderbuffer: public AbstractObject { * The constructed instance is equivalent to moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. + * + * This function can be safely used for constructing (and later + * destructing) objects even without any OpenGL context being active. * @see @ref Renderbuffer(), @ref wrap() */ explicit Renderbuffer(NoCreateT) noexcept: _id{0}, _flags{ObjectFlag::DeleteOnDestruction} {} diff --git a/src/Magnum/SampleQuery.h b/src/Magnum/SampleQuery.h index 608ee4da5..2ed87ae23 100644 --- a/src/Magnum/SampleQuery.h +++ b/src/Magnum/SampleQuery.h @@ -226,6 +226,9 @@ class SampleQuery: public AbstractQuery { * The constructed instance is equivalent to moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. + * + * This function can be safely used for constructing (and later + * destructing) objects even without any OpenGL context being active. * @see @ref SampleQuery(Target), @ref wrap() */ explicit SampleQuery(NoCreateT) noexcept: AbstractQuery{NoCreate, GLenum(Target::AnySamplesPassed)} {} diff --git a/src/Magnum/Test/BufferGLTest.cpp b/src/Magnum/Test/BufferGLTest.cpp index b89ce4a6c..82999ec50 100644 --- a/src/Magnum/Test/BufferGLTest.cpp +++ b/src/Magnum/Test/BufferGLTest.cpp @@ -39,7 +39,6 @@ struct BufferGLTest: OpenGLTester { explicit BufferGLTest(); void construct(); - void constructNoCreate(); void constructCopy(); void constructMove(); void wrap(); @@ -66,7 +65,6 @@ struct BufferGLTest: OpenGLTester { BufferGLTest::BufferGLTest() { addTests({&BufferGLTest::construct, - &BufferGLTest::constructNoCreate, &BufferGLTest::constructCopy, &BufferGLTest::constructMove, &BufferGLTest::wrap, @@ -104,17 +102,6 @@ void BufferGLTest::construct() { MAGNUM_VERIFY_NO_ERROR(); } -void BufferGLTest::constructNoCreate() { - { - Buffer buffer{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(buffer.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - void BufferGLTest::constructCopy() { CORRADE_VERIFY(!(std::is_constructible{})); CORRADE_VERIFY(!(std::is_assignable{})); diff --git a/src/Magnum/Test/BufferImageGLTest.cpp b/src/Magnum/Test/BufferImageGLTest.cpp index d156622a7..5220c2840 100644 --- a/src/Magnum/Test/BufferImageGLTest.cpp +++ b/src/Magnum/Test/BufferImageGLTest.cpp @@ -36,8 +36,6 @@ struct BufferImageGLTest: OpenGLTester { void construct(); void constructCompressed(); - void constructNoCreate(); - void constructNoCreateCompressed(); void constructBuffer(); void constructBufferCompressed(); void constructCopy(); @@ -55,8 +53,6 @@ struct BufferImageGLTest: OpenGLTester { BufferImageGLTest::BufferImageGLTest() { addTests({&BufferImageGLTest::construct, &BufferImageGLTest::constructCompressed, - &BufferImageGLTest::constructNoCreate, - &BufferImageGLTest::constructNoCreateCompressed, &BufferImageGLTest::constructBuffer, &BufferImageGLTest::constructBufferCompressed, &BufferImageGLTest::constructCopy, @@ -123,28 +119,6 @@ void BufferImageGLTest::constructCompressed() { #endif } -void BufferImageGLTest::constructNoCreate() { - { - BufferImage2D image{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(image.buffer().id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - -void BufferImageGLTest::constructNoCreateCompressed() { - { - CompressedBufferImage2D image{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(image.buffer().id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - void BufferImageGLTest::constructBuffer() { const char data[] = { 'a', 'b', 'c' }; Buffer buffer; diff --git a/src/Magnum/Test/BufferImageTest.cpp b/src/Magnum/Test/BufferImageTest.cpp new file mode 100644 index 000000000..bde091fff --- /dev/null +++ b/src/Magnum/Test/BufferImageTest.cpp @@ -0,0 +1,64 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include "Magnum/BufferImage.h" + +namespace Magnum { namespace Test { + +struct BufferImageTest: TestSuite::Tester { + explicit BufferImageTest(); + + void constructNoCreate(); + void constructNoCreateCompressed(); +}; + +BufferImageTest::BufferImageTest() { + addTests({&BufferImageTest::constructNoCreate, + &BufferImageTest::constructNoCreateCompressed}); +} + +void BufferImageTest::constructNoCreate() { + { + BufferImage2D image{NoCreate}; + CORRADE_COMPARE(image.buffer().id(), 0); + } + + CORRADE_VERIFY(true); +} + +void BufferImageTest::constructNoCreateCompressed() { + { + CompressedBufferImage2D image{NoCreate}; + CORRADE_COMPARE(image.buffer().id(), 0); + } + + CORRADE_VERIFY(true); +} + +}} + +CORRADE_TEST_MAIN(Magnum::Test::BufferImageTest) diff --git a/src/Magnum/Test/BufferTest.cpp b/src/Magnum/Test/BufferTest.cpp index f890f6485..e28d7c03b 100644 --- a/src/Magnum/Test/BufferTest.cpp +++ b/src/Magnum/Test/BufferTest.cpp @@ -34,6 +34,8 @@ namespace Magnum { namespace Test { struct BufferTest: TestSuite::Tester { explicit BufferTest(); + void constructNoCreate(); + void debugTargetHint(); #ifndef MAGNUM_TARGET_GLES2 void debugTarget(); @@ -41,13 +43,24 @@ struct BufferTest: TestSuite::Tester { }; BufferTest::BufferTest() { - addTests({&BufferTest::debugTargetHint, + addTests({&BufferTest::constructNoCreate, + + &BufferTest::debugTargetHint, #ifndef MAGNUM_TARGET_GLES2 &BufferTest::debugTarget #endif }); } +void BufferTest::constructNoCreate() { + { + Buffer buffer{NoCreate}; + CORRADE_COMPARE(buffer.id(), 0); + } + + CORRADE_VERIFY(true); +} + void BufferTest::debugTargetHint() { std::ostringstream out; Debug{&out} << Buffer::TargetHint::Array << Buffer::TargetHint(0xdead); diff --git a/src/Magnum/Test/BufferTextureGLTest.cpp b/src/Magnum/Test/BufferTextureGLTest.cpp index b103d14a6..b3bb8d08d 100644 --- a/src/Magnum/Test/BufferTextureGLTest.cpp +++ b/src/Magnum/Test/BufferTextureGLTest.cpp @@ -39,7 +39,6 @@ struct BufferTextureGLTest: OpenGLTester { explicit BufferTextureGLTest(); void construct(); - void constructNoCreate(); void wrap(); void bind(); @@ -51,7 +50,6 @@ struct BufferTextureGLTest: OpenGLTester { BufferTextureGLTest::BufferTextureGLTest() { addTests({&BufferTextureGLTest::construct, - &BufferTextureGLTest::constructNoCreate, &BufferTextureGLTest::wrap, &BufferTextureGLTest::bind, @@ -80,17 +78,6 @@ void BufferTextureGLTest::construct() { MAGNUM_VERIFY_NO_ERROR(); } -void BufferTextureGLTest::constructNoCreate() { - { - BufferTexture texture{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(texture.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - void BufferTextureGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/Test/BufferTextureTest.cpp b/src/Magnum/Test/BufferTextureTest.cpp new file mode 100644 index 000000000..23b933e6e --- /dev/null +++ b/src/Magnum/Test/BufferTextureTest.cpp @@ -0,0 +1,53 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include "Magnum/BufferTexture.h" + +namespace Magnum { namespace Test { + +struct BufferTextureTest: TestSuite::Tester { + explicit BufferTextureTest(); + + void constructNoCreate(); +}; + +BufferTextureTest::BufferTextureTest() { + addTests({&BufferTextureTest::constructNoCreate}); +} + +void BufferTextureTest::constructNoCreate() { + { + BufferTexture texture{NoCreate}; + CORRADE_COMPARE(texture.id(), 0); + } + + CORRADE_VERIFY(true); +} + +}} + +CORRADE_TEST_MAIN(Magnum::Test::BufferTextureTest) diff --git a/src/Magnum/Test/CMakeLists.txt b/src/Magnum/Test/CMakeLists.txt index f346807d7..85fd4698a 100644 --- a/src/Magnum/Test/CMakeLists.txt +++ b/src/Magnum/Test/CMakeLists.txt @@ -28,6 +28,7 @@ corrade_add_test(AttributeTest AttributeTest.cpp LIBRARIES Magnum) corrade_add_test(BufferTest BufferTest.cpp LIBRARIES Magnum) corrade_add_test(FormatTest FormatTest.cpp LIBRARIES Magnum) corrade_add_test(ContextTest ContextTest.cpp LIBRARIES Magnum) +corrade_add_test(CubeMapTextureTest CubeMapTextureTest.cpp LIBRARIES Magnum) if(NOT MAGNUM_TARGET_WEBGL) corrade_add_test(DebugOutputTest DebugOutputTest.cpp LIBRARIES Magnum) endif() @@ -38,12 +39,39 @@ corrade_add_test(ImageViewTest ImageViewTest.cpp LIBRARIES Magnum) corrade_add_test(MeshTest MeshTest.cpp LIBRARIES Magnum) corrade_add_test(PixelStorageTest PixelStorageTest.cpp LIBRARIES Magnum) corrade_add_test(RendererTest RendererTest.cpp LIBRARIES Magnum) +corrade_add_test(RenderbufferTest RenderbufferTest.cpp LIBRARIES Magnum) corrade_add_test(ResourceManagerTest ResourceManagerTest.cpp LIBRARIES Magnum) target_compile_definitions(ResourceManagerTest PRIVATE "CORRADE_GRACEFUL_ASSERT") corrade_add_test(SamplerTest SamplerTest.cpp LIBRARIES Magnum) corrade_add_test(ShaderTest ShaderTest.cpp LIBRARIES Magnum) -corrade_add_test(VersionTest VersionTest.cpp LIBRARIES Magnum) corrade_add_test(TagsTest TagsTest.cpp LIBRARIES Magnum) +corrade_add_test(TextureTest TextureTest.cpp LIBRARIES Magnum) +corrade_add_test(VersionTest VersionTest.cpp LIBRARIES Magnum) + +if(NOT MAGNUM_TARGET_GLES2) + corrade_add_test(BufferImageTest BufferImageTest.cpp LIBRARIES Magnum) + corrade_add_test(PrimitiveQueryTest PrimitiveQueryTest.cpp LIBRARIES Magnum) + corrade_add_test(TextureArrayTest TextureArrayTest.cpp LIBRARIES Magnum) + corrade_add_test(TransformFeedbackTest TransformFeedbackTest.cpp LIBRARIES Magnum) +endif() + +if(NOT MAGNUM_TARGET_GLES2 AND NOT MAGNUM_TARGET_WEBGL) + corrade_add_test(BufferTextureTest BufferTextureTest.cpp LIBRARIES Magnum) + corrade_add_test(CubeMapTextureArrayTest CubeMapTextureArrayTest.cpp LIBRARIES Magnum) + corrade_add_test(MultisampleTextureTest MultisampleTextureTest.cpp LIBRARIES Magnum) +endif() + +if(NOT (MAGNUM_TARGET_WEBGL AND MAGNUM_TARGET_GLES2)) + corrade_add_test(SampleQueryTest SampleQueryTest.cpp LIBRARIES Magnum) +endif() + +if(NOT MAGNUM_TARGET_WEBGL) + corrade_add_test(TimeQueryTest TimeQueryTest.cpp LIBRARIES Magnum) +endif() + +if(NOT MAGNUM_TARGET_GLES) + corrade_add_test(RectangleTextureTest RectangleTextureTest.cpp LIBRARIES MagnumOpenGLTester) +endif() add_library(ResourceManagerLocalInstanceTestLib ${SHARED_OR_STATIC} ResourceManagerLocalInstanceTestLib.cpp) target_link_libraries(ResourceManagerLocalInstanceTestLib Magnum) diff --git a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp b/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp index e186d3ead..312f13f29 100644 --- a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp @@ -43,7 +43,6 @@ struct CubeMapTextureArrayGLTest: OpenGLTester { explicit CubeMapTextureArrayGLTest(); void construct(); - void constructNoCreate(); void wrap(); void bind(); @@ -89,7 +88,6 @@ private: CubeMapTextureArrayGLTest::CubeMapTextureArrayGLTest() { addTests({&CubeMapTextureArrayGLTest::construct, - &CubeMapTextureArrayGLTest::constructNoCreate, &CubeMapTextureArrayGLTest::wrap, &CubeMapTextureArrayGLTest::bind, @@ -170,17 +168,6 @@ void CubeMapTextureArrayGLTest::construct() { MAGNUM_VERIFY_NO_ERROR(); } -void CubeMapTextureArrayGLTest::constructNoCreate() { - { - CubeMapTextureArray texture{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(texture.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - void CubeMapTextureArrayGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/Test/CubeMapTextureArrayTest.cpp b/src/Magnum/Test/CubeMapTextureArrayTest.cpp new file mode 100644 index 000000000..3c23179dd --- /dev/null +++ b/src/Magnum/Test/CubeMapTextureArrayTest.cpp @@ -0,0 +1,53 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include "Magnum/CubeMapTextureArray.h" + +namespace Magnum { namespace Test { + +struct CubeMapTextureArrayTest: TestSuite::Tester { + explicit CubeMapTextureArrayTest(); + + void constructNoCreate(); +}; + +CubeMapTextureArrayTest::CubeMapTextureArrayTest() { + addTests({&CubeMapTextureArrayTest::constructNoCreate}); +} + +void CubeMapTextureArrayTest::constructNoCreate() { + { + CubeMapTextureArray texture{NoCreate}; + CORRADE_COMPARE(texture.id(), 0); + } + + CORRADE_VERIFY(true); +} + +}} + +CORRADE_TEST_MAIN(Magnum::Test::CubeMapTextureArrayTest) diff --git a/src/Magnum/Test/CubeMapTextureGLTest.cpp b/src/Magnum/Test/CubeMapTextureGLTest.cpp index 13ffb2b5d..75dac11e7 100644 --- a/src/Magnum/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureGLTest.cpp @@ -47,7 +47,6 @@ struct CubeMapTextureGLTest: OpenGLTester { explicit CubeMapTextureGLTest(); void construct(); - void constructNoCreate(); void wrap(); void bind(); @@ -119,7 +118,6 @@ private: CubeMapTextureGLTest::CubeMapTextureGLTest() { addTests({&CubeMapTextureGLTest::construct, - &CubeMapTextureGLTest::constructNoCreate, &CubeMapTextureGLTest::wrap, &CubeMapTextureGLTest::bind, @@ -233,17 +231,6 @@ void CubeMapTextureGLTest::construct() { MAGNUM_VERIFY_NO_ERROR(); } -void CubeMapTextureGLTest::constructNoCreate() { - { - CubeMapTexture texture{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(texture.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - void CubeMapTextureGLTest::wrap() { GLuint id; glGenTextures(1, &id); diff --git a/src/Magnum/Test/CubeMapTextureTest.cpp b/src/Magnum/Test/CubeMapTextureTest.cpp new file mode 100644 index 000000000..c05210a7b --- /dev/null +++ b/src/Magnum/Test/CubeMapTextureTest.cpp @@ -0,0 +1,53 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include "Magnum/CubeMapTexture.h" + +namespace Magnum { namespace Test { + +struct CubeMapTextureTest: TestSuite::Tester { + explicit CubeMapTextureTest(); + + void constructNoCreate(); +}; + +CubeMapTextureTest::CubeMapTextureTest() { + addTests({&CubeMapTextureTest::constructNoCreate}); +} + +void CubeMapTextureTest::constructNoCreate() { + { + CubeMapTexture texture{NoCreate}; + CORRADE_COMPARE(texture.id(), 0); + } + + CORRADE_VERIFY(true); +} + +}} + +CORRADE_TEST_MAIN(Magnum::Test::CubeMapTextureTest) diff --git a/src/Magnum/Test/FramebufferGLTest.cpp b/src/Magnum/Test/FramebufferGLTest.cpp index ec9dcc26e..d1ed1e9a8 100644 --- a/src/Magnum/Test/FramebufferGLTest.cpp +++ b/src/Magnum/Test/FramebufferGLTest.cpp @@ -56,7 +56,6 @@ struct FramebufferGLTest: OpenGLTester { explicit FramebufferGLTest(); void construct(); - void constructNoCreate(); void constructCopy(); void constructMove(); void wrap(); @@ -150,7 +149,6 @@ struct FramebufferGLTest: OpenGLTester { FramebufferGLTest::FramebufferGLTest() { addTests({&FramebufferGLTest::construct, - &FramebufferGLTest::constructNoCreate, &FramebufferGLTest::constructCopy, &FramebufferGLTest::constructMove, &FramebufferGLTest::wrap, @@ -264,17 +262,6 @@ void FramebufferGLTest::construct() { MAGNUM_VERIFY_NO_ERROR(); } -void FramebufferGLTest::constructNoCreate() { - { - Framebuffer framebuffer{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(framebuffer.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - void FramebufferGLTest::constructCopy() { CORRADE_VERIFY(!(std::is_constructible{})); CORRADE_VERIFY(!(std::is_assignable{})); diff --git a/src/Magnum/Test/FramebufferTest.cpp b/src/Magnum/Test/FramebufferTest.cpp index f73180162..a4e7e6b8a 100644 --- a/src/Magnum/Test/FramebufferTest.cpp +++ b/src/Magnum/Test/FramebufferTest.cpp @@ -33,11 +33,24 @@ namespace Magnum { namespace Test { struct FramebufferTest: TestSuite::Tester { explicit FramebufferTest(); + void constructNoCreate(); + void debugStatus(); }; FramebufferTest::FramebufferTest() { - addTests({&FramebufferTest::debugStatus}); + addTests({&FramebufferTest::constructNoCreate, + + &FramebufferTest::debugStatus}); +} + +void FramebufferTest::constructNoCreate() { + { + Framebuffer framebuffer{NoCreate}; + CORRADE_COMPARE(framebuffer.id(), 0); + } + + CORRADE_VERIFY(true); } void FramebufferTest::debugStatus() { diff --git a/src/Magnum/Test/MeshGLTest.cpp b/src/Magnum/Test/MeshGLTest.cpp index 18ac1dea7..a76e27546 100644 --- a/src/Magnum/Test/MeshGLTest.cpp +++ b/src/Magnum/Test/MeshGLTest.cpp @@ -48,7 +48,6 @@ struct MeshGLTest: OpenGLTester { explicit MeshGLTest(); void construct(); - void constructNoCreate(); void constructCopy(); void constructMove(); void wrap(); @@ -141,7 +140,6 @@ struct MeshGLTest: OpenGLTester { MeshGLTest::MeshGLTest() { addTests({&MeshGLTest::construct, - &MeshGLTest::constructNoCreate, &MeshGLTest::constructCopy, &MeshGLTest::constructMove, &MeshGLTest::wrap, @@ -251,17 +249,6 @@ void MeshGLTest::construct() { MAGNUM_VERIFY_NO_ERROR(); } -void MeshGLTest::constructNoCreate() { - { - Mesh mesh{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(mesh.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - void MeshGLTest::constructCopy() { CORRADE_VERIFY(!(std::is_constructible{})); CORRADE_VERIFY(!(std::is_assignable{})); diff --git a/src/Magnum/Test/MeshTest.cpp b/src/Magnum/Test/MeshTest.cpp index 9d58b17c6..6e1fe4bdd 100644 --- a/src/Magnum/Test/MeshTest.cpp +++ b/src/Magnum/Test/MeshTest.cpp @@ -34,6 +34,8 @@ namespace Magnum { namespace Test { struct MeshTest: TestSuite::Tester { explicit MeshTest(); + void constructNoCreate(); + void indexSize(); void debugPrimitive(); @@ -43,7 +45,9 @@ struct MeshTest: TestSuite::Tester { }; MeshTest::MeshTest() { - addTests({&MeshTest::indexSize, + addTests({&MeshTest::constructNoCreate, + + &MeshTest::indexSize, &MeshTest::debugPrimitive, &MeshTest::debugIndexType, @@ -51,6 +55,15 @@ MeshTest::MeshTest() { &MeshTest::configurationIndexType}); } +void MeshTest::constructNoCreate() { + { + Mesh mesh{NoCreate}; + CORRADE_COMPARE(mesh.id(), 0); + } + + CORRADE_VERIFY(true); +} + void MeshTest::indexSize() { CORRADE_COMPARE(Mesh::indexSize(Mesh::IndexType::UnsignedByte), 1); CORRADE_COMPARE(Mesh::indexSize(Mesh::IndexType::UnsignedShort), 2); diff --git a/src/Magnum/Test/MultisampleTextureGLTest.cpp b/src/Magnum/Test/MultisampleTextureGLTest.cpp index eab804e64..5060e5216 100644 --- a/src/Magnum/Test/MultisampleTextureGLTest.cpp +++ b/src/Magnum/Test/MultisampleTextureGLTest.cpp @@ -41,9 +41,6 @@ struct MultisampleTextureGLTest: OpenGLTester { void construct2D(); void construct2DArray(); - void construct2DNoCreate(); - void construct2DArrayNoCreate(); - void wrap2D(); void wrap2DArray(); @@ -67,9 +64,6 @@ MultisampleTextureGLTest::MultisampleTextureGLTest() { addTests({&MultisampleTextureGLTest::construct2D, &MultisampleTextureGLTest::construct2DArray, - &MultisampleTextureGLTest::construct2DNoCreate, - &MultisampleTextureGLTest::construct2DArrayNoCreate, - &MultisampleTextureGLTest::wrap2D, &MultisampleTextureGLTest::wrap2DArray, @@ -108,17 +102,6 @@ void MultisampleTextureGLTest::construct2D() { MAGNUM_VERIFY_NO_ERROR(); } -void MultisampleTextureGLTest::construct2DNoCreate() { - { - MultisampleTexture2D texture{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(texture.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - void MultisampleTextureGLTest::construct2DArray() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) @@ -138,17 +121,6 @@ void MultisampleTextureGLTest::construct2DArray() { MAGNUM_VERIFY_NO_ERROR(); } -void MultisampleTextureGLTest::construct2DArrayNoCreate() { - { - MultisampleTexture2DArray texture{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(texture.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - void MultisampleTextureGLTest::wrap2D() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/Test/MultisampleTextureTest.cpp b/src/Magnum/Test/MultisampleTextureTest.cpp new file mode 100644 index 000000000..e57fcb9bc --- /dev/null +++ b/src/Magnum/Test/MultisampleTextureTest.cpp @@ -0,0 +1,64 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include "Magnum/MultisampleTexture.h" + +namespace Magnum { namespace Test { + +struct MultisampleTextureTest: TestSuite::Tester { + explicit MultisampleTextureTest(); + + void construct2DNoCreate(); + void construct2DArrayNoCreate(); +}; + +MultisampleTextureTest::MultisampleTextureTest() { + addTests({&MultisampleTextureTest::construct2DNoCreate, + &MultisampleTextureTest::construct2DArrayNoCreate}); +} + +void MultisampleTextureTest::construct2DNoCreate() { + { + MultisampleTexture2D texture{NoCreate}; + CORRADE_COMPARE(texture.id(), 0); + } + + CORRADE_VERIFY(true); +} + +void MultisampleTextureTest::construct2DArrayNoCreate() { + { + MultisampleTexture2DArray texture{NoCreate}; + CORRADE_COMPARE(texture.id(), 0); + } + + CORRADE_VERIFY(true); +} + +}} + +CORRADE_TEST_MAIN(Magnum::Test::MultisampleTextureTest) diff --git a/src/Magnum/Test/PrimitiveQueryGLTest.cpp b/src/Magnum/Test/PrimitiveQueryGLTest.cpp index 044ea0c2b..09a9c1f7f 100644 --- a/src/Magnum/Test/PrimitiveQueryGLTest.cpp +++ b/src/Magnum/Test/PrimitiveQueryGLTest.cpp @@ -45,7 +45,6 @@ namespace Magnum { namespace Test { struct PrimitiveQueryGLTest: OpenGLTester { explicit PrimitiveQueryGLTest(); - void constructNoCreate(); void wrap(); #ifndef MAGNUM_TARGET_GLES @@ -59,8 +58,7 @@ struct PrimitiveQueryGLTest: OpenGLTester { }; PrimitiveQueryGLTest::PrimitiveQueryGLTest() { - addTests({&PrimitiveQueryGLTest::constructNoCreate, - &PrimitiveQueryGLTest::wrap, + addTests({&PrimitiveQueryGLTest::wrap, #ifndef MAGNUM_TARGET_GLES &PrimitiveQueryGLTest::primitivesGenerated, @@ -73,17 +71,6 @@ PrimitiveQueryGLTest::PrimitiveQueryGLTest() { }); } -void PrimitiveQueryGLTest::constructNoCreate() { - { - PrimitiveQuery query{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(query.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - void PrimitiveQueryGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/Test/PrimitiveQueryTest.cpp b/src/Magnum/Test/PrimitiveQueryTest.cpp new file mode 100644 index 000000000..393b6e589 --- /dev/null +++ b/src/Magnum/Test/PrimitiveQueryTest.cpp @@ -0,0 +1,53 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include "Magnum/PrimitiveQuery.h" + +namespace Magnum { namespace Test { + +struct PrimitiveQueryTest: TestSuite::Tester { + explicit PrimitiveQueryTest(); + + void constructNoCreate(); +}; + +PrimitiveQueryTest::PrimitiveQueryTest() { + addTests({&PrimitiveQueryTest::constructNoCreate}); +} + +void PrimitiveQueryTest::constructNoCreate() { + { + PrimitiveQuery query{NoCreate}; + CORRADE_COMPARE(query.id(), 0); + } + + CORRADE_VERIFY(true); +} + +}} + +CORRADE_TEST_MAIN(Magnum::Test::PrimitiveQueryTest) diff --git a/src/Magnum/Test/RectangleTextureGLTest.cpp b/src/Magnum/Test/RectangleTextureGLTest.cpp index ab145e186..dd1e39fa0 100644 --- a/src/Magnum/Test/RectangleTextureGLTest.cpp +++ b/src/Magnum/Test/RectangleTextureGLTest.cpp @@ -45,7 +45,6 @@ struct RectangleTextureGLTest: OpenGLTester { explicit RectangleTextureGLTest(); void construct(); - void constructNoCreate(); void wrap(); void bind(); @@ -78,7 +77,6 @@ struct RectangleTextureGLTest: OpenGLTester { RectangleTextureGLTest::RectangleTextureGLTest() { addTests({&RectangleTextureGLTest::construct, - &RectangleTextureGLTest::constructNoCreate, &RectangleTextureGLTest::wrap, &RectangleTextureGLTest::bind, @@ -131,17 +129,6 @@ void RectangleTextureGLTest::construct() { MAGNUM_VERIFY_NO_ERROR(); } -void RectangleTextureGLTest::constructNoCreate() { - { - RectangleTexture texture{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(texture.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - void RectangleTextureGLTest::wrap() { if(!Context::current().isExtensionSupported()) CORRADE_SKIP(Extensions::GL::ARB::texture_rectangle::string() + std::string(" is not supported.")); diff --git a/src/Magnum/Test/RectangleTextureTest.cpp b/src/Magnum/Test/RectangleTextureTest.cpp new file mode 100644 index 000000000..67eb0a249 --- /dev/null +++ b/src/Magnum/Test/RectangleTextureTest.cpp @@ -0,0 +1,53 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include "Magnum/RectangleTexture.h" + +namespace Magnum { namespace Test { + +struct RectangleTextureTest: TestSuite::Tester { + explicit RectangleTextureTest(); + + void constructNoCreate(); +}; + +RectangleTextureTest::RectangleTextureTest() { + addTests({&RectangleTextureTest::constructNoCreate}); +} + +void RectangleTextureTest::constructNoCreate() { + { + RectangleTexture texture{NoCreate}; + CORRADE_COMPARE(texture.id(), 0); + } + + CORRADE_VERIFY(true); +} + +}} + +CORRADE_TEST_MAIN(Magnum::Test::RectangleTextureTest) diff --git a/src/Magnum/Test/RenderbufferGLTest.cpp b/src/Magnum/Test/RenderbufferGLTest.cpp index 0204371ab..91e3607df 100644 --- a/src/Magnum/Test/RenderbufferGLTest.cpp +++ b/src/Magnum/Test/RenderbufferGLTest.cpp @@ -36,7 +36,6 @@ struct RenderbufferGLTest: OpenGLTester { explicit RenderbufferGLTest(); void construct(); - void constructNoCreate(); void constructCopy(); void constructMove(); void wrap(); @@ -49,7 +48,6 @@ struct RenderbufferGLTest: OpenGLTester { RenderbufferGLTest::RenderbufferGLTest() { addTests({&RenderbufferGLTest::construct, - &RenderbufferGLTest::constructNoCreate, &RenderbufferGLTest::constructCopy, &RenderbufferGLTest::constructMove, &RenderbufferGLTest::wrap, @@ -76,17 +74,6 @@ void RenderbufferGLTest::construct() { MAGNUM_VERIFY_NO_ERROR(); } -void RenderbufferGLTest::constructNoCreate() { - { - Renderbuffer renderbuffer{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(renderbuffer.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - void RenderbufferGLTest::constructCopy() { CORRADE_VERIFY(!(std::is_constructible{})); CORRADE_VERIFY(!(std::is_assignable{})); diff --git a/src/Magnum/Test/RenderbufferTest.cpp b/src/Magnum/Test/RenderbufferTest.cpp new file mode 100644 index 000000000..8a99d0fb2 --- /dev/null +++ b/src/Magnum/Test/RenderbufferTest.cpp @@ -0,0 +1,53 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include "Magnum/Renderbuffer.h" + +namespace Magnum { namespace Test { + +struct RenderbufferTest: TestSuite::Tester { + explicit RenderbufferTest(); + + void constructNoCreate(); +}; + +RenderbufferTest::RenderbufferTest() { + addTests({&RenderbufferTest::constructNoCreate}); +} + +void RenderbufferTest::constructNoCreate() { + { + Renderbuffer renderbuffer{NoCreate}; + CORRADE_COMPARE(renderbuffer.id(), 0); + } + + CORRADE_VERIFY(true); +} + +}} + +CORRADE_TEST_MAIN(Magnum::Test::RenderbufferTest) diff --git a/src/Magnum/Test/SampleQueryGLTest.cpp b/src/Magnum/Test/SampleQueryGLTest.cpp index eb6ef5c08..440ed9574 100644 --- a/src/Magnum/Test/SampleQueryGLTest.cpp +++ b/src/Magnum/Test/SampleQueryGLTest.cpp @@ -43,7 +43,6 @@ namespace Magnum { namespace Test { struct SampleQueryGLTest: OpenGLTester { explicit SampleQueryGLTest(); - void constructNoCreate(); void wrap(); void querySamplesPassed(); @@ -53,8 +52,7 @@ struct SampleQueryGLTest: OpenGLTester { }; SampleQueryGLTest::SampleQueryGLTest() { - addTests({&SampleQueryGLTest::constructNoCreate, - &SampleQueryGLTest::wrap, + addTests({&SampleQueryGLTest::wrap, &SampleQueryGLTest::querySamplesPassed, #ifndef MAGNUM_TARGET_GLES @@ -63,17 +61,6 @@ SampleQueryGLTest::SampleQueryGLTest() { }); } -void SampleQueryGLTest::constructNoCreate() { - { - SampleQuery query{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(query.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - void SampleQueryGLTest::wrap() { #ifdef MAGNUM_TARGET_GLES2 if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/Test/SampleQueryTest.cpp b/src/Magnum/Test/SampleQueryTest.cpp new file mode 100644 index 000000000..e92a4d276 --- /dev/null +++ b/src/Magnum/Test/SampleQueryTest.cpp @@ -0,0 +1,53 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include "Magnum/SampleQuery.h" + +namespace Magnum { namespace Test { + +struct SampleQueryTest: TestSuite::Tester { + explicit SampleQueryTest(); + + void constructNoCreate(); +}; + +SampleQueryTest::SampleQueryTest() { + addTests({&SampleQueryTest::constructNoCreate}); +} + +void SampleQueryTest::constructNoCreate() { + { + SampleQuery query{NoCreate}; + CORRADE_COMPARE(query.id(), 0); + } + + CORRADE_VERIFY(true); +} + +}} + +CORRADE_TEST_MAIN(Magnum::Test::SampleQueryTest) diff --git a/src/Magnum/Test/TextureArrayGLTest.cpp b/src/Magnum/Test/TextureArrayGLTest.cpp index 5c5fe3e83..3bcb91052 100644 --- a/src/Magnum/Test/TextureArrayGLTest.cpp +++ b/src/Magnum/Test/TextureArrayGLTest.cpp @@ -44,10 +44,8 @@ struct TextureArrayGLTest: OpenGLTester { #ifndef MAGNUM_TARGET_GLES void construct1D(); - void construct1DNoCreate(); #endif void construct2D(); - void construct2DNoCreate(); #ifndef MAGNUM_TARGET_GLES void wrap1D(); @@ -166,10 +164,8 @@ TextureArrayGLTest::TextureArrayGLTest() { addTests({ #ifndef MAGNUM_TARGET_GLES &TextureArrayGLTest::construct1D, - &TextureArrayGLTest::construct1DNoCreate, #endif &TextureArrayGLTest::construct2D, - &TextureArrayGLTest::construct2DNoCreate, #ifndef MAGNUM_TARGET_GLES &TextureArrayGLTest::wrap1D, @@ -315,17 +311,6 @@ void TextureArrayGLTest::construct1D() { MAGNUM_VERIFY_NO_ERROR(); } - -void TextureArrayGLTest::construct1DNoCreate() { - { - Texture1DArray texture{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(texture.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} #endif void TextureArrayGLTest::construct2D() { @@ -344,17 +329,6 @@ void TextureArrayGLTest::construct2D() { MAGNUM_VERIFY_NO_ERROR(); } -void TextureArrayGLTest::construct2DNoCreate() { - { - Texture2DArray texture{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(texture.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - #ifndef MAGNUM_TARGET_GLES void TextureArrayGLTest::wrap1D() { GLuint id; diff --git a/src/Magnum/Test/TextureArrayTest.cpp b/src/Magnum/Test/TextureArrayTest.cpp new file mode 100644 index 000000000..930c26287 --- /dev/null +++ b/src/Magnum/Test/TextureArrayTest.cpp @@ -0,0 +1,71 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include "Magnum/TextureArray.h" + +namespace Magnum { namespace Test { + +struct TextureArrayTest: TestSuite::Tester { + explicit TextureArrayTest(); + + #ifndef MAGNUM_TARGET_GLES + void construct1DNoCreate(); + #endif + void construct2DNoCreate(); +}; + +TextureArrayTest::TextureArrayTest() { + addTests({ + #ifndef MAGNUM_TARGET_GLES + &TextureArrayTest::construct1DNoCreate, + #endif + &TextureArrayTest::construct2DNoCreate}); +} + +#ifndef MAGNUM_TARGET_GLES +void TextureArrayTest::construct1DNoCreate() { + { + Texture1DArray texture{NoCreate}; + CORRADE_COMPARE(texture.id(), 0); + } + + CORRADE_VERIFY(true); +} +#endif + +void TextureArrayTest::construct2DNoCreate() { + { + Texture2DArray texture{NoCreate}; + CORRADE_COMPARE(texture.id(), 0); + } + + CORRADE_VERIFY(true); +} + +}} + +CORRADE_TEST_MAIN(Magnum::Test::TextureArrayTest) diff --git a/src/Magnum/Test/TextureGLTest.cpp b/src/Magnum/Test/TextureGLTest.cpp index cba817575..92889c175 100644 --- a/src/Magnum/Test/TextureGLTest.cpp +++ b/src/Magnum/Test/TextureGLTest.cpp @@ -48,12 +48,9 @@ struct TextureGLTest: OpenGLTester { #ifndef MAGNUM_TARGET_GLES void construct1D(); - void construct1DNoCreate(); #endif void construct2D(); - void construct2DNoCreate(); void construct3D(); - void construct3DNoCreate(); #ifndef MAGNUM_TARGET_GLES void wrap1D(); @@ -211,12 +208,9 @@ TextureGLTest::TextureGLTest() { addTests({ #ifndef MAGNUM_TARGET_GLES &TextureGLTest::construct1D, - &TextureGLTest::construct1DNoCreate, #endif &TextureGLTest::construct2D, - &TextureGLTest::construct2DNoCreate, &TextureGLTest::construct3D, - &TextureGLTest::construct3DNoCreate, #ifndef MAGNUM_TARGET_GLES &TextureGLTest::wrap1D, @@ -415,17 +409,6 @@ void TextureGLTest::construct1D() { MAGNUM_VERIFY_NO_ERROR(); } - -void TextureGLTest::construct1DNoCreate() { - { - Texture1D texture{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(texture.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} #endif void TextureGLTest::construct2D() { @@ -439,17 +422,6 @@ void TextureGLTest::construct2D() { MAGNUM_VERIFY_NO_ERROR(); } -void TextureGLTest::construct2DNoCreate() { - { - Texture2D texture{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(texture.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - void TextureGLTest::construct3D() { #ifdef MAGNUM_TARGET_GLES2 if(!Context::current().isExtensionSupported()) @@ -466,17 +438,6 @@ void TextureGLTest::construct3D() { MAGNUM_VERIFY_NO_ERROR(); } -void TextureGLTest::construct3DNoCreate() { - { - Texture3D texture{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(texture.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - #ifndef MAGNUM_TARGET_GLES void TextureGLTest::wrap1D() { GLuint id; diff --git a/src/Magnum/Test/TextureTest.cpp b/src/Magnum/Test/TextureTest.cpp new file mode 100644 index 000000000..2ffd147c3 --- /dev/null +++ b/src/Magnum/Test/TextureTest.cpp @@ -0,0 +1,89 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include "Magnum/Texture.h" + +namespace Magnum { namespace Test { + +struct TextureTest: TestSuite::Tester { + explicit TextureTest(); + + #ifndef MAGNUM_TARGET_GLES + void construct1DNoCreate(); + #endif + void construct2DNoCreate(); + #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) + void construct3DNoCreate(); + #endif +}; + +TextureTest::TextureTest() { + addTests({ + #ifndef MAGNUM_TARGET_GLES + &TextureTest::construct1DNoCreate, + #endif + &TextureTest::construct2DNoCreate, + #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) + &TextureTest::construct3DNoCreate + #endif + }); +} + +#ifndef MAGNUM_TARGET_GLES +void TextureTest::construct1DNoCreate() { + { + Texture1D texture{NoCreate}; + CORRADE_COMPARE(texture.id(), 0); + } + + CORRADE_VERIFY(true); +} +#endif + +void TextureTest::construct2DNoCreate() { + { + Texture2D texture{NoCreate}; + CORRADE_COMPARE(texture.id(), 0); + } + + CORRADE_VERIFY(true); +} + +#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) +void TextureTest::construct3DNoCreate() { + { + Texture3D texture{NoCreate}; + CORRADE_COMPARE(texture.id(), 0); + } + + CORRADE_VERIFY(true); +} +#endif + +}} + +CORRADE_TEST_MAIN(Magnum::Test::TextureTest) diff --git a/src/Magnum/Test/TimeQueryGLTest.cpp b/src/Magnum/Test/TimeQueryGLTest.cpp index 2bc1f1cc0..dcdc19845 100644 --- a/src/Magnum/Test/TimeQueryGLTest.cpp +++ b/src/Magnum/Test/TimeQueryGLTest.cpp @@ -35,7 +35,6 @@ namespace Magnum { namespace Test { struct TimeQueryGLTest: OpenGLTester { explicit TimeQueryGLTest(); - void constructNoCreate(); void wrap(); void queryTime(); @@ -43,24 +42,12 @@ struct TimeQueryGLTest: OpenGLTester { }; TimeQueryGLTest::TimeQueryGLTest() { - addTests({&TimeQueryGLTest::constructNoCreate, - &TimeQueryGLTest::wrap, + addTests({&TimeQueryGLTest::wrap, &TimeQueryGLTest::queryTime, &TimeQueryGLTest::queryTimestamp}); } -void TimeQueryGLTest::constructNoCreate() { - { - TimeQuery query{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(query.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - void TimeQueryGLTest::wrap() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) diff --git a/src/Magnum/Test/TimeQueryTest.cpp b/src/Magnum/Test/TimeQueryTest.cpp new file mode 100644 index 000000000..c91a1c75e --- /dev/null +++ b/src/Magnum/Test/TimeQueryTest.cpp @@ -0,0 +1,53 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include "Magnum/TimeQuery.h" + +namespace Magnum { namespace Test { + +struct TimeQueryTest: TestSuite::Tester { + explicit TimeQueryTest(); + + void constructNoCreate(); +}; + +TimeQueryTest::TimeQueryTest() { + addTests({&TimeQueryTest::constructNoCreate}); +} + +void TimeQueryTest::constructNoCreate() { + { + TimeQuery query{NoCreate}; + CORRADE_COMPARE(query.id(), 0); + } + + CORRADE_VERIFY(true); +} + +}} + +CORRADE_TEST_MAIN(Magnum::Test::TimeQueryTest) diff --git a/src/Magnum/Test/TransformFeedbackGLTest.cpp b/src/Magnum/Test/TransformFeedbackGLTest.cpp index 1c8bdeb53..f0baf1da4 100644 --- a/src/Magnum/Test/TransformFeedbackGLTest.cpp +++ b/src/Magnum/Test/TransformFeedbackGLTest.cpp @@ -46,7 +46,6 @@ struct TransformFeedbackGLTest: OpenGLTester { explicit TransformFeedbackGLTest(); void construct(); - void constructNoCreate(); void constructCopy(); void constructMove(); void wrap(); @@ -87,7 +86,6 @@ const struct { TransformFeedbackGLTest::TransformFeedbackGLTest() { addTests({&TransformFeedbackGLTest::construct, - &TransformFeedbackGLTest::constructNoCreate, &TransformFeedbackGLTest::constructCopy, &TransformFeedbackGLTest::constructMove, &TransformFeedbackGLTest::wrap, @@ -125,17 +123,6 @@ void TransformFeedbackGLTest::construct() { MAGNUM_VERIFY_NO_ERROR(); } -void TransformFeedbackGLTest::constructNoCreate() { - { - TransformFeedback feedback{NoCreate}; - - MAGNUM_VERIFY_NO_ERROR(); - CORRADE_COMPARE(feedback.id(), 0); - } - - MAGNUM_VERIFY_NO_ERROR(); -} - void TransformFeedbackGLTest::constructCopy() { CORRADE_VERIFY(!(std::is_constructible{})); CORRADE_VERIFY(!(std::is_assignable{})); diff --git a/src/Magnum/Test/TransformFeedbackTest.cpp b/src/Magnum/Test/TransformFeedbackTest.cpp new file mode 100644 index 000000000..070d0ab19 --- /dev/null +++ b/src/Magnum/Test/TransformFeedbackTest.cpp @@ -0,0 +1,53 @@ +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include "Magnum/TransformFeedback.h" + +namespace Magnum { namespace Test { + +struct TransformFeedbackTest: TestSuite::Tester { + explicit TransformFeedbackTest(); + + void constructNoCreate(); +}; + +TransformFeedbackTest::TransformFeedbackTest() { + addTests({&TransformFeedbackTest::constructNoCreate}); +} + +void TransformFeedbackTest::constructNoCreate() { + { + TransformFeedback xfb{NoCreate}; + CORRADE_COMPARE(xfb.id(), 0); + } + + CORRADE_VERIFY(true); +} + +}} + +CORRADE_TEST_MAIN(Magnum::Test::TransformFeedbackTest) diff --git a/src/Magnum/Texture.h b/src/Magnum/Texture.h index 0f6d6ce01..695fae335 100644 --- a/src/Magnum/Texture.h +++ b/src/Magnum/Texture.h @@ -190,6 +190,9 @@ template class Texture: public AbstractTexture { * The constructed instance is equivalent to moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. + * + * This function can be safely used for constructing (and later + * destructing) objects even without any OpenGL context being active. * @see @ref Texture(), @ref wrap() */ explicit Texture(NoCreateT) noexcept: AbstractTexture{NoCreate, Implementation::textureTarget()} {} diff --git a/src/Magnum/TextureArray.h b/src/Magnum/TextureArray.h index c9c25a5f4..371dc88cc 100644 --- a/src/Magnum/TextureArray.h +++ b/src/Magnum/TextureArray.h @@ -173,6 +173,9 @@ template class TextureArray: public AbstractTexture { * The constructed instance is equivalent to moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. + * + * This function can be safely used for constructing (and later + * destructing) objects even without any OpenGL context being active. * @see @ref TextureArray(), @ref wrap() */ explicit TextureArray(NoCreateT) noexcept: AbstractTexture{NoCreate, Implementation::textureArrayTarget()} {} diff --git a/src/Magnum/TimeQuery.h b/src/Magnum/TimeQuery.h index 23c1649d2..57913b773 100644 --- a/src/Magnum/TimeQuery.h +++ b/src/Magnum/TimeQuery.h @@ -145,6 +145,9 @@ class TimeQuery: public AbstractQuery { * The constructed instance is equivalent to moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. + * + * This function can be safely used for constructing (and later + * destructing) objects even without any OpenGL context being active. * @see @ref TimeQuery(Target), @ref wrap() */ explicit TimeQuery(NoCreateT) noexcept: AbstractQuery{NoCreate, GLenum(Target::TimeElapsed)} {} diff --git a/src/Magnum/TransformFeedback.h b/src/Magnum/TransformFeedback.h index 3e3fa5cd2..a95b7ed7e 100644 --- a/src/Magnum/TransformFeedback.h +++ b/src/Magnum/TransformFeedback.h @@ -194,6 +194,9 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject { * The constructed instance is equivalent to moved-from state. Useful * in cases where you will overwrite the instance later anyway. Move * another object over it to make it useful. + * + * This function can be safely used for constructing (and later + * destructing) objects even without any OpenGL context being active. * @see @ref TransformFeedback(), @ref wrap() */ explicit TransformFeedback(NoCreateT) noexcept: _id{0}, _flags{ObjectFlag::DeleteOnDestruction} {}