diff options
author | crupest <crupest@outlook.com> | 2022-02-02 21:25:59 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-02 21:25:59 +0800 |
commit | 35b72a2f3215cf9644508581f0af8bde2ed753a8 (patch) | |
tree | 0ce8073e4c8e86ef108b14983d12166dd708bf3b /include/cru/win/graphics/direct/Painter.hpp | |
parent | 41623c6ad6f42ca5d6e9a38061f809929641e5c6 (diff) | |
download | cru-35b72a2f3215cf9644508581f0af8bde2ed753a8.tar.gz cru-35b72a2f3215cf9644508581f0af8bde2ed753a8.tar.bz2 cru-35b72a2f3215cf9644508581f0af8bde2ed753a8.zip |
...
Diffstat (limited to 'include/cru/win/graphics/direct/Painter.hpp')
-rw-r--r-- | include/cru/win/graphics/direct/Painter.hpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/include/cru/win/graphics/direct/Painter.hpp b/include/cru/win/graphics/direct/Painter.hpp index 11fb5619..57a59357 100644 --- a/include/cru/win/graphics/direct/Painter.hpp +++ b/include/cru/win/graphics/direct/Painter.hpp @@ -7,20 +7,22 @@ #include <vector> namespace cru::platform::graphics::win::direct { -class CRU_WIN_GRAPHICS_DIRECT_API D2DPainter +class CRU_WIN_GRAPHICS_DIRECT_API D2DDeviceContextPainter : public DirectResource, public virtual IPainter, - public virtual IComResource<ID2D1RenderTarget> { + public virtual IComResource<ID2D1DeviceContext1> { public: - explicit D2DPainter(ID2D1RenderTarget* render_target); + explicit D2DDeviceContextPainter(ID2D1DeviceContext1* device_context); - CRU_DELETE_COPY(D2DPainter) - CRU_DELETE_MOVE(D2DPainter) + CRU_DELETE_COPY(D2DDeviceContextPainter) + CRU_DELETE_MOVE(D2DDeviceContextPainter) - ~D2DPainter() override = default; + ~D2DDeviceContextPainter() override = default; public: - ID2D1RenderTarget* GetComInterface() const override { return render_target_; } + ID2D1DeviceContext1* GetComInterface() const override { + return device_context_; + } public: Matrix GetTransform() override; @@ -62,7 +64,7 @@ class CRU_WIN_GRAPHICS_DIRECT_API D2DPainter void CheckValidation(); private: - ID2D1RenderTarget* render_target_; + ID2D1DeviceContext1* device_context_; std::vector<Microsoft::WRL::ComPtr<ID2D1Layer>> layers_; std::vector<Microsoft::WRL::ComPtr<ID2D1DrawingStateBlock>> |