Skip to content

Commit

Permalink
sdl/window: add error retval check for bgfx on fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
happppp committed Mar 25, 2022
1 parent e1b3560 commit d3829a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/osd/sdl/window.cpp
Expand Up @@ -98,11 +98,11 @@ bool sdl_osd_interface::window_init()
-1, // No GDI on Linux
#if defined(USE_OPENGL) && USE_OPENGL
VIDEO_MODE_OPENGL, // BGFX -> OpenGL
VIDEO_MODE_SDL2ACCEL, // OpenGL -> SDL2Accel
-1, // OpenGL -> no fallback
#else
VIDEO_MODE_SDL2ACCEL, // BGFX -> SDL2Accel
#endif
VIDEO_MODE_SOFT, // SDL2ACCEL -> SOFT
-1, // SDL2ACCEL -> no fallback
-1, // No D3D on Linux
-1, // SOFT -> no fallback
};
Expand All @@ -114,7 +114,7 @@ bool sdl_osd_interface::window_init()
switch(current_mode)
{
case VIDEO_MODE_BGFX:
renderer_bgfx::init(machine());
error = renderer_bgfx::init(machine());
break;
#if defined(USE_OPENGL) && USE_OPENGL
case VIDEO_MODE_OPENGL:
Expand Down
2 changes: 1 addition & 1 deletion src/osd/windows/window.cpp
Expand Up @@ -136,7 +136,7 @@ bool windows_osd_interface::window_init()
VIDEO_MODE_NONE, // GDI -> NONE
VIDEO_MODE_D3D, // BGFX -> D3D
#if (USE_OPENGL)
VIDEO_MODE_GDI, // OPENGL -> GDI
-1, // OPENGL -> no fallback
#endif
-1, // No SDL2ACCEL on Windows OSD
#if (USE_OPENGL)
Expand Down

1 comment on commit d3829a0

@happppp
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for removing the ones for OpenGL and SDL2ACCEL in the fallback table: it's because they don't have error checking at init.
bool error remains false after calling their init function.

Please sign in to comment.