Detect window resize events and update editor main

This commit is contained in:
2025-04-12 10:11:48 +10:00
parent 6e1393ce64
commit 1849593dfc
4 changed files with 48 additions and 27 deletions

View File

@@ -15,16 +15,23 @@ using namespace Nova;
int main() {
Debug::get_logger()->set_level(spdlog::level::trace);
const auto wd = WindowDriver::create();
const auto rd = RenderDriver::create(RenderAPI::VULKAN, wd);
auto wd = WindowDriver::create();
auto rd = RenderDriver::create(RenderAPI::VULKAN, wd);
auto window = wd->create_window("Nova", 1280, 720);
auto surface = rd->create_surface(window);
// TODO: select_device should probably consider what surface is
// being used as not all devices support all surfaces. alternatively
// the caller chould check if the device supports the surface
rd->select_device(RenderDevice::AUTO);
wd->create_window("Nova", 1280, 720);
while (wd->get_window_count() > 0) {
wd->poll_events();
}
rd->destroy_surface(surface);
delete rd;
delete wd;
return EXIT_SUCCESS;