diff options
-rw-r--r-- | draw.c | 6 | ||||
-rw-r--r-- | draw.h | 7 | ||||
-rw-r--r-- | main.c | 6 | ||||
-rw-r--r-- | makefile | 1 |
4 files changed, 17 insertions, 3 deletions
@@ -0,0 +1,6 @@ +#include "draw.h" + +void draw(GLFWwindow* window) { + glClearColor(1.f, 0.f, 1.f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); +} @@ -0,0 +1,7 @@ +#pragma once + +#include <GLFW/glfw3.h> + +/** @brief draw loop iteration, called once for every frame */ +void draw(GLFWwindow*); + @@ -1,6 +1,7 @@ #include <stdlib.h> #include <GLFW/glfw3.h> +#include "draw.h" #include "die.h" void resize_handler(GLFWwindow* window, int width, int height) { @@ -28,10 +29,9 @@ int main(int argc, char** argv) { resize_handler(window, width, height); while (!glfwWindowShouldClose(window)) { - glClearColor(1.f, 0.f, 1.f, 1.0f); - glClear(GL_COLOR_BUFFER_BIT); - + draw(window); glfwSwapBuffers(window); + glfwPollEvents(); } glfwTerminate(); @@ -7,6 +7,7 @@ all: main FORCE main: main.o main: die.o +main: draw.o clean: FORCE git clean -fxdi |