Итак, как я могу сохранить игру, даже когда я перемещаю или изменяет окно?
Код: Выделить всё
while (msg.message != WM_QUIT) {
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
TranslateMessage(&msg), DispatchMessageW(&msg);
// code of the game (renderering and mechanics)
}
< /code>
и это wndproc (): < /p>
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
switch(message) {
case WM_CLOSE:
DestroyWindow(hwnd);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProcW(hwnd, message, wParam, lParam);
}
Подробнее здесь: https://stackoverflow.com/questions/792 ... irect3d-11
Мобильная версия