mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-09 04:38:30 +09:00
[Fix] (MG_Backend/DirectVulkan): Avoid directly using ANativeWindow in abstracted layers.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
#include "FrameContext.h"
|
||||
|
||||
namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
VulkanRenderer::VulkanRenderer(ANativeWindow* window, const RendererConfig& cfg) : Window(window), Config(cfg) {
|
||||
VulkanRenderer::VulkanRenderer(NativeWindowType window, const RendererConfig& cfg) : Window(window), Config(cfg) {
|
||||
Ctx = std::make_unique<VulkanContext>();
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
}
|
||||
|
||||
void VulkanRenderer::Initialize() {
|
||||
if (!Window) throw MobileGL::RuntimeError("ANativeWindow is null");
|
||||
Ctx->Initialize(Window, Config.AppName);
|
||||
|
||||
Swapchain = std::make_unique<SwapchainManager>(*Ctx);
|
||||
@@ -271,4 +270,4 @@ namespace MobileGL::MG_Backend::DirectVulkan {
|
||||
void VulkanRenderer::WaitIdle() {
|
||||
if (Ctx && Ctx->GetDevice() != VK_NULL_HANDLE) vkDeviceWaitIdle(Ctx->GetDevice());
|
||||
}
|
||||
} // namespace MobileGL::MG_Backend::DirectVulkan
|
||||
} // namespace MobileGL::MG_Backend::DirectVulkan
|
||||
|
||||
Reference in New Issue
Block a user