Magic_Game/Easy2D/Win/winbase.h

27 lines
470 B
C
Raw Normal View History

2017-10-10 01:14:03 +08:00
#pragma once
2017-10-13 11:42:36 +08:00
#include "..\emacros.h"
2017-10-12 02:44:44 +08:00
#include <d2d1.h>
#include <d2d1helper.h>
#include <dwrite.h>
#include <wincodec.h>
2017-10-14 01:07:34 +08:00
#pragma comment(lib, "d2d1.lib")
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-12 02:44:44 +08:00
ID2D1Factory * &GetFactory();
ID2D1HwndRenderTarget * &GetRenderTarget();
template<class Interface>
inline void SafeReleaseInterface(
Interface **ppInterfaceToRelease
)
{
if (*ppInterfaceToRelease != nullptr)
{
(*ppInterfaceToRelease)->Release();
(*ppInterfaceToRelease) = nullptr;
}
}