Refactor window hints
| Author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-04-28 09:38:05 +0200 |
| Committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-04-28 09:38:05 +0200 |
| Commit | 6c829e8b2e1e55342949ec66f119858bfb2cf582 (patch) |
|
| diff --git a/config.h b/config.h | |||
| 1 | #ifndef CONFIG_H |
1 | #ifndef CONFIG_H |
| 2 | #define CONFIG_H |
2 | #define CONFIG_H |
| 3 | 3 | ||
| 4 | #define WINDOW_WIDTH 1280 |
||
| 5 | #define WINDOW_HEIGHT 720 |
||
| 6 | #define WINDOW_TITLE "Stalag" |
||
| 7 | |||
| 4 | #define PLAYER_MOVE_SPEED 400.0f |
8 | #define PLAYER_MOVE_SPEED 400.0f |
| 5 | #define PLAYER_ROTATION_SPEED 0.05f |
9 | #define PLAYER_ROTATION_SPEED 0.05f |
| 6 | #define PLAYER_MOUSE_SENSITIVITY 0.003f |
10 | #define PLAYER_MOUSE_SENSITIVITY 0.003f |
| ... | |||
| diff --git a/main.c b/main.c | |||
| ... | |||
| 4 | #include "all.h" |
4 | #include "all.h" |
| 5 | 5 | ||
| 6 | int main(void) { |
6 | int main(void) { |
| 7 | SetConfigFlags(FLAG_VSYNC_HINT | FLAG_WINDOW_RESIZABLE); |
7 | SetConfigFlags(FLAG_VSYNC_HINT | FLAG_WINDOW_RESIZABLE | FLAG_WINDOW_HIGHDPI); |
| 8 | InitWindow(1920, 1080, "Stalag"); |
8 | InitWindow(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE); |
| 9 | SetTargetFPS(GetMonitorRefreshRate(GetCurrentMonitor())); |
9 | |
| 10 | int monitor = GetCurrentMonitor(); |
||
| 11 | SetWindowPosition((GetMonitorWidth(monitor) - GetScreenWidth()) / 2, |
||
| 12 | (GetMonitorHeight(monitor) - GetScreenHeight()) / 2); |
||
| 13 | |||
| 14 | SetTargetFPS(GetMonitorRefreshRate(monitor)); |
||
| 10 | 15 | ||
| 11 | vfs_init("data.pak"); |
16 | vfs_init("data.pak"); |
| 12 | InitGame(); |
17 | InitGame(); |
| ... | |||