summaryrefslogtreecommitdiff
path: root/main.c
blob: 481f5f394067828d838fb8fdd5f8a910ecc056f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#define _POSIX_C_SOURCE 200809L
#define NONSTD_IMPLEMENTATION
#define VFS_IMPLEMENTATION
#include "all.h"

int main(void) {
    SetConfigFlags(FLAG_VSYNC_HINT | FLAG_WINDOW_RESIZABLE | FLAG_WINDOW_HIGHDPI);
    InitWindow(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE);

    int monitor = GetCurrentMonitor();
    SetWindowPosition((GetMonitorWidth(monitor) - GetScreenWidth()) / 2, 
                      (GetMonitorHeight(monitor) - GetScreenHeight()) / 2);
    
    SetTargetFPS(GetMonitorRefreshRate(monitor));

    vfs_init("data.pak");
    InitGame();
    game.vsync = true;

    while (!WindowShouldClose()) {
        UpdateGame();
        DrawGame();
    }

    vfs_shutdown();
    CloseWindow();

    return 0;
}