diff options
author | nyamatongwe <unknown> | 2013-05-08 11:47:27 +1000 |
---|---|---|
committer | nyamatongwe <unknown> | 2013-05-08 11:47:27 +1000 |
commit | bec5dd1f96911abfe65aded29212bd50a3d89c24 (patch) | |
tree | b29244fd7d346d7cc357fe779954daf617f8bba3 /win32/ScintillaWin.cxx | |
parent | 91d928e41eb04dfb81656310f503a54eaf90293b (diff) | |
download | scintilla-mirror-bec5dd1f96911abfe65aded29212bd50a3d89c24.tar.gz |
Partial fix for compiling Direct2D code with MinGW-w64.
Also needs changes to GUID code and the pixel format in InitPixMap but the
correct code for those issues is less certain.
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r-- | win32/ScintillaWin.cxx | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 7d8efe3b0..94d676a4f 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -425,10 +425,21 @@ void ScintillaWin::EnsureRenderTarget() { // Create a Direct2D render target. #if 1 - pD2DFactory->CreateHwndRenderTarget( - D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_DEFAULT, D2D1::PixelFormat(), 96.0, 96.0), - D2D1::HwndRenderTargetProperties(hw, size), - &pRenderTarget); + D2D1_HWND_RENDER_TARGET_PROPERTIES dhrtp; + dhrtp.hwnd = hw; + dhrtp.pixelSize = size; + dhrtp.presentOptions = D2D1_PRESENT_OPTIONS_NONE; + + D2D1_RENDER_TARGET_PROPERTIES drtp; + drtp.type = D2D1_RENDER_TARGET_TYPE_DEFAULT; + drtp.pixelFormat.format = DXGI_FORMAT_UNKNOWN; + drtp.pixelFormat.alphaMode = D2D1_ALPHA_MODE_UNKNOWN; + drtp.dpiX = 96.0; + drtp.dpiY = 96.0; + drtp.usage = D2D1_RENDER_TARGET_USAGE_NONE; + drtp.minLevel = D2D1_FEATURE_LEVEL_DEFAULT; + + pD2DFactory->CreateHwndRenderTarget(drtp, dhrtp, &pRenderTarget); #else pD2DFactory->CreateHwndRenderTarget( D2D1::RenderTargetProperties( @@ -2800,10 +2811,21 @@ sptr_t PASCAL ScintillaWin::CTWndProc( surfaceWindow->Init(ps.hdc, hWnd); } else { #if defined(USE_D2D) - pD2DFactory->CreateHwndRenderTarget( - D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_DEFAULT, D2D1::PixelFormat(), 96.0, 96.0), - D2D1::HwndRenderTargetProperties(hWnd, D2D1::SizeU(rc.right - rc.left, rc.bottom - rc.top)), - &pCTRenderTarget); + D2D1_HWND_RENDER_TARGET_PROPERTIES dhrtp; + dhrtp.hwnd = hWnd; + dhrtp.pixelSize = D2D1::SizeU(rc.right - rc.left, rc.bottom - rc.top); + dhrtp.presentOptions = D2D1_PRESENT_OPTIONS_NONE; + + D2D1_RENDER_TARGET_PROPERTIES drtp; + drtp.type = D2D1_RENDER_TARGET_TYPE_DEFAULT; + drtp.pixelFormat.format = DXGI_FORMAT_UNKNOWN; + drtp.pixelFormat.alphaMode = D2D1_ALPHA_MODE_UNKNOWN; + drtp.dpiX = 96.0; + drtp.dpiY = 96.0; + drtp.usage = D2D1_RENDER_TARGET_USAGE_NONE; + drtp.minLevel = D2D1_FEATURE_LEVEL_DEFAULT; + + pD2DFactory->CreateHwndRenderTarget(drtp, dhrtp, &pCTRenderTarget); surfaceWindow->Init(pCTRenderTarget, hWnd); pCTRenderTarget->BeginDraw(); #endif |