mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-04-27 15:25:43 -04:00
43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
#pragma once
|
|
#include "common/vulkan/texture.h"
|
|
#include "frontend-common/vulkan_host_display.h"
|
|
#include "libretro.h"
|
|
|
|
#define HAVE_VULKAN
|
|
#include "libretro_vulkan.h"
|
|
|
|
class LibretroVulkanHostDisplay final : public FrontendCommon::VulkanHostDisplay
|
|
{
|
|
public:
|
|
LibretroVulkanHostDisplay();
|
|
~LibretroVulkanHostDisplay();
|
|
|
|
static bool RequestHardwareRendererContext(retro_hw_render_callback* cb);
|
|
|
|
bool CreateRenderDevice(const WindowInfo& wi, std::string_view adapter_name, bool debug_device) override;
|
|
void DestroyRenderDevice() override;
|
|
|
|
void ResizeRenderWindow(s32 new_window_width, s32 new_window_height) override;
|
|
|
|
void SetVSync(bool enabled) override;
|
|
|
|
bool Render() override;
|
|
|
|
protected:
|
|
bool CreateResources() override;
|
|
void DestroyResources() override;
|
|
VkRenderPass GetRenderPassForDisplay() const override;
|
|
|
|
private:
|
|
static constexpr VkFormat FRAMEBUFFER_FORMAT = VK_FORMAT_R8G8B8A8_UNORM;
|
|
|
|
bool CheckFramebufferSize(u32 width, u32 height);
|
|
|
|
const retro_hw_render_interface_vulkan* m_ri = nullptr;
|
|
|
|
Vulkan::Texture m_frame_texture;
|
|
retro_vulkan_image m_frame_view = {};
|
|
VkFramebuffer m_frame_framebuffer = VK_NULL_HANDLE;
|
|
VkRenderPass m_frame_render_pass = VK_NULL_HANDLE;
|
|
};
|