hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/platform/opengl/opengl_shader.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
commit23086a5d33acc66414f1169bf22abe78b3383f94 (patch)
treea895c3e3ab8074118a84aada97ea990b60fba556 /src/platform/opengl/opengl_shader.cpp
parent2d8f706efe6e0a02b3238c2f22e7cdce620e9807 (diff)
fix: more consistent formatting
Diffstat (limited to 'src/platform/opengl/opengl_shader.cpp')
-rw-r--r--src/platform/opengl/opengl_shader.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/platform/opengl/opengl_shader.cpp b/src/platform/opengl/opengl_shader.cpp
index 10da3de..f4b99bc 100644
--- a/src/platform/opengl/opengl_shader.cpp
+++ b/src/platform/opengl/opengl_shader.cpp
@@ -55,11 +55,15 @@ namespace Donut
std::string OpenGLShader::read_file(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* type_token = "#type";
size_t type_token_length = strlen(type_token);
size_t pos = source.find(type_token, 0);
+
while (pos != std::string::npos)
{
size_t eol = source.find_first_of("\r\n", pos);