diff options
author | crupest <crupest@outlook.com> | 2019-06-27 00:18:48 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-06-27 00:18:48 +0800 |
commit | baa7cf141b8121473edceae16c1a20a6d47bd202 (patch) | |
tree | 9349633a9d0bc286fe29f480bd70e4c2ad1f3075 /include/cru/win/graph/direct/brush.hpp | |
parent | f404a3b2eb7bb9865d0c6f938538899996a53d8c (diff) | |
download | cru-baa7cf141b8121473edceae16c1a20a6d47bd202.tar.gz cru-baa7cf141b8121473edceae16c1a20a6d47bd202.tar.bz2 cru-baa7cf141b8121473edceae16c1a20a6d47bd202.zip |
......
Diffstat (limited to 'include/cru/win/graph/direct/brush.hpp')
-rw-r--r-- | include/cru/win/graph/direct/brush.hpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/cru/win/graph/direct/brush.hpp b/include/cru/win/graph/direct/brush.hpp new file mode 100644 index 00000000..9775b5c1 --- /dev/null +++ b/include/cru/win/graph/direct/brush.hpp @@ -0,0 +1,26 @@ +#pragma once +#include "com_resource.hpp" +#include "direct_factory.hpp" + +#include "cru/platform/graph/brush.hpp" + +namespace cru::platform::graph::win::direct { +class D2DSolidColorBrush : public SolidColorBrush, + public IComResource<ID2D1SolidColorBrush> { + public: + explicit D2DSolidColorBrush(IDirectFactory* factory); + D2DSolidColorBrush(const D2DSolidColorBrush& other) = delete; + D2DSolidColorBrush(D2DSolidColorBrush&& other) = delete; + D2DSolidColorBrush& operator=(const D2DSolidColorBrush& other) = delete; + D2DSolidColorBrush& operator=(D2DSolidColorBrush&& other) = delete; + ~D2DSolidColorBrush() override = default; + + ID2D1SolidColorBrush* GetComInterface() override { return brush_.Get(); } + + protected: + void OnSetColor(const Color& color) override; + + private: + Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> brush_; +}; +} // namespace cru::platform::graph::win::direct |