Center game window
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user