aboutsummaryrefslogtreecommitdiff
path: root/src/Platform/OpenGL/OpenGLShader.cpp
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-08-13 18:39:13 +0200
committerhachem <im@hachem.wtf>2025-08-13 18:39:13 +0200
commit8a0b2a59c9809d5fc8e6a30c2abc4d5af21aa39e (patch)
tree41adf621418b790100d207c1534236945b431d1e /src/Platform/OpenGL/OpenGLShader.cpp
parentf1517709556827fb8b7bab00bdee4a9794d88dd1 (diff)
[fix]: More consistent formatting
Diffstat (limited to 'src/Platform/OpenGL/OpenGLShader.cpp')
-rw-r--r--src/Platform/OpenGL/OpenGLShader.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Platform/OpenGL/OpenGLShader.cpp b/src/Platform/OpenGL/OpenGLShader.cpp
index 6fcaa74..b24e158 100644
--- a/src/Platform/OpenGL/OpenGLShader.cpp
+++ b/src/Platform/OpenGL/OpenGLShader.cpp
@@ -55,11 +55,15 @@ namespace Donut
std::string OpenGLShader::ReadFile(const std::string& filepath)
{
std::string result;
- std::ifstream in(filepath, std::ios::in | std::ios::binary);
- if (in) {
+ std::ifstream in(filepath, std::ios::in |
+ std::ios::binary);
+
+ if (in)
+ {
in.seekg(0, std::ios::end);
size_t size = in.tellg();
- if (size != -1) {
+ if (size != -1)
+ {
result.resize(size);
in.seekg(0, std::ios::beg);
in.read(&result[0], size);
@@ -75,6 +79,7 @@ namespace Donut
const char* typeToken = "#type";
size_t typeTokenLength = strlen(typeToken);
size_t pos = source.find(typeToken, 0);
+
while (pos != std::string::npos)
{
size_t eol = source.find_first_of("\r\n", pos);