Function BlamRendering::DirectX::Utils::IntegerBitmapScale

Function Documentation

HRESULT BlamRendering::DirectX::Utils::IntegerBitmapScale(IWICBitmap *source, int scale_factor, ID2D1Bitmap **destination, ID2D1RenderTarget *target)

Scales a bitmap using integer scaling.

This function allows bitmaps to be scaled up and still remain pixel-sharp. Bitmap fonts will use this if the scale factor is set to an even integer. This was done so that any debug UI won’t look blurry and messy on higher resolution monitors, while also remaining easy to see.

I’m pretty sure that no other game engine actually does this for it’s debug UI, but I could be wrong.

Return

S_OK if the bitmap was scaled successfully, otherwise will return an error.

Parameters
  • source: - The original bitmap to scale.

  • scale_factor: - The scale factor to apply to the bitmap.

  • destination: - The destination bitmap to store the upscaled image.

  • target: - The render target that the bitmap will be drawn on.