2017-10-10 01:14:03 +08:00
|
|
|
#include "winbase.h"
|
|
|
|
|
|
2017-10-13 11:42:36 +08:00
|
|
|
HWND hwnd = nullptr;
|
|
|
|
|
ID2D1Factory * pDirect2dFactory = nullptr;
|
|
|
|
|
ID2D1HwndRenderTarget * pRenderTarget = nullptr;
|
2017-10-14 18:43:32 +08:00
|
|
|
ID2D1SolidColorBrush * m_pSolidBrush = nullptr;
|
2017-10-10 01:14:03 +08:00
|
|
|
|
2017-10-12 02:44:44 +08:00
|
|
|
|
|
|
|
|
HWND &GetHWnd()
|
2017-10-10 01:14:03 +08:00
|
|
|
{
|
2017-10-13 11:42:36 +08:00
|
|
|
return hwnd;
|
2017-10-10 01:14:03 +08:00
|
|
|
}
|
|
|
|
|
|
2017-10-12 02:44:44 +08:00
|
|
|
ID2D1Factory * &GetFactory()
|
2017-10-10 01:14:03 +08:00
|
|
|
{
|
2017-10-13 11:42:36 +08:00
|
|
|
return pDirect2dFactory;
|
2017-10-11 11:15:17 +08:00
|
|
|
}
|
|
|
|
|
|
2017-10-12 02:44:44 +08:00
|
|
|
ID2D1HwndRenderTarget * &GetRenderTarget()
|
2017-10-11 11:15:17 +08:00
|
|
|
{
|
2017-10-13 11:42:36 +08:00
|
|
|
return pRenderTarget;
|
2017-10-11 11:15:17 +08:00
|
|
|
}
|
|
|
|
|
|
2017-10-15 02:46:24 +08:00
|
|
|
ID2D1SolidColorBrush *& GetSolidColorBrush()
|
2017-10-14 18:43:32 +08:00
|
|
|
{
|
2017-10-15 02:46:24 +08:00
|
|
|
if (!m_pSolidBrush)
|
|
|
|
|
{
|
|
|
|
|
pRenderTarget->CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::White), &m_pSolidBrush);
|
|
|
|
|
}
|
2017-10-14 18:43:32 +08:00
|
|
|
return m_pSolidBrush;
|
|
|
|
|
}
|
|
|
|
|
|