diff --git a/src/app/core/constants.h b/src/app/core/constants.h index 1ae9eab5..f9b49beb 100644 --- a/src/app/core/constants.h +++ b/src/app/core/constants.h @@ -119,13 +119,6 @@ namespace core { constexpr float kYazeVersion = 0.05; -// ============================================================================ -// Window Variables -// ============================================================================ - -constexpr int kScreenWidth = 1200; -constexpr int kScreenHeight = 800; - // ============================================================================ // Magic numbers // ============================================================================ diff --git a/src/app/core/controller.cc b/src/app/core/controller.cc index 9403127b..99d5b2b2 100644 --- a/src/app/core/controller.cc +++ b/src/app/core/controller.cc @@ -171,12 +171,17 @@ absl::Status Controller::CreateWindow() { return absl::InternalError( absl::StrFormat("SDL_Init: %s\n", SDL_GetError())); } else { + SDL_DisplayMode displayMode; + SDL_GetCurrentDisplayMode(0, &displayMode); + int screenWidth = displayMode.w * 0.8; + int screenHeight = displayMode.h * 0.8; + window_ = std::unique_ptr( SDL_CreateWindow("Yet Another Zelda3 Editor", // window title SDL_WINDOWPOS_UNDEFINED, // initial x position SDL_WINDOWPOS_UNDEFINED, // initial y position - kScreenWidth, // width, in pixels - kScreenHeight, // height, in pixels + screenWidth, // width, in pixels + screenHeight, // height, in pixels SDL_WINDOW_RESIZABLE), sdl_deleter()); if (window_ == nullptr) {