From aa4878bb8e529d9e14b10e9b5f479ebafcdcb8b2 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 23 Mar 2024 21:23:24 +0100 Subject: [PATCH] Bind viewporter. --- profiler/src/BackendWayland.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/profiler/src/BackendWayland.cpp b/profiler/src/BackendWayland.cpp index 9f196382..94faca76 100644 --- a/profiler/src/BackendWayland.cpp +++ b/profiler/src/BackendWayland.cpp @@ -23,6 +23,7 @@ #include "wayland-xdg-decoration-client-protocol.h" #include "wayland-xdg-shell-client-protocol.h" #include "wayland-fractional-scale-client-protocol.h" +#include "wayland-viewporter-client-protocol.h" #include "profiler/TracyImGui.hpp" @@ -186,6 +187,7 @@ static struct xdg_activation_token_v1* s_actToken; static struct zxdg_decoration_manager_v1* s_decoration; static struct zxdg_toplevel_decoration_v1* s_tldec; static struct wp_fractional_scale_manager_v1* s_fractionalScale; +static struct wp_viewporter* s_viewporter; static struct wl_keyboard* s_keyboard; static struct xkb_context* s_xkbCtx; static struct xkb_keymap* s_xkbKeymap; @@ -562,6 +564,10 @@ static void RegistryGlobal( void*, struct wl_registry* reg, uint32_t name, const { s_fractionalScale = (wp_fractional_scale_manager_v1*)wl_registry_bind( reg, name, &wp_fractional_scale_manager_v1_interface, 1 ); } + else if( strcmp( interface, wp_viewporter_interface.name ) == 0 ) + { + s_viewporter = (wp_viewporter*)wl_registry_bind( reg, name, &wp_viewporter_interface, 1 ); + } } static void RegistryGlobalRemove( void*, struct wl_registry* reg, uint32_t name ) @@ -789,6 +795,7 @@ Backend::~Backend() { ImGui_ImplOpenGL3_Shutdown(); + if( s_viewporter ) wp_viewporter_destroy( s_viewporter ); if( s_fractionalScale ) wp_fractional_scale_manager_v1_destroy( s_fractionalScale ); if( s_tldec ) zxdg_toplevel_decoration_v1_destroy( s_tldec ); if( s_decoration ) zxdg_decoration_manager_v1_destroy( s_decoration );