summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/sdl/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/sdl/window.c')
-rw-r--r--src/osd/sdl/window.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/osd/sdl/window.c b/src/osd/sdl/window.c
index 88325d682ad..12a3fdb1e3d 100644
--- a/src/osd/sdl/window.c
+++ b/src/osd/sdl/window.c
@@ -407,8 +407,7 @@ void sdl_window_info::blit_surface_size(int window_width, int window_height)
if (video_config.keepaspect)
{
// make sure the monitor is up-to-date
- sdlvideo_monitor_refresh(m_monitor);
- target->compute_visible_area(target_width, target_height, sdlvideo_monitor_get_aspect(m_monitor), target->orientation(), target_width, target_height);
+ target->compute_visible_area(target_width, target_height, m_monitor->aspect(), target->orientation(), target_width, target_height);
desired_aspect = (float)target_width / (float)target_height;
}
@@ -849,7 +848,7 @@ void sdl_window_info::pick_best_mode(int *fswidth, int *fsheight)
minimum_height -= 4;
}
- num = SDL_GetNumDisplayModes(m_monitor->handle);
+ num = SDL_GetNumDisplayModes(m_monitor->handle());
if (num == 0)
{
@@ -861,7 +860,7 @@ void sdl_window_info::pick_best_mode(int *fswidth, int *fsheight)
for (i = 0; i < num; ++i)
{
SDL_DisplayMode mode;
- SDL_GetDisplayMode(m_monitor->handle, i, &mode);
+ SDL_GetDisplayMode(m_monitor->handle(), i, &mode);
// compute initial score based on difference between target and current
size_score = 1.0f / (1.0f + fabsf((INT32)mode.w - target_width) + fabsf((INT32)mode.h - target_height));
@@ -1024,7 +1023,7 @@ void sdl_window_info::video_window_update(running_machine &machine)
}
else
{
- blit_surface_size(monitor()->center_width, monitor()->center_height);
+ blit_surface_size(monitor()->center_width(), monitor()->center_height());
}
// ensure the target bounds are up-to-date, and then get the primitives
@@ -1083,8 +1082,8 @@ static OSDWORK_CALLBACK( complete_create_wt )
if (window->fullscreen())
{
// default to the current mode exactly
- tempwidth = window->monitor()->monitor_width;
- tempheight = window->monitor()->monitor_height;
+ tempwidth = window->monitor()->position_size().w;
+ tempheight = window->monitor()->position_size().h;
// if we're allowed to switch resolutions, override with something better
if (video_config.switchres)
@@ -1225,11 +1224,8 @@ void sdl_window_info::constrain_to_aspect_ratio(int *window_width, int *window_h
INT32 viswidth, visheight;
float pixel_aspect;
- // make sure the monitor is up-to-date
- sdlvideo_monitor_refresh(m_monitor);
-
// get the pixel aspect ratio for the target monitor
- pixel_aspect = sdlvideo_monitor_get_aspect(m_monitor);
+ pixel_aspect = m_monitor->aspect();
// determine the proposed width/height
propwidth = *window_width - extrawidth;
@@ -1268,13 +1264,13 @@ void sdl_window_info::constrain_to_aspect_ratio(int *window_width, int *window_h
// clamp against the maximum (fit on one screen for full screen mode)
if (this->m_fullscreen)
{
- maxwidth = m_monitor->center_width - extrawidth;
- maxheight = m_monitor->center_height - extraheight;
+ maxwidth = m_monitor->center_width() - extrawidth;
+ maxheight = m_monitor->center_height() - extraheight;
}
else
{
- maxwidth = m_monitor->center_width - extrawidth;
- maxheight = m_monitor->center_height - extraheight;
+ maxwidth = m_monitor->center_width() - extrawidth;
+ maxheight = m_monitor->center_height() - extraheight;
// further clamp to the maximum width/height in the window
if (this->m_maxwidth != 0)
@@ -1355,8 +1351,8 @@ void sdl_window_info::get_max_bounds(int *window_width, int *window_height, int
INT32 maxwidth, maxheight;
// compute the maximum client area
- maxwidth = m_monitor->center_width;
- maxheight = m_monitor->center_height;
+ maxwidth = m_monitor->center_width();
+ maxheight = m_monitor->center_height();
// clamp to the window's max
if (this->m_maxwidth != 0)