diff options
author | crupest <crupest@outlook.com> | 2019-03-27 00:18:57 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-03-27 00:18:57 +0800 |
commit | 8b1ec7c3f38eb8140f88a472184199b360e21c13 (patch) | |
tree | ceac922a5e310e04c8d5897ad69176fd43671fd8 /src | |
parent | b506c349b793f723df6da170ffa0f412200e26e9 (diff) | |
download | cru-8b1ec7c3f38eb8140f88a472184199b360e21c13.tar.gz cru-8b1ec7c3f38eb8140f88a472184199b360e21c13.tar.bz2 cru-8b1ec7c3f38eb8140f88a472184199b360e21c13.zip |
...
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 41 | ||||
-rw-r--r-- | src/main.cpp | 5 | ||||
-rw-r--r-- | src/ui/events/ui_event.cpp | 3 | ||||
-rw-r--r-- | src/ui/events/window_event.cpp | 3 |
4 files changed, 43 insertions, 9 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 00000000..bc33c29d --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,41 @@ +add_library(cru_ui STATIC + application.cpp + cru_debug.cpp + exception.cpp + timer.cpp + graph/graph_manager.cpp + graph/window_render_target.cpp + ui/content_control.cpp + ui/control.cpp + ui/input_util.cpp + ui/layout_control.cpp + ui/no_child_control.cpp + ui/ui_manager.cpp + ui/window_class.cpp + ui/window.cpp + ui/animations/animation.cpp + ui/controls/button.cpp + ui/controls/flex_layout.cpp + ui/controls/text_block.cpp + ui/render/border_render_object.cpp + ui/render/flex_layout_render_object.cpp + ui/render/render_object.cpp + ui/render/text_render_object.cpp + ui/render/window_render_object.cpp + util/string_util.cpp) + + +target_include_directories(cru_ui PUBLIC .) + +if(WIN32) +find_library(D3D11_LIB D3D11) +find_library(D2D1_LIB D2d1) +find_library(DWRITE_LIB DWrite) + +target_link_libraries(cru_ui PRIVATE ${D3D11_LIB} ${D2D1_LIB} ${DWRITE_LIB}) + +target_compile_definitions(cru_ui PUBLIC UNICODE _UNICODE) +endif() + +add_executable(demo main.cpp) +target_link_libraries(demo PRIVATE cru_ui) diff --git a/src/main.cpp b/src/main.cpp index c35213f7..a787fbca 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,13 +16,12 @@ using cru::ui::controls::Button; using cru::ui::controls::FlexLayout; using cru::ui::controls::TextBlock; -int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, - LPWSTR lpCmdLine, int nCmdShow) { +int main() { #ifdef CRU_DEBUG _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif - Application application(hInstance); + Application application(::GetModuleHandleW(nullptr)); const auto window = Window::CreateOverlapped(); diff --git a/src/ui/events/ui_event.cpp b/src/ui/events/ui_event.cpp deleted file mode 100644 index 78d56a83..00000000 --- a/src/ui/events/ui_event.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "ui_event.hpp" - -namespace cru::ui::events {} diff --git a/src/ui/events/window_event.cpp b/src/ui/events/window_event.cpp deleted file mode 100644 index a217136c..00000000 --- a/src/ui/events/window_event.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "window_event.hpp" - -namespace cru::ui::events {} |