aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-05-08 21:07:24 +0800
committercrupest <crupest@outlook.com>2022-05-08 21:07:24 +0800
commita1bbc5da1fb0ae4842a54d89136a784832a76978 (patch)
tree6c06a356dd9121c0c99f5632bce9754d7bb966af
parenta7ca9057de3a01d5071406828f134e2e3bcfb49c (diff)
downloadcru-a1bbc5da1fb0ae4842a54d89136a784832a76978.tar.gz
cru-a1bbc5da1fb0ae4842a54d89136a784832a76978.tar.bz2
cru-a1bbc5da1fb0ae4842a54d89136a784832a76978.zip
...
-rw-r--r--include/cru/platform/bootstrap/Bootstrap.h6
-rw-r--r--src/platform/bootstrap/Bootstrap.cpp14
2 files changed, 18 insertions, 2 deletions
diff --git a/include/cru/platform/bootstrap/Bootstrap.h b/include/cru/platform/bootstrap/Bootstrap.h
index 3ab89a91..4ef522f2 100644
--- a/include/cru/platform/bootstrap/Bootstrap.h
+++ b/include/cru/platform/bootstrap/Bootstrap.h
@@ -1,4 +1,5 @@
#pragma once
+#include "cru/platform/graphics/Factory.h"
#include "cru/platform/gui/UiApplication.h"
#ifdef CRU_PLATFORM_WINDOWS
@@ -14,4 +15,7 @@
namespace cru::platform::bootstrap {
CRU_PLATFORM_BOOTSTRAP_API cru::platform::gui::IUiApplication*
CreateUiApplication();
-}
+
+CRU_PLATFORM_BOOTSTRAP_API cru::platform::graphics::IGraphicsFactory*
+CreateGraphicsFactory();
+} // namespace cru::platform::bootstrap
diff --git a/src/platform/bootstrap/Bootstrap.cpp b/src/platform/bootstrap/Bootstrap.cpp
index 2c8bae5d..cdbd14f1 100644
--- a/src/platform/bootstrap/Bootstrap.cpp
+++ b/src/platform/bootstrap/Bootstrap.cpp
@@ -1,9 +1,11 @@
#include "cru/platform/bootstrap/Bootstrap.h"
-#include "cru/osx/gui/UiApplication.h"
#ifdef CRU_PLATFORM_WINDOWS
+#include "cru/win/graphics/direct/Factory.h"
#include "cru/win/gui/UiApplication.h"
#else
+#include "cru/osx/graphics/quartz/Factory.h"
+#include "cru/osx/gui/UiApplication.h"
#endif
namespace cru::platform::bootstrap {
@@ -14,4 +16,14 @@ cru::platform::gui::IUiApplication* CreateUiApplication() {
return new cru::platform::gui::osx::OsxUiApplication();
#endif
}
+
+CRU_PLATFORM_BOOTSTRAP_API cru::platform::graphics::IGraphicsFactory*
+CreateGraphicsFactory() {
+#ifdef CRU_PLATFORM_WINDOWS
+ return new cru::platform::graphics::win::direct::DirectGraphicsFactory();
+#elif CRU_PLATFORM_OSX
+ return new cru::platform::graphics::osx::quartz::QuartzGraphicsFactory();
+#endif
+}
+
} // namespace cru::platform::bootstrap