diff options
Diffstat (limited to 'src/application.cpp')
-rw-r--r-- | src/application.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/application.cpp b/src/application.cpp index f53a002d..7658a340 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -5,6 +5,7 @@ #include "exception.h" #include "timer.h" #include "ui/window.h" +#include "ui/cursor.h" #include "graph/graph.h" #include "ui/animations/animation.h" @@ -86,6 +87,16 @@ namespace cru { return instance_; } + namespace + { + void LoadSystemCursor(HINSTANCE h_instance) + { + ui::cursors[ui::cursor_arrow_key] = std::make_shared<ui::Cursor>(::LoadCursorW(h_instance, MAKEINTRESOURCEW(IDC_ARROW)), false); + ui::cursors[ui::cursor_hand_key] = std::make_shared<ui::Cursor>(::LoadCursorW(h_instance, MAKEINTRESOURCEW(IDC_HAND)), false); + ui::cursors[ui::cursor_i_beam_key] = std::make_shared<ui::Cursor>(::LoadCursorW(h_instance, MAKEINTRESOURCEW(IDC_IBEAM)), false); + } + } + Application::Application(HINSTANCE h_instance) : h_instance_(h_instance) { @@ -112,10 +123,14 @@ namespace cru { if (!::SystemParametersInfoW(SPI_GETCARETWIDTH, 0 , &caret_width, 0)) throw Win32Error(::GetLastError(), "Failed to get system caret width."); caret_info_.half_caret_width = caret_width / 2.0f; + + LoadSystemCursor(h_instance); } Application::~Application() { + ui::cursors.clear(); + animation_manager_.reset(); instance_ = nullptr; } |