39 lines
768 B
C++
39 lines
768 B
C++
#pragma once
|
|
#include "..\emacros.h"
|
|
#include <d2d1.h>
|
|
#include <d2d1helper.h>
|
|
#include <dwrite.h>
|
|
#include <wincodec.h>
|
|
#pragma comment(lib, "d2d1.lib")
|
|
#pragma comment(lib, "dwrite.lib")
|
|
#pragma comment(lib, "windowscodecs.lib")
|
|
|
|
|
|
#ifndef HINST_THISCOMPONENT
|
|
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
|
|
#define HINST_THISCOMPONENT ((HINSTANCE)&__ImageBase)
|
|
#endif
|
|
|
|
|
|
HWND &GetHWnd();
|
|
|
|
ID2D1Factory * &GetFactory();
|
|
|
|
ID2D1HwndRenderTarget * &GetRenderTarget();
|
|
|
|
ID2D1SolidColorBrush * &GetSolidColorBrush();
|
|
|
|
IWICImagingFactory * &GetImagingFactory();
|
|
|
|
template<class Interface>
|
|
inline void SafeReleaseInterface(
|
|
Interface **ppInterfaceToRelease
|
|
)
|
|
{
|
|
if (*ppInterfaceToRelease != nullptr)
|
|
{
|
|
(*ppInterfaceToRelease)->Release();
|
|
|
|
(*ppInterfaceToRelease) = nullptr;
|
|
}
|
|
} |