diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-14 21:31:43 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-14 21:31:43 -0400 |
commit | 83ac4c41bc447a3372769f2b3ef6e3119d2717a2 (patch) | |
tree | 77a8e7db49b22d3672b398a94f919b5ca78e2e4a /src/renderer.cpp | |
parent | c3055098edaec16f844fc21731ecf391c8fefe33 (diff) | |
download | ether-83ac4c41bc447a3372769f2b3ef6e3119d2717a2.tar.gz ether-83ac4c41bc447a3372769f2b3ef6e3119d2717a2.tar.bz2 ether-83ac4c41bc447a3372769f2b3ef6e3119d2717a2.zip |
window starts in centre of screen
Diffstat (limited to 'src/renderer.cpp')
-rw-r--r-- | src/renderer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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 @@ | |||
3 | 3 | ||
4 | Renderer::Renderer() | 4 | Renderer::Renderer() |
5 | { | 5 | { |
6 | SDL_DisplayMode displayMode; | ||
7 | SDL_GetDesktopDisplayMode(0, &displayMode); | ||
8 | |||
6 | win_ = window_ptr( | 9 | win_ = window_ptr( |
7 | SDL_CreateWindow( | 10 | SDL_CreateWindow( |
8 | "Ether", | 11 | "Ether", |
9 | 100, | 12 | displayMode.w / 2 - GAME_WIDTH / 2, |
10 | 100, | 13 | displayMode.h / 2 - GAME_HEIGHT / 2, |
11 | GAME_WIDTH, | 14 | GAME_WIDTH, |
12 | GAME_HEIGHT, | 15 | GAME_HEIGHT, |
13 | SDL_WINDOW_SHOWN)); | 16 | SDL_WINDOW_SHOWN)); |