|
|
|
@ -24,9 +24,11 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
#include <numeric> |
|
|
|
#include <numeric> |
|
|
|
|
|
|
|
#include <sstream> |
|
|
|
#include <Corrade/Containers/ArrayViewStl.h> |
|
|
|
#include <Corrade/Containers/ArrayViewStl.h> |
|
|
|
#include <Corrade/Containers/StridedArrayView.h> |
|
|
|
#include <Corrade/Containers/StridedArrayView.h> |
|
|
|
#include <Corrade/PluginManager/Manager.h> |
|
|
|
#include <Corrade/PluginManager/Manager.h> |
|
|
|
|
|
|
|
#include <Corrade/Utility/DebugStl.h> |
|
|
|
#include <Corrade/Utility/Directory.h> |
|
|
|
#include <Corrade/Utility/Directory.h> |
|
|
|
|
|
|
|
|
|
|
|
#include "Magnum/DebugTools/CompareImage.h" |
|
|
|
#include "Magnum/DebugTools/CompareImage.h" |
|
|
|
@ -67,6 +69,8 @@ struct MeshVisualizerGLTest: GL::OpenGLTester { |
|
|
|
|
|
|
|
|
|
|
|
void constructMove(); |
|
|
|
void constructMove(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setWireframeNotEnabled(); |
|
|
|
|
|
|
|
|
|
|
|
void renderSetup(); |
|
|
|
void renderSetup(); |
|
|
|
void renderTeardown(); |
|
|
|
void renderTeardown(); |
|
|
|
|
|
|
|
|
|
|
|
@ -121,7 +125,9 @@ MeshVisualizerGLTest::MeshVisualizerGLTest() { |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
&MeshVisualizerGLTest::constructWireframeNoGeometryShader, |
|
|
|
&MeshVisualizerGLTest::constructWireframeNoGeometryShader, |
|
|
|
|
|
|
|
|
|
|
|
&MeshVisualizerGLTest::constructMove}); |
|
|
|
&MeshVisualizerGLTest::constructMove, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&MeshVisualizerGLTest::setWireframeNotEnabled}); |
|
|
|
|
|
|
|
|
|
|
|
addTests({&MeshVisualizerGLTest::renderDefaults, |
|
|
|
addTests({&MeshVisualizerGLTest::renderDefaults, |
|
|
|
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) |
|
|
|
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) |
|
|
|
@ -218,6 +224,21 @@ void MeshVisualizerGLTest::constructMove() { |
|
|
|
CORRADE_VERIFY(!b.id()); |
|
|
|
CORRADE_VERIFY(!b.id()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MeshVisualizerGLTest::setWireframeNotEnabled() { |
|
|
|
|
|
|
|
std::ostringstream out; |
|
|
|
|
|
|
|
Error redirectError{&out}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MeshVisualizer shader; |
|
|
|
|
|
|
|
shader.setWireframeColor({}) |
|
|
|
|
|
|
|
.setWireframeWidth({}) |
|
|
|
|
|
|
|
.setSmoothness({}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CORRADE_COMPARE(out.str(), |
|
|
|
|
|
|
|
"Shaders::MeshVisualizer::setWireframeColor(): the shader was not created with wireframe enabled\n" |
|
|
|
|
|
|
|
"Shaders::MeshVisualizer::setWireframeWidth(): the shader was not created with wireframe enabled\n" |
|
|
|
|
|
|
|
"Shaders::MeshVisualizer::setSmoothness(): the shader was not created with wireframe enabled\n"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
constexpr Vector2i RenderSize{80, 80}; |
|
|
|
constexpr Vector2i RenderSize{80, 80}; |
|
|
|
|
|
|
|
|
|
|
|
void MeshVisualizerGLTest::renderSetup() { |
|
|
|
void MeshVisualizerGLTest::renderSetup() { |
|
|
|
|