src/gl/compiler.cpp

changeset 250
2837b549e616
parent 211
b27b90fb993f
child 259
c27612f0eac0
--- a/src/gl/compiler.cpp	Wed Jun 22 16:13:15 2022 +0300
+++ b/src/gl/compiler.cpp	Wed Jun 22 16:53:35 2022 +0300
@@ -25,7 +25,7 @@
 #include "invert.h"
 #include "ring.h"
 
-static const char* vertexShaderSource = R"(
+constexpr char VERTEX_SHADER_SOURCE[] = R"(
 #version 330 core
 
 layout(location=0) in vec3 position;
@@ -97,7 +97,7 @@
 }
 )";
 
-static const char* fragmentShaderSource = R"(
+constexpr char FRAGMENT_SHADER_SOURCE[] = R"(
 #version 330 core
 
 in vec4 vColor;
@@ -198,7 +198,7 @@
 	if (not modelShaders->initialized) {
 		for (auto& shader : modelShaders->shaderObjects) {
 			shader.program = std::make_unique<QOpenGLShaderProgram>();
-			gl::buildShaders(shader.program.get(), ::vertexShaderSource, ::fragmentShaderSource);
+			gl::buildShaders(shader.program.get(), VERTEX_SHADER_SOURCE, FRAGMENT_SHADER_SOURCE);
 			shader.program->bind();
 			shader.buffer.create();
 			shader.buffer.bind();

mercurial