Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualL. Spiro

Posted 04 June 2014 - 09:00 PM

The pixels aren’t being stretched, they are being squashed.

When the backbuffer and the window are not the same size the image will be rescaled upon presenting, which is what is happening here.

 

Most likely you set the window to 640-480 and you set the back buffer to the same value without taking into account the borders (hence it is squashed more vertically than horizontally, as vertically you have extra window border spent on the title bar).

The client area of a window will be smaller than the actual window size.  Your back buffer must be the same size as the client rectangle to avoid scaling.

 

If you want the client area to be 640-480, adjust the window size using AdjustWindowRect().

 

 

L. Spiro


#1L. Spiro

Posted 04 June 2014 - 06:46 PM

The pixels aren’t being stretched, they are being squashed.

When the backbuffer and the window are not the same size the image will be rescaled upon presenting, which is what is happening here.

 

Most likely you set the window to 640-480 and you set the back buffer to the same value without taking into account the borders (hence it is squashed more vertically than horizontally).

The client area of a window will be smaller than the actual window size.  Your back buffer must be the same size as the client rectangle to avoid scaling.

 

If you want the client area to be 640-480, adjust the window size using AdjustWindowRect().

 

 

L. Spiro


PARTNERS