Skip to content

Commit

Permalink
Implement PR feedback:
Browse files Browse the repository at this point in the history
- more whitespace fixes
- more failure handling
  • Loading branch information
belegdol committed Sep 10, 2023
1 parent 5474221 commit 8d08909
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/osd/modules/render/drawbgfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,21 +394,21 @@ bool video_bgfx::init_bgfx_library(osd_window &window)
wl_egl_window *create_wl_egl_window(SDL_Window *window, struct wl_surface *surface)
{
if (!surface)
{
osd_printf_error("Wayland surface missing, aborting\n");
return nullptr;
}
{
osd_printf_error("Wayland surface missing, aborting\n");
return nullptr;
}
wl_egl_window *win_impl = (wl_egl_window *)SDL_GetWindowData(window, "wl_egl_window");
if (!win_impl)
{
int width, height;
SDL_GetWindowSize(window, &width, &height);
win_impl = wl_egl_window_create(surface, width, height);
if (!win_impl)
{
osd_printf_error("Creating wayland window failed\n");
return nullptr;
}
{
osd_printf_error("Creating wayland window failed\n");
return nullptr;
}
SDL_SetWindowData(window, "wl_egl_window", win_impl);
}
return win_impl;
Expand Down Expand Up @@ -461,6 +461,11 @@ bool video_bgfx::set_platform_data(bgfx::PlatformData &platform_data, osd_window
case SDL_SYSWM_WAYLAND:
platform_data.ndt = wmi.info.wl.display;
platform_data.nwh = create_wl_egl_window(dynamic_cast<sdl_window_info const &>(window).platform_window(), wmi.info.wl.surface);
if (!platform_data.nwh)
{
osd_printf_error("BGFX: Error creating a Wayland window\n");
return false;
}
platform_data.type = bgfx::NativeWindowHandleType::Wayland;
break;
#endif
Expand Down

0 comments on commit 8d08909

Please sign in to comment.