aboutsummaryrefslogtreecommitdiff
path: root/demos/platform/gui
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-09-23 23:23:38 +0800
committerYuqian Yang <crupest@crupest.life>2025-09-23 23:23:38 +0800
commitf76b47291ac164ec0169f721dab5b1b0fe016322 (patch)
tree74a4bdaf8fa977942de92eb7019be666802130ef /demos/platform/gui
parentfcd9eff000a967e16a0a987609210fba4a92dd0c (diff)
downloadcru-f76b47291ac164ec0169f721dab5b1b0fe016322.tar.gz
cru-f76b47291ac164ec0169f721dab5b1b0fe016322.tar.bz2
cru-f76b47291ac164ec0169f721dab5b1b0fe016322.zip
Organize platform demo.
Diffstat (limited to 'demos/platform/gui')
-rw-r--r--demos/platform/gui/CMakeLists.txt5
-rw-r--r--demos/platform/gui/EmptyWindow.cpp19
2 files changed, 24 insertions, 0 deletions
diff --git a/demos/platform/gui/CMakeLists.txt b/demos/platform/gui/CMakeLists.txt
new file mode 100644
index 00000000..b179fbc6
--- /dev/null
+++ b/demos/platform/gui/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_library(CruDemoPlatformGuiBase INTERFACE)
+target_link_libraries(CruDemoPlatformGuiBase INTERFACE CruPlatformBootstrap)
+
+add_executable(CruDemoPlatformGuiEmptyWindow EmptyWindow.cpp)
+target_link_libraries(CruDemoPlatformGuiEmptyWindow PRIVATE CruDemoPlatformGuiBase)
diff --git a/demos/platform/gui/EmptyWindow.cpp b/demos/platform/gui/EmptyWindow.cpp
new file mode 100644
index 00000000..83e352af
--- /dev/null
+++ b/demos/platform/gui/EmptyWindow.cpp
@@ -0,0 +1,19 @@
+#include "cru/platform/bootstrap/Bootstrap.h"
+#include "cru/platform/gui/Base.h"
+#include "cru/platform/gui/UiApplication.h"
+#include "cru/platform/gui/Window.h"
+
+using cru::platform::gui::IUiApplication;
+using cru::platform::gui::WindowVisibilityType;
+
+int main() {
+ std::unique_ptr<IUiApplication> application(
+ cru::platform::bootstrap::CreateUiApplication());
+
+ application->SetQuitOnAllWindowClosed(true);
+ auto window = application->CreateWindow();
+ window->SetVisibility(WindowVisibilityType::Show);
+ window->SetToForeground();
+
+ return application->Run();
+}