summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/sdl/sdlmain.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2020-11-16 16:14:18 +1100
committer Vas Crabb <vas@vastheman.com>2020-11-16 16:14:18 +1100
commitfee9a29a57db8b426a0b0f136445a16fb32773ae (patch)
tree833d3b2d110acee4413c41b3702c5a4356222fac /src/osd/sdl/sdlmain.cpp
parent162a7b9157b57c622b53198e14ad690eabbb80f7 (diff)
osd/modules/input: Fixed a couple of X11 resource leaks.
Diffstat (limited to 'src/osd/sdl/sdlmain.cpp')
-rw-r--r--src/osd/sdl/sdlmain.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/osd/sdl/sdlmain.cpp b/src/osd/sdl/sdlmain.cpp
index 37d1434a2e8..5e0b12cef3b 100644
--- a/src/osd/sdl/sdlmain.cpp
+++ b/src/osd/sdl/sdlmain.cpp
@@ -440,25 +440,25 @@ void sdl_osd_interface::init(running_machine &machine)
osd_setenv(SDLENV_VIDEODRIVER, stemp, 1);
}
- stemp = options().render_driver();
- if (stemp != nullptr)
+ stemp = options().render_driver();
+ if (stemp != nullptr)
+ {
+ if (strcmp(stemp, OSDOPTVAL_AUTO) != 0)
+ {
+ osd_printf_verbose("Setting SDL renderdriver '%s' ...\n", stemp);
+ //osd_setenv(SDLENV_RENDERDRIVER, stemp, 1);
+ SDL_SetHint(SDL_HINT_RENDER_DRIVER, stemp);
+ }
+ else
{
- if (strcmp(stemp, OSDOPTVAL_AUTO) != 0)
- {
- osd_printf_verbose("Setting SDL renderdriver '%s' ...\n", stemp);
- //osd_setenv(SDLENV_RENDERDRIVER, stemp, 1);
- SDL_SetHint(SDL_HINT_RENDER_DRIVER, stemp);
- }
- else
- {
#if defined(SDLMAME_WIN32)
- // OpenGL renderer has less issues with mode switching on windows
- osd_printf_verbose("Setting SDL renderdriver '%s' ...\n", "opengl");
- //osd_setenv(SDLENV_RENDERDRIVER, stemp, 1);
- SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl");
+ // OpenGL renderer has less issues with mode switching on windows
+ osd_printf_verbose("Setting SDL renderdriver '%s' ...\n", "opengl");
+ //osd_setenv(SDLENV_RENDERDRIVER, stemp, 1);
+ SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl");
#endif
- }
}
+ }
/* Set the SDL environment variable for drivers wanting to load the
* lib at startup.
@@ -491,7 +491,8 @@ void sdl_osd_interface::init(running_machine &machine)
/* Initialize SDL */
- if (SDL_InitSubSystem(SDL_INIT_VIDEO)) {
+ if (SDL_InitSubSystem(SDL_INIT_VIDEO))
+ {
osd_printf_error("Could not initialize SDL %s\n", SDL_GetError());
exit(-1);
}