diff --git a/src/input.c b/src/input.c new file mode 100644 index 0000000..b0ac944 --- /dev/null +++ b/src/input.c @@ -0,0 +1,10 @@ +#include "input.h" + +int checkQuit() +{ + SDL_Event event; + + if (SDL_PollEvent(&event) && event.type == SDL_QUIT) return 1; + + return 0; +} diff --git a/src/input.h b/src/input.h new file mode 100644 index 0000000..c361356 --- /dev/null +++ b/src/input.h @@ -0,0 +1,5 @@ +#pragma once + +#include + +int checkQuit(); diff --git a/src/main.c b/src/main.c index 056aad0..bbf88ba 100644 --- a/src/main.c +++ b/src/main.c @@ -8,10 +8,6 @@ const int WIDTH = 420; const int HEIGHT = 420; // forward declarations - -// input -int checkQuit(); - void updateUniforms(GLuint shaderProgram); void updateCameraUniforms(GLuint shaderProgram); @@ -166,13 +162,3 @@ void updateCameraUniforms(GLuint shaderProgram) int camllLocation = glGetUniformLocation(shaderProgram, "_camll"); glUniform3f(camllLocation, camll[0], camll[1], camll[2]); } - -int checkQuit() -{ - SDL_Event event; - - if (SDL_PollEvent(&event) && event.type == SDL_QUIT) return 1; - - return 0; -} -