summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 7b498c7..a333712 100644
--- a/src/main.c
+++ b/src/main.c
@@ -54,6 +54,28 @@ int main() {
     printf("ERROR::SHADER::VERTEX::COMPILATION_FAILED %s\n", info_log);
   }
 
+  const char *fragment_shader_src =
+      "#version 330 core\n"
+      "out vec4 FragColor;\n"
+      "void main()\n"
+      "{\n"
+      " FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);\n"
+      "}\0";
+
+  unsigned int fragment_shader;
+  fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
+  glShaderSource(fragment_shader, 1, &fragment_shader_src, NULL);
+  glCompileShader(fragment_shader);
+  glGetShaderiv(fragment_shader, GL_COMPILE_STATUS, &success);
+
+  if (!success) {
+    glGetShaderInfoLog(fragment_shader, 512, NULL, info_log);
+    printf("ERROR::SHADER::FRAGMENT::COMPILATION_FAILED %s\n", info_log);
+  }
+
+  unsigned int shader_program;
+  shader_program = glCreateProgram();
+
   while (!glfwWindowShouldClose(window)) {
     glClearColor(0.1f, 0.1f, 0.25f, 0.0f);
     glClear(GL_COLOR_BUFFER_BIT);