   Size Window Application
  Hi.I use DirectX 9.The window is create with the function "CreateWindowEx" with width equal to height (equal to 900). The monitor has resolution 1280x1024.The question is:the virtual sphere is not a sphere because is a bit flattened. The 3D object has to be the original object and deformate (in this case flattened in height). How can I do ?I've to increase the height of the window or set the resolution as square in pixel. Or it dependes by the height of the pixel of the screen. Or is another the problem ?Thanks for all.   
  It seems that you might have an incorrect projection matrix setup. You might have a problem where you are taking the screen width / screen height, but your window is a perfect square.Make sure that you are using your window width and height to calculate your aspect ratioI hope this helps.   ;  Though unrelated, remember, if you want a window to be 900x900, you need to call AdjustWindowRectEx() to get the actual size passed in to CreateWindowEx.Problem is probably in your projection matrix.   ;Quote:Original post by marius1930Though unrelated, remember, if you want a window to be 900x900, you need to call AdjustWindowRectEx() to get the actual size passed in to CreateWindowEx.So, I've to use the function CreateWindowEx before and, only after, call AdjustWindowRectEx. Is right now ?For the projection matrix, the aspect ratio of the the projection matrix has to be the same ratio between height and width used in CreateWindowEx. Is correct ?   ;Quote:Original post by ClaudioFor the projection matrix, the aspect ratio of the the projection matrix has to be the same ratio between height and width used in CreateWindowEx. Is correct ?No, the aspect ratio must match the size of the viewport, which is not necessarily the same as the size of the window. As marius1930 said, you need to adjust the parameters to CreateWindow such that the client area is the desired size.The size you pass to CreateWindow is the size of the window. Making room for border and title bar, the client are you use for your viewport will be smaller and will not have the same aspect ratio as the window. If you want a client area of 900x900, you need to use AdjustWindowRect to adjust the window size so the client are have the desired size, and then create the window using the adjusted size.   ;Quote:Original post by Brother BobIf you want a client area of 900x900, you need to use AdjustWindowRect to adjust the window size so the client are have the desired size, and then create the window using the adjusted size.The code is:RECT lprSizeClientWindow;lprSizeClientWindow.left = 110;lprSizeClientWindow.top = 50;lprSizeClientWindow.right = lprSizeClientWindow.left + 900;lprSizeClientWindow.bottom = lprSizeClientWindow.top + 900;bool res = AdjustWindowRectEx(&lprSizeClientWindow, WS_OVERLAPPEDWINDOW, FALSE, WS_EX_OVERLAPPEDWINDOW);HWND hWindow = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW,  __TEXT("FX App Window Class"),  __TEXT("Title"),  WS_OVERLAPPEDWINDOW,  lprSizeClientWindow.left, lprSizeClientWindow.top, // Position of the window: horizzontal and vertical position  lprSizeClientWindow.right-lprSizeClientWindow.left, lprSizeClientWindow.bottom-lprSizeClientWindow.top, // width and height of the window  NULL,  NULL,  NULL,  NULL);While the viewport aspect ratio is: 900/900.Is correct so ?The windows has also the menu but the desired size (without menu) is 900x900.But there is the problem also now.[Edited by - Claudio on June 15, 2009 5:58:59 AM]