|
|
|
|
@ -56,10 +56,14 @@ struct ContextTest: TestSuite::Tester {
|
|
|
|
|
void extensions(); |
|
|
|
|
|
|
|
|
|
void debugFlag(); |
|
|
|
|
void debugFlagPacked(); |
|
|
|
|
void debugFlags(); |
|
|
|
|
void debugFlagsPacked(); |
|
|
|
|
|
|
|
|
|
void debugDetectedDriver(); |
|
|
|
|
void debugDetectedDriverPacked(); |
|
|
|
|
void debugDetectedDrivers(); |
|
|
|
|
void debugDetectedDriversPacked(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
ContextTest::ContextTest() { |
|
|
|
|
@ -78,10 +82,14 @@ ContextTest::ContextTest() {
|
|
|
|
|
&ContextTest::extensions, |
|
|
|
|
|
|
|
|
|
&ContextTest::debugFlag, |
|
|
|
|
&ContextTest::debugFlagPacked, |
|
|
|
|
&ContextTest::debugFlags, |
|
|
|
|
&ContextTest::debugFlagsPacked, |
|
|
|
|
|
|
|
|
|
&ContextTest::debugDetectedDriver, |
|
|
|
|
&ContextTest::debugDetectedDrivers}); |
|
|
|
|
&ContextTest::debugDetectedDriverPacked, |
|
|
|
|
&ContextTest::debugDetectedDrivers, |
|
|
|
|
&ContextTest::debugDetectedDriversPacked}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ContextTest::isExtension() { |
|
|
|
|
@ -453,13 +461,35 @@ void ContextTest::debugFlag() {
|
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ContextTest::debugFlagPacked() { |
|
|
|
|
#ifdef MAGNUM_TARGET_WEBGL |
|
|
|
|
CORRADE_SKIP("No context flags on Emscripten yet."); |
|
|
|
|
#else |
|
|
|
|
std::ostringstream out; |
|
|
|
|
/* Last is not packed, ones before should not make any flags persistent */ |
|
|
|
|
Debug{&out} << Debug::packed << Context::Flag::Debug << Debug::packed << Context::Flag(0xdead) << Context::Flag::NoError; |
|
|
|
|
CORRADE_COMPARE(out.str(), "Debug 0xdead GL::Context::Flag::NoError\n"); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ContextTest::debugFlags() { |
|
|
|
|
#ifdef MAGNUM_TARGET_WEBGL |
|
|
|
|
CORRADE_SKIP("No context flags on Emscripten yet."); |
|
|
|
|
#else |
|
|
|
|
std::ostringstream out; |
|
|
|
|
Debug(&out) << Context::Flags{} << (Context::Flag::Debug|Context::Flag::NoError) << (Context::Flag::Debug|Context::Flag(0xded0)); |
|
|
|
|
CORRADE_COMPARE(out.str(), "GL::Context::Flags{} GL::Context::Flag::Debug|GL::Context::Flag::NoError GL::Context::Flag::Debug|GL::Context::Flag(0xded0)\n"); |
|
|
|
|
Debug{&out} << (Context::Flag::Debug|Context::Flag::NoError|Context::Flag(0xded0)) << Context::Flags{}; |
|
|
|
|
CORRADE_COMPARE(out.str(), "GL::Context::Flag::Debug|GL::Context::Flag::NoError|GL::Context::Flag(0xded0) GL::Context::Flags{}\n"); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ContextTest::debugFlagsPacked() { |
|
|
|
|
#ifdef MAGNUM_TARGET_WEBGL |
|
|
|
|
CORRADE_SKIP("No context flags on Emscripten yet."); |
|
|
|
|
#else |
|
|
|
|
std::ostringstream out; |
|
|
|
|
/* Last is not packed, ones before should not make any flags persistent */ |
|
|
|
|
Debug{&out} << Debug::packed << (Context::Flag::Debug|Context::Flag::NoError|Context::Flag(0xded0)) << Debug::packed << Context::Flags{} << (Context::Flag::Debug|Context::Flag::NoError); |
|
|
|
|
CORRADE_COMPARE(out.str(), "Debug|NoError|0xded0 {} GL::Context::Flag::Debug|GL::Context::Flag::NoError\n"); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -474,14 +504,38 @@ void ContextTest::debugDetectedDriver() {
|
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ContextTest::debugDetectedDriverPacked() { |
|
|
|
|
std::ostringstream out; |
|
|
|
|
/* Last is not packed, ones before should not make any flags persistent */ |
|
|
|
|
#ifndef MAGNUM_TARGET_WEBGL |
|
|
|
|
Debug{&out} << Debug::packed << Context::DetectedDriver::Amd << Debug::packed << Context::DetectedDriver(0xdead) << Context::DetectedDriver::NVidia; |
|
|
|
|
CORRADE_COMPARE(out.str(), "Amd 0xdead GL::Context::DetectedDriver::NVidia\n"); |
|
|
|
|
#else |
|
|
|
|
Debug{&out} << Debug::packed << Context::DetectedDriver::Angle << Debug::packed << Context::DetectedDriver(0xdead) << Context::DetectedDriver::Angle; |
|
|
|
|
CORRADE_COMPARE(out.str(), "Angle 0xdead GL::Context::DetectedDriver::Angle\n"); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ContextTest::debugDetectedDrivers() { |
|
|
|
|
std::ostringstream out; |
|
|
|
|
#ifndef MAGNUM_TARGET_WEBGL |
|
|
|
|
Debug{&out} << Context::DetectedDrivers{} << (Context::DetectedDriver::Amd|Context::DetectedDriver::NVidia) << (Context::DetectedDriver::Mesa|Context::DetectedDriver(0xde00)); |
|
|
|
|
CORRADE_COMPARE(out.str(), "GL::Context::DetectedDrivers{} GL::Context::DetectedDriver::Amd|GL::Context::DetectedDriver::NVidia GL::Context::DetectedDriver::Mesa|GL::Context::DetectedDriver(0xde00)\n"); |
|
|
|
|
Debug{&out} << (Context::DetectedDriver::Amd|Context::DetectedDriver::Mesa|Context::DetectedDriver(0xde00)) << Context::DetectedDrivers{}; |
|
|
|
|
CORRADE_COMPARE(out.str(), "GL::Context::DetectedDriver::Amd|GL::Context::DetectedDriver::Mesa|GL::Context::DetectedDriver(0xde00) GL::Context::DetectedDrivers{}\n"); |
|
|
|
|
#else |
|
|
|
|
Debug{&out} << (Context::DetectedDriver::Angle|Context::DetectedDriver(0xde00)) << Context::DetectedDrivers{}; |
|
|
|
|
CORRADE_COMPARE(out.str(), "GL::Context::DetectedDriver::Angle|GL::Context::DetectedDriver(0xde00) GL::Context::DetectedDrivers{}\n"); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ContextTest::debugDetectedDriversPacked() { |
|
|
|
|
std::ostringstream out; |
|
|
|
|
/* Last is not packed, ones before should not make any flags persistent */ |
|
|
|
|
#ifndef MAGNUM_TARGET_WEBGL |
|
|
|
|
Debug{&out} << Debug::packed << (Context::DetectedDriver::Amd|Context::DetectedDriver::Mesa|Context::DetectedDriver(0xde00)) << Debug::packed << Context::DetectedDrivers{} << (Context::DetectedDriver::Amd|Context::DetectedDriver::Mesa); |
|
|
|
|
CORRADE_COMPARE(out.str(), "Amd|Mesa|0xde00 {} GL::Context::DetectedDriver::Amd|GL::Context::DetectedDriver::Mesa\n"); |
|
|
|
|
#else |
|
|
|
|
Debug{&out} << Context::DetectedDrivers{} << (Context::DetectedDriver::Angle) << (Context::DetectedDriver::Angle|Context::DetectedDriver(0xde00)); |
|
|
|
|
CORRADE_COMPARE(out.str(), "GL::Context::DetectedDrivers{} GL::Context::DetectedDriver::Angle GL::Context::DetectedDriver::Angle|GL::Context::DetectedDriver(0xde00)\n"); |
|
|
|
|
Debug{&out} << Debug::packed << (Context::DetectedDriver::Angle|Context::DetectedDriver(0xde00)) << Debug::packed << Context::DetectedDrivers{} << (Context::DetectedDriver::Angle|Context::DetectedDriver(0xde00)); |
|
|
|
|
CORRADE_COMPARE(out.str(), "Angle|0xde00 {} GL::Context::DetectedDriver::Angle|GL::Context::DetectedDriver(0xde00)\n"); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|