30 lines
653 B
Plaintext
30 lines
653 B
Plaintext
|
module;
|
||
|
#include <d2d1.h>
|
||
|
#include <wrl/client.h>
|
||
|
#include <wincodec.h>
|
||
|
|
||
|
export module Graphics;
|
||
|
|
||
|
import Math;
|
||
|
|
||
|
export class Graphics
|
||
|
{
|
||
|
template <class T>
|
||
|
using ComPtr = ::Microsoft::WRL::ComPtr<T>;
|
||
|
public:
|
||
|
static void Init(HWND hwnd);
|
||
|
static void BeginDraw();
|
||
|
static void Clear();
|
||
|
static void Present();
|
||
|
static void Finalize();
|
||
|
|
||
|
static void DrawBitMap(const ComPtr<ID2D1Bitmap>& bitmap, D2D_RECT_F dst, D2D_RECT_F src);
|
||
|
|
||
|
static ComPtr<ID2D1Bitmap> LoadImageFromFile(LPCWSTR uri);
|
||
|
private:
|
||
|
static ComPtr<IWICImagingFactory> wic_factory;
|
||
|
static ComPtr<ID2D1HwndRenderTarget> RT;
|
||
|
static Vector2 RtSize;
|
||
|
};
|
||
|
|