Added True Type fonts

This commit is contained in:
2021-05-23 10:53:00 -07:00
parent 98814982de
commit b0dce455f0
26 changed files with 575 additions and 167 deletions

View File

@ -5,7 +5,7 @@
#include "glwfwplatform.h"
game_t GAME_STATE;
game_t *GAME_STATE;
GLFWwindow *window = NULL;
@ -37,7 +37,8 @@ int32_t main() {
glfwSetErrorCallback(&glfwOnError);
// Prepare the game
game_t *game = &GAME_STATE;
game_t *game = malloc(sizeof(game_t));
GAME_STATE = game;
input_t *input = &game->engine.input;
// Init the game
@ -69,7 +70,7 @@ int32_t main() {
);
// Update the window title.
glfwSetWindowTitle(window, GAME_STATE.name);
glfwSetWindowTitle(window, GAME_STATE->name);
double time = 0;
@ -91,6 +92,7 @@ int32_t main() {
// Game has finished running, cleanup.
gameDispose(game);
}
free(game);
// Terminate the GLFW context.
glfwSetWindowSizeCallback(window, NULL);
@ -100,13 +102,13 @@ int32_t main() {
}
void glfwOnResize(GLFWwindow *window, int32_t width, int32_t height) {
renderSetResolution(&GAME_STATE.engine.render, width, height);
renderSetResolution(&GAME_STATE->engine.render, width, height);
}
void glfwOnKey(GLFWwindow *window,
int32_t key, int32_t scancode, int32_t action, int32_t mods
) {
input_t *input = &GAME_STATE.engine.input;
input_t *input = &GAME_STATE->engine.input;
if(action == GLFW_PRESS) {
input->buffer[key] = 1;
} else if(action == GLFW_RELEASE) {