Fixed linux compat

This commit is contained in:
Patrick Schwarzer 2026-02-02 05:17:17 +01:00
parent 89e47fa56c
commit 2aa836478e
2 changed files with 5 additions and 1 deletions

View file

@ -1,4 +1,4 @@
#version 330 core
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aColor;
layout (location = 2) in vec2 aTexCoord;

View file

@ -42,6 +42,10 @@ public:
// Save the contents to our strings
vertexCode = vertexStream.str();
fragmentCode = fragmentStream.str();
// Fix encoding issues, specifically for Linux
vertexCode.erase(std::remove(vertexCode.begin(), vertexCode.end(), '\r'), vertexCode.end());
fragmentCode.erase(std::remove(fragmentCode.begin(), fragmentCode.end(), '\r'), fragmentCode.end());
}
catch (std::ifstream::failure& e)
{