[Fix] (MG_Backend/DirectVulkan): Avoid directly using ANativeWindow in abstracted layers.

This commit is contained in:
BZLZHH
2026-02-01 00:05:50 +08:00
parent 516566321d
commit ad7d145ece
5 changed files with 22 additions and 22 deletions
@@ -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