Center game window

This commit is contained in:
2024-01-02 19:21:45 +01:00
parent ef274d93fd
commit c83f0fb666

View File

@@ -144,6 +144,14 @@ int cmpDrawData(const void *a, const void *b) {
}
bool init(void *userData) {
// Center window
int monitor = GetCurrentMonitor();
int monitorWidth = GetMonitorWidth(monitor);
int monitorHeight = GetMonitorHeight(monitor);
int windowWidth = GetScreenWidth();
int windowHeight = GetScreenHeight();
SetWindowPosition((int)(monitorWidth / 2) - (int)(windowWidth / 2), (int)(monitorHeight / 2) - (int)(windowHeight / 2));
BZ_UNUSED(userData);
SetExitKey(0);