Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualInterminable

Posted 30 July 2012 - 09:46 AM



I believe that this is your answer.

If you have a Window of 800x600 for example. The client area is less (eg 792x594 or something like that).

If you have set your D3DPRESENTPARAMETERS to 800 x 600 the DX screen will differ from your actual client area.

So, your sprites will be getting resized to fit and you will definately get the phenomenon that you are having.

If you run full screen, do you have the same problem (I am guessing not).


You're right, in fullscreen the issue does not appear to be present!

However, when trying to set the present parameters to the client area size, it didn't fix the issue when running it in a window.

This is what I was doing:

RECT tempRect;
GetClientRect(hwndInput, &tempRect);
d3dPresentationParameters.BackBufferWidth = tempRect.right;
d3dPresentationParameters.BackBufferHeight = tempRect.bottom;


How are you building your window? You have to do some math in order to get the client size correct by taking into accound the size of the windows border, its been a while since i have programmed that kind of thing, but lets see your window creation.


This is what GetClientRect() does, or at least that's my understanding of it. GetWindowRect() would get the size including the border, etc.

EDIT: Interestingly, if I run it fullscreen at a resolution other than my native one (or the one I'm currently on I'm assuming), IDirect3DDevice9::Present() fails, but checking the HRESULT says the operation completed successfully. I have no idea what's wrong there.

#1Interminable

Posted 30 July 2012 - 08:59 AM



I believe that this is your answer.

If you have a Window of 800x600 for example. The client area is less (eg 792x594 or something like that).

If you have set your D3DPRESENTPARAMETERS to 800 x 600 the DX screen will differ from your actual client area.

So, your sprites will be getting resized to fit and you will definately get the phenomenon that you are having.

If you run full screen, do you have the same problem (I am guessing not).


You're right, in fullscreen the issue does not appear to be present!

However, when trying to set the present parameters to the client area size, it didn't fix the issue when running it in a window.

This is what I was doing:

RECT tempRect;
GetClientRect(hwndInput, &tempRect);
d3dPresentationParameters.BackBufferWidth = tempRect.right;
d3dPresentationParameters.BackBufferHeight = tempRect.bottom;


How are you building your window? You have to do some math in order to get the client size correct by taking into accound the size of the windows border, its been a while since i have programmed that kind of thing, but lets see your window creation.


This is what GetClientRect() does, or at least that's my understanding of it. GetWindowRect() would get the size including the border, etc.

PARTNERS