摘要:
为方便,将D2D的一个基本类DesktopWindow写成如下所示:View Code #include "Precompiled.h"#include <d2d1.h>#include <wrl.h>#pragma comment(lib, "d2d1")using namespace D2D1;using namespace Microsoft::WRL;template<typename T>struct DesktopWindow : CWindowImpl<T, CWindow, CWinTraits& 阅读全文
摘要:
Direct2D基于Windows窗体,因此必须了解一些基本的Windows窗体编程:首先,最基本的,可以使用Windows API写一个窗体:View Code #include <Windows.h>typedef LRESULT (* message_callback)(HWND, WPARAM, LPARAM);struct message_handler{ UINT message; message_callback handler;};static message_handler s_handlers[] = { { WM_PAINT, [] (HW... 阅读全文