mirror of https://github.com/mosra/magnum.git
Browse Source
Makes it possible to have instance of them even before any context is active.pull/196/head
14 changed files with 442 additions and 0 deletions
@ -0,0 +1,64 @@
|
||||
/*
|
||||
This file is part of Magnum. |
||||
|
||||
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 |
||||
Vladimír Vondruš <mosra@centrum.cz> |
||||
|
||||
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 <Corrade/TestSuite/Tester.h> |
||||
|
||||
#include "Magnum/Shaders/DistanceFieldVector.h" |
||||
|
||||
namespace Magnum { namespace Shaders { namespace Test { |
||||
|
||||
struct DistanceFieldVectorTest: TestSuite::Tester { |
||||
explicit DistanceFieldVectorTest(); |
||||
|
||||
void constructNoCreate2D(); |
||||
void constructNoCreate3D(); |
||||
}; |
||||
|
||||
DistanceFieldVectorTest::DistanceFieldVectorTest() { |
||||
addTests({&DistanceFieldVectorTest::constructNoCreate2D, |
||||
&DistanceFieldVectorTest::constructNoCreate3D}); |
||||
} |
||||
|
||||
void DistanceFieldVectorTest::constructNoCreate2D() { |
||||
{ |
||||
Shaders::DistanceFieldVector2D shader{NoCreate}; |
||||
CORRADE_COMPARE(shader.id(), 0); |
||||
} |
||||
|
||||
CORRADE_VERIFY(true); |
||||
} |
||||
|
||||
void DistanceFieldVectorTest::constructNoCreate3D() { |
||||
{ |
||||
Shaders::DistanceFieldVector3D shader{NoCreate}; |
||||
CORRADE_COMPARE(shader.id(), 0); |
||||
} |
||||
|
||||
CORRADE_VERIFY(true); |
||||
} |
||||
|
||||
}}} |
||||
|
||||
CORRADE_TEST_MAIN(Magnum::Shaders::Test::DistanceFieldVectorTest) |
||||
@ -0,0 +1,64 @@
|
||||
/*
|
||||
This file is part of Magnum. |
||||
|
||||
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 |
||||
Vladimír Vondruš <mosra@centrum.cz> |
||||
|
||||
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 <Corrade/TestSuite/Tester.h> |
||||
|
||||
#include "Magnum/Shaders/Flat.h" |
||||
|
||||
namespace Magnum { namespace Shaders { namespace Test { |
||||
|
||||
struct FlatTest: TestSuite::Tester { |
||||
explicit FlatTest(); |
||||
|
||||
void constructNoCreate2D(); |
||||
void constructNoCreate3D(); |
||||
}; |
||||
|
||||
FlatTest::FlatTest() { |
||||
addTests({&FlatTest::constructNoCreate2D, |
||||
&FlatTest::constructNoCreate3D}); |
||||
} |
||||
|
||||
void FlatTest::constructNoCreate2D() { |
||||
{ |
||||
Shaders::Flat2D shader{NoCreate}; |
||||
CORRADE_COMPARE(shader.id(), 0); |
||||
} |
||||
|
||||
CORRADE_VERIFY(true); |
||||
} |
||||
|
||||
void FlatTest::constructNoCreate3D() { |
||||
{ |
||||
Shaders::Flat3D shader{NoCreate}; |
||||
CORRADE_COMPARE(shader.id(), 0); |
||||
} |
||||
|
||||
CORRADE_VERIFY(true); |
||||
} |
||||
|
||||
}}} |
||||
|
||||
CORRADE_TEST_MAIN(Magnum::Shaders::Test::FlatTest) |
||||
@ -0,0 +1,53 @@
|
||||
/*
|
||||
This file is part of Magnum. |
||||
|
||||
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 |
||||
Vladimír Vondruš <mosra@centrum.cz> |
||||
|
||||
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 <Corrade/TestSuite/Tester.h> |
||||
|
||||
#include "Magnum/Shaders/MeshVisualizer.h" |
||||
|
||||
namespace Magnum { namespace Shaders { namespace Test { |
||||
|
||||
struct MeshVisualizerTest: TestSuite::Tester { |
||||
explicit MeshVisualizerTest(); |
||||
|
||||
void constructNoCreate(); |
||||
}; |
||||
|
||||
MeshVisualizerTest::MeshVisualizerTest() { |
||||
addTests({&MeshVisualizerTest::constructNoCreate}); |
||||
} |
||||
|
||||
void MeshVisualizerTest::constructNoCreate() { |
||||
{ |
||||
Shaders::MeshVisualizer shader{NoCreate}; |
||||
CORRADE_COMPARE(shader.id(), 0); |
||||
} |
||||
|
||||
CORRADE_VERIFY(true); |
||||
} |
||||
|
||||
}}} |
||||
|
||||
CORRADE_TEST_MAIN(Magnum::Shaders::Test::MeshVisualizerTest) |
||||
@ -0,0 +1,53 @@
|
||||
/*
|
||||
This file is part of Magnum. |
||||
|
||||
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 |
||||
Vladimír Vondruš <mosra@centrum.cz> |
||||
|
||||
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 <Corrade/TestSuite/Tester.h> |
||||
|
||||
#include "Magnum/Shaders/Phong.h" |
||||
|
||||
namespace Magnum { namespace Shaders { namespace Test { |
||||
|
||||
struct PhongTest: TestSuite::Tester { |
||||
explicit PhongTest(); |
||||
|
||||
void constructNoCreate(); |
||||
}; |
||||
|
||||
PhongTest::PhongTest() { |
||||
addTests({&PhongTest::constructNoCreate}); |
||||
} |
||||
|
||||
void PhongTest::constructNoCreate() { |
||||
{ |
||||
Shaders::Phong shader{NoCreate}; |
||||
CORRADE_COMPARE(shader.id(), 0); |
||||
} |
||||
|
||||
CORRADE_VERIFY(true); |
||||
} |
||||
|
||||
}}} |
||||
|
||||
CORRADE_TEST_MAIN(Magnum::Shaders::Test::PhongTest) |
||||
@ -0,0 +1,64 @@
|
||||
/*
|
||||
This file is part of Magnum. |
||||
|
||||
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 |
||||
Vladimír Vondruš <mosra@centrum.cz> |
||||
|
||||
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 <Corrade/TestSuite/Tester.h> |
||||
|
||||
#include "Magnum/Shaders/Vector.h" |
||||
|
||||
namespace Magnum { namespace Shaders { namespace Test { |
||||
|
||||
struct VectorTest: TestSuite::Tester { |
||||
explicit VectorTest(); |
||||
|
||||
void constructNoCreate2D(); |
||||
void constructNoCreate3D(); |
||||
}; |
||||
|
||||
VectorTest::VectorTest() { |
||||
addTests({&VectorTest::constructNoCreate2D, |
||||
&VectorTest::constructNoCreate3D}); |
||||
} |
||||
|
||||
void VectorTest::constructNoCreate2D() { |
||||
{ |
||||
Shaders::Vector2D shader{NoCreate}; |
||||
CORRADE_COMPARE(shader.id(), 0); |
||||
} |
||||
|
||||
CORRADE_VERIFY(true); |
||||
} |
||||
|
||||
void VectorTest::constructNoCreate3D() { |
||||
{ |
||||
Shaders::Vector3D shader{NoCreate}; |
||||
CORRADE_COMPARE(shader.id(), 0); |
||||
} |
||||
|
||||
CORRADE_VERIFY(true); |
||||
} |
||||
|
||||
}}} |
||||
|
||||
CORRADE_TEST_MAIN(Magnum::Shaders::Test::VectorTest) |
||||
@ -0,0 +1,64 @@
|
||||
/*
|
||||
This file is part of Magnum. |
||||
|
||||
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 |
||||
Vladimír Vondruš <mosra@centrum.cz> |
||||
|
||||
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 <Corrade/TestSuite/Tester.h> |
||||
|
||||
#include "Magnum/Shaders/VertexColor.h" |
||||
|
||||
namespace Magnum { namespace Shaders { namespace Test { |
||||
|
||||
struct VertexColorTest: TestSuite::Tester { |
||||
explicit VertexColorTest(); |
||||
|
||||
void constructNoCreate2D(); |
||||
void constructNoCreate3D(); |
||||
}; |
||||
|
||||
VertexColorTest::VertexColorTest() { |
||||
addTests({&VertexColorTest::constructNoCreate2D, |
||||
&VertexColorTest::constructNoCreate3D}); |
||||
} |
||||
|
||||
void VertexColorTest::constructNoCreate2D() { |
||||
{ |
||||
Shaders::VertexColor2D shader{NoCreate}; |
||||
CORRADE_COMPARE(shader.id(), 0); |
||||
} |
||||
|
||||
CORRADE_VERIFY(true); |
||||
} |
||||
|
||||
void VertexColorTest::constructNoCreate3D() { |
||||
{ |
||||
Shaders::VertexColor3D shader{NoCreate}; |
||||
CORRADE_COMPARE(shader.id(), 0); |
||||
} |
||||
|
||||
CORRADE_VERIFY(true); |
||||
} |
||||
|
||||
}}} |
||||
|
||||
CORRADE_TEST_MAIN(Magnum::Shaders::Test::VertexColorTest) |
||||
Loading…
Reference in new issue