mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 07:53:53 +00:00
Merge remote-tracking branch 'swick/master'
This commit is contained in:
commit
847ec9fa56
3 changed files with 16 additions and 2 deletions
|
@ -369,6 +369,7 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
|
|||
windowSettings.fullscreen = settings.getBool("fullscreen", "Video");
|
||||
windowSettings.window_x = settings.getInt("resolution x", "Video");
|
||||
windowSettings.window_y = settings.getInt("resolution y", "Video");
|
||||
windowSettings.screen = settings.getInt("screen", "Video");
|
||||
windowSettings.vsync = settings.getBool("vsync", "Video");
|
||||
windowSettings.icon = "openmw.png";
|
||||
std::string aa = settings.getString("antialiasing", "Video");
|
||||
|
|
|
@ -266,11 +266,23 @@ void OgreRenderer::createWindow(const std::string &title, const WindowSettings&
|
|||
params.insert(std::make_pair("FSAA", settings.fsaa));
|
||||
params.insert(std::make_pair("vsync", settings.vsync ? "true" : "false"));
|
||||
|
||||
int pos_x = SDL_WINDOWPOS_UNDEFINED,
|
||||
pos_y = SDL_WINDOWPOS_UNDEFINED;
|
||||
|
||||
if(settings.fullscreen)
|
||||
{
|
||||
SDL_Rect display_bounds;
|
||||
if(SDL_GetDisplayBounds(settings.screen, &display_bounds) != 0)
|
||||
throw std::runtime_error("Couldn't get display bounds!");
|
||||
pos_x = display_bounds.x;
|
||||
pos_y = display_bounds.y;
|
||||
}
|
||||
|
||||
// Create an application window with the following settings:
|
||||
mSDLWindow = SDL_CreateWindow(
|
||||
"OpenMW", // window title
|
||||
SDL_WINDOWPOS_UNDEFINED, // initial x position
|
||||
SDL_WINDOWPOS_UNDEFINED, // initial y position
|
||||
pos_x, // initial x position
|
||||
pos_y, // initial y position
|
||||
settings.window_x, // width, in pixels
|
||||
settings.window_y, // height, in pixels
|
||||
SDL_WINDOW_SHOWN
|
||||
|
|
|
@ -56,6 +56,7 @@ namespace OEngine
|
|||
bool vsync;
|
||||
bool fullscreen;
|
||||
int window_x, window_y;
|
||||
int screen;
|
||||
std::string fsaa;
|
||||
std::string icon;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue