summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.h4
-rw-r--r--main.c11
2 files changed, 12 insertions, 3 deletions
diff --git a/config.h b/config.h
index 28d4604..54c015c 100644
--- a/config.h
+++ b/config.h
@@ -1,6 +1,10 @@
#ifndef CONFIG_H
#define CONFIG_H
+#define WINDOW_WIDTH 1280
+#define WINDOW_HEIGHT 720
+#define WINDOW_TITLE "Stalag"
+
#define PLAYER_MOVE_SPEED 400.0f
#define PLAYER_ROTATION_SPEED 0.05f
#define PLAYER_MOUSE_SENSITIVITY 0.003f
diff --git a/main.c b/main.c
index 4566a4f..481f5f3 100644
--- a/main.c
+++ b/main.c
@@ -4,9 +4,14 @@
#include "all.h"
int main(void) {
- SetConfigFlags(FLAG_VSYNC_HINT | FLAG_WINDOW_RESIZABLE);
- InitWindow(1920, 1080, "Stalag");
- SetTargetFPS(GetMonitorRefreshRate(GetCurrentMonitor()));
+ 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();