From: Mikko Rasa Date: Fri, 27 Dec 2024 09:38:11 +0000 (+0200) Subject: Make it possible to query API handles of textures X-Git-Url: https://git.tdb.fi/?a=commitdiff_plain;h=893bd2006530f38364bc688f4b4268a518778226;p=libs%2Fgl.git Make it possible to query API handles of textures This is necessary for some integrations. --- diff --git a/source/backends/opengl/texture_backend.h b/source/backends/opengl/texture_backend.h index ed9000b2..794bd29d 100644 --- a/source/backends/opengl/texture_backend.h +++ b/source/backends/opengl/texture_backend.h @@ -29,6 +29,7 @@ protected: void generate_mipmap(); + unsigned get_api_handle() const { return id; } void set_debug_name(const std::string &); void bind_scratch(); diff --git a/source/backends/vulkan/texture_backend.h b/source/backends/vulkan/texture_backend.h index 2152331c..2fce1c7d 100644 --- a/source/backends/vulkan/texture_backend.h +++ b/source/backends/vulkan/texture_backend.h @@ -43,6 +43,7 @@ protected: void refresh_mip_views() const { if(mip_view_handles.empty()) create_mip_views(); } + VkImage get_api_handle() const { return handle; } void set_debug_name(const std::string &); void set_vulkan_object_names() const; }; diff --git a/source/core/texture.h b/source/core/texture.h index c567f4cc..42346cf1 100644 --- a/source/core/texture.h +++ b/source/core/texture.h @@ -105,6 +105,7 @@ public: std::size_t get_data_size() const override { return 0; } + using TextureBackend::get_api_handle; using TextureBackend::set_debug_name; private: