Court is now in session

This commit is contained in:
2021-05-06 21:13:37 -07:00
parent fab12c4f6d
commit f3ffc93927
12 changed files with 148 additions and 23 deletions

View File

@ -11,6 +11,11 @@ game_t *runningGame = NULL;
int32_t main() {
// Attempt to init GLFW
if(!glfwInit()) return NULL;
// Setup window hints
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, false);
// Create Window
window = glfwCreateWindow(WINDOW_WIDTH_DEFAULT, WINDOW_HEIGHT_DEFAULT,
"", NULL, NULL
);
@ -28,6 +33,8 @@ int32_t main() {
glfwSetWindowSizeCallback(window, &glfwOnResize);
glfwSetKeyCallback(window, &glfwOnKey);
glfwSetErrorCallback (&glfwOnError);
// Init the game
if(gameInit()) {
// Bind initial keys
@ -87,4 +94,8 @@ void glfwOnKey(GLFWwindow *window,
} else if(action == GLFW_RELEASE) {
INPUT_STATE.buffer[key] = 0;
}
}
void glfwOnError(int error, const char* description) {
fputs(description, stderr);
}