// Copyright (c) 2021 Dominic Msters
// 
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

#pragma once

// I load GLAD and GLFW Here because they need to be included in specific orders
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <dawn/dawn.h>
#include "../../display/render.h"
#include "../../game/game.h"
#include "../../input/input.h"

#define WINDOW_WIDTH_DEFAULT 480
#define WINDOW_HEIGHT_DEFAULT 270

/** The current running game state. */
extern game_t *GAME_STATE;

/** The GLFW Window Context Pointer */
extern GLFWwindow *window;

/**
 * Entry of the program
 * @return 0 if success, anything else for failure.
 */
int32_t main();

/**
 * Resize callbacks.
 * 
 * @param window Window that was resized.
 * @param width New window width.
 * @param height New window height.
 */
void glfwOnResize(GLFWwindow *window, int32_t width, int32_t height);

/**
 * Keyboard Input callbacks.
 * 
 * @param window Window that was resized.
 */
void glfwOnKey(GLFWwindow *window,
  int32_t key, int32_t scancode, int32_t action, int32_t mods
);


void glfwOnError(int error, const char* description);