diff options
Diffstat (limited to 'src/osd/sdl/drawsdl.c')
-rw-r--r-- | src/osd/sdl/drawsdl.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/osd/sdl/drawsdl.c b/src/osd/sdl/drawsdl.c index 840f5fa62d6..3207391715c 100644 --- a/src/osd/sdl/drawsdl.c +++ b/src/osd/sdl/drawsdl.c @@ -65,11 +65,12 @@ public: m_last_hofs(0), m_last_vofs(0), m_old_blitwidth(0), - m_old_blitheight(0) + m_old_blitheight(0), + m_last_width(0), + m_last_height(0) { } - /* virtual */ int create(const int width, const int height); - /* virtual */ void resize(const int width, const int height); + /* virtual */ int create(); /* virtual */ int draw(const UINT32 dc, const int update); /* virtual */ int xy_to_render_target(const int x, const int y, int *xt, int *yt); /* virtual */ void destroy_all_textures(); @@ -107,6 +108,8 @@ public: int m_last_vofs; int m_old_blitwidth; int m_old_blitheight; + int m_last_width; + int m_last_height; }; struct sdl_scale_mode @@ -416,7 +419,7 @@ static void drawsdl_show_info(struct SDL_RendererInfo *render_info) // a //============================================================ -int sdl_info::create(int width, int height) +int sdl_info::create() { #if (SDLMAME_SDL2) @@ -462,7 +465,7 @@ int sdl_info::create(int width, int height) } } - setup_texture(width, height); + setup_texture(window().width(), window().height()); #else #endif @@ -475,24 +478,6 @@ int sdl_info::create(int width, int height) } //============================================================ -// sdl_info::resize -//============================================================ - -void sdl_info::resize(int width, int height) -{ -#if (SDLMAME_SDL2) - SDL_RenderSetViewport(m_sdl_renderer, NULL); -#else - const sdl_scale_mode *sdl_sm = &scale_modes[video_config.scale_mode]; - if (sdl_sm->is_yuv) - { - yuv_overlay_init(); - } -#endif -} - - -//============================================================ // sdl_info::destroy //============================================================ @@ -580,6 +565,21 @@ int sdl_info::draw(UINT32 dc, int update) return 0; } + if ((window().width() != m_last_width) || (window().height() != m_last_height)) + { + m_last_width = window().width(); + m_last_height = window().height(); +#if (SDLMAME_SDL2) + SDL_RenderSetViewport(m_sdl_renderer, NULL); +#else + const sdl_scale_mode *sdl_sm = &scale_modes[video_config.scale_mode]; + if (sdl_sm->is_yuv) + { + yuv_overlay_init(); + } +#endif + } + // lock it if we need it #if (!SDLMAME_SDL2) |