From 83ac4c41bc447a3372769f2b3ef6e3119d2717a2 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 14 Mar 2022 21:31:43 -0400 Subject: window starts in centre of screen --- src/renderer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/renderer.cpp') diff --git a/src/renderer.cpp b/src/renderer.cpp index 87e6553..21c4746 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -3,11 +3,14 @@ Renderer::Renderer() { + SDL_DisplayMode displayMode; + SDL_GetDesktopDisplayMode(0, &displayMode); + win_ = window_ptr( SDL_CreateWindow( "Ether", - 100, - 100, + displayMode.w / 2 - GAME_WIDTH / 2, + displayMode.h / 2 - GAME_HEIGHT / 2, GAME_WIDTH, GAME_HEIGHT, SDL_WINDOW_SHOWN)); -- cgit 1.4.1