summary refs log tree commit diff
diff options
context:
space:
mode:
authoriurii plugatarov <[email protected]>2024-08-07 20:16:41 +0200
committeriurii plugatarov <[email protected]>2024-08-07 20:16:41 +0200
commit07d31cd578dbc13024b15b60a8ae4c5eb1b06609 (patch)
treed225ed17843d6f44c8b5aa382659137d45e1dfd4
parent5ba3d169752a3f15289bf9bb03033b1786c50c29 (diff)
downloadogl-07d31cd578dbc13024b15b60a8ae4c5eb1b06609.tar.gz
frag
-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);