diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-06-04 21:14:45 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-06-04 21:14:45 +0100 |
commit | 6e94848aec5d42eed5f9e1f5548ade26915ce90b (patch) | |
tree | b6cf5bc39f7da4c8853491da4008c29406b135f3 /gfx/gl | |
parent | Tidy of glRef (diff) | |
download | ilt-6e94848aec5d42eed5f9e1f5548ade26915ce90b.tar.bz2 ilt-6e94848aec5d42eed5f9e1f5548ade26915ce90b.tar.xz ilt-6e94848aec5d42eed5f9e1f5548ade26915ce90b.zip |
Tidy many stringy messes with std::format
Diffstat (limited to 'gfx/gl')
-rw-r--r-- | gfx/gl/program.cpp | 3 | ||||
-rw-r--r-- | gfx/gl/shader.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/gfx/gl/program.cpp b/gfx/gl/program.cpp index 0b60eaa..7287fde 100644 --- a/gfx/gl/program.cpp +++ b/gfx/gl/program.cpp @@ -1,5 +1,6 @@ #include "program.h" #include "shader.h" +#include <format> #include <glm/gtc/type_ptr.hpp> #include <glm/gtx/transform.hpp> #include <location.h> @@ -30,6 +31,6 @@ Program::RequiredUniformLocation::RequiredUniformLocation(GLuint program, const UniformLocation {program, name} { if (location < 0) { - throw std::logic_error(std::string {"Required uniform does not exist: "} + name); + throw std::logic_error {std::format("Required uniform does not exist: {}", name)}; } } diff --git a/gfx/gl/shader.cpp b/gfx/gl/shader.cpp index 0f75817..0bc127a 100644 --- a/gfx/gl/shader.cpp +++ b/gfx/gl/shader.cpp @@ -1,6 +1,7 @@ #include "shader.h" #include <algorithm> #include <array> +#include <format> #include <stdexcept> #include <string> @@ -70,6 +71,6 @@ Shader::CheckShaderError(GLuint shader, GLuint flag, bool isProgram, std::string glGetShaderInfoLog(shader, error.size(), nullptr, error.data()); } - throw std::runtime_error {std::string {errorMessage} + ": '" + std::string {error.data(), error.size()} + "'"}; + throw std::runtime_error {std::format("{}: '{}'", errorMessage, error.data())}; } } |