summaryrefslogtreecommitdiff
path: root/c/opengl.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/opengl.c')
-rw-r--r--c/opengl.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/c/opengl.c b/c/opengl.c
new file mode 100644
index 0000000..9504fce
--- /dev/null
+++ b/c/opengl.c
@@ -0,0 +1,26 @@
+#include <GLFW/glfw3.h>
+#include <stdio.h>
+
+int main() {
+ glfwInit();
+
+ GLFWwindow* window = glfwCreateWindow(400, 400, "baller", NULL, NULL);
+ glfwMakeContextCurrent(window);
+
+ while (!glfwWindowShouldClose(window)) {
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_QUADS);
+ glVertex2f(-0.5f, -0.5f);
+ glVertex2f( 0.5f, -0.5f);
+ glVertex2f( 0.5f, 0.5f);
+ glVertex2f(-0.5f, 0.5f);
+ glEnd();
+
+ glfwSwapBuffers(window);
+ glfwPollEvents();
+ }
+
+ glfwTerminate();
+ return 0;
+}