Magic_Game/Easy2D/Win/winbase.cpp

31 lines
530 B
C++
Raw Normal View History

2017-10-10 01:14:03 +08:00
#include "winbase.h"
2017-10-12 02:44:44 +08:00
#include "..\emacros.h"
2017-10-10 01:14:03 +08:00
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-14 18:43:32 +08:00
ID2D1SolidColorBrush *& GetSolidColorBrush(D2D1_COLOR_F & color)
{
pRenderTarget->CreateSolidColorBrush(color, &m_pSolidBrush);
return m_pSolidBrush;
}