on WM_PAINT */
| 1122 | |
| 1123 | /* on WM_PAINT */ |
| 1124 | void |
| 1125 | onPaint(HWND hWnd) |
| 1126 | { |
| 1127 | PNHMapWindow data = (PNHMapWindow) GetWindowLongPtr(hWnd, GWLP_USERDATA); |
| 1128 | |
| 1129 | PAINTSTRUCT ps; |
| 1130 | HDC hFrontBufferDC = BeginPaint(hWnd, &ps); |
| 1131 | |
| 1132 | /* stretch back buffer onto front buffer window */ |
| 1133 | int frontWidth = COLNO * data->xFrontTile; |
| 1134 | int frontHeight = ROWNO * data->yFrontTile; |
| 1135 | |
| 1136 | StretchBlt(hFrontBufferDC, |
| 1137 | data->map_orig.x - (data->xPos * data->xFrontTile), |
| 1138 | data->map_orig.y - (data->yPos * data->yFrontTile), frontWidth, frontHeight, |
| 1139 | data->backBufferDC, 0, 0, data->backWidth, data->backHeight, SRCCOPY); |
| 1140 | |
| 1141 | EndPaint(hWnd, &ps); |
| 1142 | } |
| 1143 | |
| 1144 | /* on WM_VSCROLL */ |
| 1145 | void |