extract input to file
This commit is contained in:
parent
4700579877
commit
730cb70b39
|
@ -0,0 +1,10 @@
|
||||||
|
#include "input.h"
|
||||||
|
|
||||||
|
int checkQuit()
|
||||||
|
{
|
||||||
|
SDL_Event event;
|
||||||
|
|
||||||
|
if (SDL_PollEvent(&event) && event.type == SDL_QUIT) return 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <SDL2/SDL.h>
|
||||||
|
|
||||||
|
int checkQuit();
|
14
src/main.c
14
src/main.c
|
@ -8,10 +8,6 @@ const int WIDTH = 420;
|
||||||
const int HEIGHT = 420;
|
const int HEIGHT = 420;
|
||||||
|
|
||||||
// forward declarations
|
// forward declarations
|
||||||
|
|
||||||
// input
|
|
||||||
int checkQuit();
|
|
||||||
|
|
||||||
void updateUniforms(GLuint shaderProgram);
|
void updateUniforms(GLuint shaderProgram);
|
||||||
void updateCameraUniforms(GLuint shaderProgram);
|
void updateCameraUniforms(GLuint shaderProgram);
|
||||||
|
|
||||||
|
@ -166,13 +162,3 @@ void updateCameraUniforms(GLuint shaderProgram)
|
||||||
int camllLocation = glGetUniformLocation(shaderProgram, "_camll");
|
int camllLocation = glGetUniformLocation(shaderProgram, "_camll");
|
||||||
glUniform3f(camllLocation, camll[0], camll[1], camll[2]);
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue