diff --git a/src/main.cc b/src/main.cc index 0e1fdd7..039ef8a 100644 --- a/src/main.cc +++ b/src/main.cc @@ -11,9 +11,11 @@ const char* vertexShaderCode = R"( // Set the GLSL version to 3.3 and use the OpenGL core profile #version 330 core layout (location = 0) in vec3 aPos; +out vec4 vertexColor; void main() { - gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0); + gl_Position = vec4(aPos, 1.0); + vertexColor = vec4(0.5, 0.0, 0.0, 1.0); } )"; @@ -21,9 +23,10 @@ const char* fragmentShaderCode = R"( // Set the GLSL version to 3.3 and use the OpenGL core profile #version 330 core out vec4 FragColor; +in vec4 vertexColor; void main() { - FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f); + FragColor = vertexColor; } )";