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);
}

View File

@ -42,4 +42,7 @@ void glfwOnResize(GLFWwindow *window, int32_t width, int32_t height);
*/
void glfwOnKey(GLFWwindow *window,
int32_t key, int32_t scancode, int32_t action, int32_t mods
);
);
void glfwOnError(int error, const char* description);