Now I wonder if I'm using a modern way of setting up a viewport. I have found these functions on msdn but I have no idea if these are still used nowadays.
hDC = BeginPaint(hWnd, &ps); GetClientRect(hWnd, &client); SetMapMode(hDC, MM_ANISOTROPIC); SetViewportOrgEx(hDC, client.right/2, client.bottom/2, 0); SetViewportExtEx(hDC, client.right, client.bottom, 0); SetWindowOrgEx(hDC, 0, 0 ,0); SetWindowExtEx(hDC, 2, 2, 0); Rectangle(hDC, 0, 0, 1, 1); EndPaint(hWnd, &ps);
This code sets up my window to 2 logical units, from -1 to 1. So like DirectX uses his viewport.
And I've changed the viewport extends so when I scale the window, the objects in the window are scaled also.