Added True Type fonts
This commit is contained in:
@ -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) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
#define WINDOW_HEIGHT_DEFAULT 270
|
||||
|
||||
/** The current running game state. */
|
||||
extern game_t GAME_STATE;
|
||||
extern game_t *GAME_STATE;
|
||||
|
||||
/** The GLFW Window Context Pointer */
|
||||
extern GLFWwindow *window;
|
||||
|
Reference in New Issue
Block a user