diff --git a/src/Magnum/GL/Shader.cpp b/src/Magnum/GL/Shader.cpp index e1be76a3f..8708fa4b9 100644 --- a/src/Magnum/GL/Shader.cpp +++ b/src/Magnum/GL/Shader.cpp @@ -30,10 +30,11 @@ #ifndef MAGNUM_TARGET_WEBGL #include #endif +#include /** @todo remove once Shader is -free */ #include #include #include -#include +#include #include "Magnum/GL/Context.h" #include "Magnum/GL/Extensions.h" @@ -740,10 +741,9 @@ void Shader::addSourceImplementationEmscriptenPthread(std::string source) { #endif Shader& Shader::addFile(const std::string& filename) { - CORRADE_ASSERT(Utility::Directory::exists(filename), - "GL::Shader file " << '\'' + filename + '\'' << " cannot be read.", *this); - - addSource(Utility::Directory::readString(filename)); + const Containers::Optional string = Utility::Path::readString(filename); + CORRADE_ASSERT(string, "GL::Shader::addFile(): can't read" << filename, *this); + addSource(*string); return *this; } diff --git a/src/Magnum/GL/Test/RendererGLTest.cpp b/src/Magnum/GL/Test/RendererGLTest.cpp index ae50d9a96..b9f0eb435 100644 --- a/src/Magnum/GL/Test/RendererGLTest.cpp +++ b/src/Magnum/GL/Test/RendererGLTest.cpp @@ -24,9 +24,14 @@ */ #include +#include #include #include -#include +#include + +#ifdef CORRADE_TARGET_APPLE +#include /* isSandboxed() */ +#endif #include "Magnum/Image.h" #include "Magnum/DebugTools/CompareImage.h" @@ -65,7 +70,7 @@ struct RendererGLTest: OpenGLTester { private: PluginManager::Manager _manager{"nonexistent"}; - std::string _testDir; + Containers::String _testDir; GL::Renderbuffer _color{NoCreate}; GL::Framebuffer _framebuffer{NoCreate}; @@ -95,13 +100,13 @@ RendererGLTest::RendererGLTest() { #endif #ifdef CORRADE_TARGET_APPLE - if(Utility::Directory::isSandboxed() + if(Utility::System::isSandboxed() #if defined(CORRADE_TARGET_IOS) && defined(CORRADE_TESTSUITE_TARGET_XCTEST) /** @todo Fix this once I persuade CMake to run XCTest tests properly */ && std::getenv("SIMULATOR_UDID") #endif ) { - _testDir = Utility::Directory::join(Utility::Directory::path(Utility::Directory::executableLocation()), "RendererGLTestFiles"); + _testDir = Utility::Path::join(Utility::Path::split(*Utility::Path::executableLocation()).first(), "RendererGLTestFiles"); } else #endif { @@ -232,7 +237,7 @@ void RendererGLTest::pointCoord() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {Magnum::PixelFormat::RGBA8Unorm}).pixels()), - Utility::Directory::join(_testDir, "pointcoord.tga"), + Utility::Path::join(_testDir, "pointcoord.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } diff --git a/src/Magnum/GL/Test/ShaderGLTest.cpp b/src/Magnum/GL/Test/ShaderGLTest.cpp index 47a6c4658..6701a5a4c 100644 --- a/src/Magnum/GL/Test/ShaderGLTest.cpp +++ b/src/Magnum/GL/Test/ShaderGLTest.cpp @@ -23,8 +23,9 @@ DEALINGS IN THE SOFTWARE. */ +#include /** @todo remove once Shader is -free */ #include -#include +#include #include "Magnum/GL/Context.h" #include "Magnum/GL/Extensions.h" @@ -243,7 +244,7 @@ void ShaderGLTest::addFile() { Shader shader(Version::GLES200, Shader::Type::Fragment); #endif - shader.addFile(Utility::Directory::join(SHADERGLTEST_FILES_DIR, "shader.glsl")); + shader.addFile(Utility::Path::join(SHADERGLTEST_FILES_DIR, "shader.glsl")); #ifndef MAGNUM_TARGET_GLES CORRADE_COMPARE(shader.sources(), (std::vector{