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-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();
|
|
|
|
|
|
|
|
|
|
void WindowCenter(HWND hWnd);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<class Interface>
|
|
|
|
|
inline void SafeReleaseInterface(
|
|
|
|
|
Interface **ppInterfaceToRelease
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
if (*ppInterfaceToRelease != nullptr)
|
|
|
|
|
{
|
|
|
|
|
(*ppInterfaceToRelease)->Release();
|
|
|
|
|
|
|
|
|
|
(*ppInterfaceToRelease) = nullptr;
|
|
|
|
|
}
|
|
|
|
|
}
|