mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Properly support Wayland under EGL and Vulkan. (#3358)
This commit is contained in:
committed by
GitHub
parent
f8b20616de
commit
3303b451a1
@@ -46,18 +46,8 @@ namespace entry
|
||||
{
|
||||
# if BX_PLATFORM_LINUX
|
||||
# if ENTRY_CONFIG_USE_WAYLAND
|
||||
wl_egl_window *win_impl = (wl_egl_window*)glfwGetWindowUserPointer(_window);
|
||||
if(!win_impl)
|
||||
{
|
||||
int width, height;
|
||||
glfwGetWindowSize(_window, &width, &height);
|
||||
struct wl_surface* surface = (struct wl_surface*)glfwGetWaylandWindow(_window);
|
||||
if(!surface)
|
||||
return nullptr;
|
||||
win_impl = wl_egl_window_create(surface, width, height);
|
||||
glfwSetWindowUserPointer(_window, (void*)(uintptr_t)win_impl);
|
||||
}
|
||||
return (void*)(uintptr_t)win_impl;
|
||||
struct wl_surface* surface = (struct wl_surface*)glfwGetWaylandWindow(_window);
|
||||
return (void*)surface;
|
||||
# else
|
||||
return (void*)(uintptr_t)glfwGetX11Window(_window);
|
||||
# endif
|
||||
|
||||
@@ -51,20 +51,7 @@ namespace entry
|
||||
# if BX_PLATFORM_LINUX
|
||||
# if ENTRY_CONFIG_USE_WAYLAND
|
||||
if (wmi.subsystem == SDL_SYSWM_WAYLAND)
|
||||
{
|
||||
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);
|
||||
struct wl_surface* surface = wmi.info.wl.surface;
|
||||
if(!surface)
|
||||
return nullptr;
|
||||
win_impl = wl_egl_window_create(surface, width, height);
|
||||
SDL_SetWindowData(_window, "wl_egl_window", win_impl);
|
||||
}
|
||||
return (void*)(uintptr_t)win_impl;
|
||||
}
|
||||
return (void*)wmi.info.wl.surface;
|
||||
else
|
||||
# endif // ENTRY_CONFIG_USE_WAYLAND
|
||||
return (void*)wmi.info.x11.window;
|
||||
|
||||
@@ -290,6 +290,8 @@ void showExampleDialog(entry::AppI* _app, const char* _errorText)
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
ImGui::Text("Renderer: %s", bgfx::getRendererName(bgfx::getRendererType()));
|
||||
#endif // 0
|
||||
|
||||
const bgfx::Stats* stats = bgfx::getStats();
|
||||
|
||||
Reference in New Issue
Block a user