aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.h
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2025-02-17 08:48:23 +1100
committerNeil <nyamatongwe@gmail.com>2025-02-17 08:48:23 +1100
commitdd58631f7a0193dd95523d1ebe4114753fef06c0 (patch)
tree6305ac65c588c555829c67d57eac998d56e48ef9 /win32/PlatWin.h
parent99497f846e812b5333eca87fe9f9812eab7daaf0 (diff)
downloadscintilla-mirror-dd58631f7a0193dd95523d1ebe4114753fef06c0.tar.gz
Switch to using ComPtr from WRL for render target code for simplicity and
familiarity.
Diffstat (limited to 'win32/PlatWin.h')
-rw-r--r--win32/PlatWin.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/win32/PlatWin.h b/win32/PlatWin.h
index 1b5b7b1b9..192bdf6a7 100644
--- a/win32/PlatWin.h
+++ b/win32/PlatWin.h
@@ -71,17 +71,14 @@ extern bool LoadD2D() noexcept;
extern ID2D1Factory1 *pD2DFactory;
extern IDWriteFactory1 *pIDWriteFactory;
-using DCRenderTarget = std::unique_ptr<ID2D1DCRenderTarget, UnknownReleaser>;
-using HwndRenderTarget = std::unique_ptr<ID2D1HwndRenderTarget, UnknownReleaser>;
-using D2DeviceContext = std::unique_ptr<ID2D1DeviceContext, UnknownReleaser>;
+using DCRenderTarget = ComPtr<ID2D1DCRenderTarget>;
-using D3D11Device = std::unique_ptr<ID3D11Device1, UnknownReleaser>;
-using D3D11DeviceContext = std::unique_ptr<ID3D11DeviceContext1, UnknownReleaser>;
+using D3D11Device = ComPtr<ID3D11Device1>;
HRESULT CreateDCRenderTarget(const D2D1_RENDER_TARGET_PROPERTIES *renderTargetProperties, DCRenderTarget &dcRT) noexcept;
-extern HRESULT CreateD3D(D3D11Device &device, D3D11DeviceContext &context) noexcept;
+extern HRESULT CreateD3D(D3D11Device &device) noexcept;
-using WriteRenderingParams = std::unique_ptr<IDWriteRenderingParams1, UnknownReleaser>;
+using WriteRenderingParams = ComPtr<IDWriteRenderingParams1>;
struct RenderingParams {
WriteRenderingParams defaultRenderingParams;