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

#pragma once

#include <dawn/dawn.h>
#include "../../src/display/render.h"
#include "../../src/game/game.h"
#include "../../src/input/input.h"

#define WINDOW_WIDTH_DEFAULT 1280
#define WINDOW_HEIGHT_DEFAULT WINDOW_WIDTH_DEFAULT/16*9

/** 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);
void glfwOnCursor(GLFWwindow *window, double x, double y);