43 verticalSync = std::make_unique<vertical_sync>(_handlevertical_sync,
this);
48 gui_system(
const gui_system &) =
delete;
49 gui_system &operator=(
const gui_system &) =
delete;
50 gui_system(gui_system &&) =
delete;
51 gui_system &operator=(gui_system &&) =
delete;
58 template<
typename... Args>
63 tt_assert(is_main_thread(),
"createWindow should be called from the main thread.");
66 auto window = std::make_shared<gui_window_vulkan_win32>(
static_cast<gui_system &
>(*
this), std::forward<Args>(args)...);
67 auto window_ptr = window.get();
70 ttlet lock = std::scoped_lock(gui_system_mutex);
71 auto device = findBestDeviceForWindow(*window);
73 throw gui_error(
"Could not find a vulkan-device matching this window");
85 ttlet lock = std::scoped_lock(gui_system_mutex);
88 device->render(displayTimePoint);
92 application::global->run_from_main_loop([
this]{
93 if (
auto delegate_ = this->delegate.
lock()) {
94 delegate_->last_window_closed(*this);
101 void handlevertical_sync(hires_utc_clock::time_point displayTimePoint)
103 render(displayTimePoint);
107 static void _handlevertical_sync(
void *data, hires_utc_clock::time_point displayTimePoint);
110 gui_device *findBestDeviceForWindow(gui_window
const &window);