41LRESULT CALLBACK
WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){
43 static bool bResizing =
false;
60 nMenuId = LOWORD(wParam);
67 InvalidateRect(hWnd,
nullptr, FALSE);
75 SendMessage(hWnd, WM_CLOSE, 0, 0);
84 InvalidateRect(hWnd,
nullptr, FALSE);
89 "https://ian-parberry.github.io/wangtiler/html/",
95 "Copyright © Ian Parberry, 2022.\nSource code available under the MIT License from https://github.com/Ian-Parberry/wangtiler.",
96 "About", MB_ICONINFORMATION | MB_OK);
103 return DefWindowProc(hWnd, message, wParam, lParam);
116int WINAPI
wWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR lpStr,
int nShow){
117 UNREFERENCED_PARAMETER(hPrev);
118 UNREFERENCED_PARAMETER(lpStr);
124 while(GetMessage(&msg,
nullptr, 0, 0)){
125 TranslateMessage(&msg);
126 DispatchMessage(&msg);
129 return (
int)msg.wParam;
Interface for the main class CMain.
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Window procedure.
static CMain * g_pMain
Pointer to the main class.
int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR lpStr, int nShow)
Winmain.
HRESULT SaveBitmap(HWND hwnd, Gdiplus::Bitmap *pBitmap)
Save bitmap to file.
void InitWindow(HINSTANCE hInst, INT nShow, WNDPROC WndProc)
Initialize window.
#define IDM_TILESET_FLOWER
Menu id for flower tileset.
#define IDM_FILE_SAVE
Menu id for Save.
#define IDM_TILESET_GRASS
Menu id for grass tileset.
#define IDM_FILE_QUIT
Menu id for Quit.
#define IDM_FILE_GENERATE
Menu id for Generate.
#define IDM_HELP_HELP
Menu id for display help.
#define IDM_TILESET_MUD
Menu id for dirt tileset.
#define IDM_HELP_ABOUT
Menu id for display About info.
#define IDM_TILESET_DEFAULT
Menu id for default tileset.
HRESULT LoadTileSet(const UINT idm, const UINT n)
Load tileset.
void Draw()
Draw the Wang tiling.
void Generate()
Generate a Wang tiling.
Gdiplus::Bitmap * GetBitmap()
Get pointer to bitmap.
void OnPaint()
Paint the client area of the window.