aboutsummaryrefslogtreecommitdiff
path: root/src/platform/bootstrap/Bootstrap.cpp
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-09-12 00:42:36 +0800
committerYuqian Yang <crupest@crupest.life>2025-09-12 00:42:36 +0800
commit27f153af927c056af5cec70db5f011752e29b156 (patch)
treecdbe0a61f037cd1641f23f681d221a3206454411 /src/platform/bootstrap/Bootstrap.cpp
parent7c135df9b8057e1de3ea6a73fb785d5622b519d4 (diff)
downloadcru-27f153af927c056af5cec70db5f011752e29b156.tar.gz
cru-27f153af927c056af5cec70db5f011752e29b156.tar.bz2
cru-27f153af927c056af5cec70db5f011752e29b156.zip
Organize bootstrap and graphics demos.
Diffstat (limited to 'src/platform/bootstrap/Bootstrap.cpp')
-rw-r--r--src/platform/bootstrap/Bootstrap.cpp30
1 files changed, 6 insertions, 24 deletions
diff --git a/src/platform/bootstrap/Bootstrap.cpp b/src/platform/bootstrap/Bootstrap.cpp
index 5c47e95c..e9183550 100644
--- a/src/platform/bootstrap/Bootstrap.cpp
+++ b/src/platform/bootstrap/Bootstrap.cpp
@@ -1,39 +1,21 @@
#include "cru/platform/bootstrap/Bootstrap.h"
+#include "cru/base/Base.h"
-#ifdef CRU_PLATFORM_WINDOWS
-#include "cru/platform/graphics/direct2d/Factory.h"
+#if defined(_WIN32)
#include "cru/platform/gui/win/UiApplication.h"
-#elif defined(CRU_PLATFORM_OSX)
-#include "cru/platform/graphics/quartz/Factory.h"
+#elif defined(__APPLE__)
#include "cru/platform/gui/osx/UiApplication.h"
-#elif defined(CRU_PLATFORM_EMSCRIPTEN)
-// TODO: Go fill this!
#else
-#include "cru/platform/graphics/cairo/CairoGraphicsFactory.h"
#endif
namespace cru::platform::bootstrap {
cru::platform::gui::IUiApplication* CreateUiApplication() {
-#ifdef CRU_PLATFORM_WINDOWS
+#if defined(_WIN32)
return new cru::platform::gui::win::WinUiApplication();
-#elif defined(CRU_PLATFORM_OSX)
+#elif defined(__APPLE__)
return new cru::platform::gui::osx::OsxUiApplication();
#else
- return nullptr;
+ NotImplemented();
#endif
}
-
-CRU_PLATFORM_BOOTSTRAP_API cru::platform::graphics::IGraphicsFactory*
-CreateGraphicsFactory() {
-#ifdef CRU_PLATFORM_WINDOWS
- return new cru::platform::graphics::direct2d::DirectGraphicsFactory();
-#elif defined(CRU_PLATFORM_OSX)
- return new cru::platform::graphics::quartz::QuartzGraphicsFactory();
-#elif defined(CRU_PLATFORM_EMSCRIPTEN)
- return nullptr; // TODO: Change this.
-#else
- return new cru::platform::graphics::cairo::CairoGraphicsFactory();
-#endif
-}
-
} // namespace cru::platform::bootstrap