From 380b4d5d5a3e66d89ca7b3b1601bb23e5a01bf7b Mon Sep 17 00:00:00 2001 From: hachem Date: Sun, 23 Aug 2026 05:53:33 +0200 Subject: feat: unified interface --- src/platform/vulkan/vulkan_renderer.h | 50 ++++++++++++++--------------------- 1 file changed, 20 insertions(+), 30 deletions(-) (limited to 'src/platform/vulkan/vulkan_renderer.h') diff --git a/src/platform/vulkan/vulkan_renderer.h b/src/platform/vulkan/vulkan_renderer.h index bc6f5b9..81e8486 100644 --- a/src/platform/vulkan/vulkan_renderer.h +++ b/src/platform/vulkan/vulkan_renderer.h @@ -1,48 +1,38 @@ #pragma once -#include -#include -#include -#include +#include "rendering/renderer_backend.h" namespace Donut { auto vulkan_prepare_glfw() -> void; - struct SceneObject - { - glm::vec3 position = { 0.0f, 2.0f, 0.0f }; - float radius = 2.0f; - glm::vec3 color = { 0.85f, 0.35f, 0.2f }; - }; - - class VulkanRenderer + class VulkanRenderer : public RendererBackend { public: VulkanRenderer(); - ~VulkanRenderer(); - - auto init(void* glfwWindow, int width, int height) -> bool; - auto shutdown() -> void; - - auto init_im_gui() -> bool; - - auto draw_frame(const glm::vec4& clearColor, const std::function& buildUI = {}) -> void; - - auto on_resize(int width, int height) -> void; + ~VulkanRenderer() override; - auto set_hdri(const std::string& path) -> void; + auto init(void* glfwWindow, int width, int height) -> bool override; + auto init_ui() -> bool override; + auto shutdown() -> void override; + auto resize(int width, int height) -> void override; - auto current_hdri() const -> const std::string&; + auto draw_frame(const glm::vec4& clear_color, + const std::function& build_ui) -> void override; - auto set_free_fly(bool enabled) -> void; - auto is_free_fly() const -> bool; + auto set_scene_mode(bool enabled) -> void override; + auto is_scene_mode() const -> bool override; + auto set_free_fly(bool enabled) -> void override; + auto is_free_fly() const -> bool override; + auto reset_camera() -> void override; - auto set_scene_mode(bool enabled) -> void; - auto is_scene_mode() const -> bool; + auto set_hdri(const std::string& path) -> void override; + auto current_hdri() const -> const std::string& override; + auto scene_objects() -> std::vector& override; + auto set_selected_object(int index) -> void override; + auto black_hole_params() -> BlackHoleParams& override; - auto scene_objects() -> std::vector&; - auto set_selected_object(int index) -> void; + auto device_name() const -> const std::string& override; private: struct Impl; -- cgit v1.3