Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Stretching image to fit window size  (Read 2730 times)

0 Members and 1 Guest are viewing this topic.

Mörkö

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Stretching image to fit window size
« on: February 13, 2015, 10:48:08 am »
I want to draw everything according to a fixed frame, say 1600x900, and then stretch or shrink the complete image according to actual window size. For example if the window is 1920x1080 then everything is slightly stretched but if it's 1024×768 then the image is shrunk down.

The SFML window seems to do this automatically if I create a window, draw something and manually resize the window, but how do I achieve the same effect by default?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Stretching image to fit window size
« Reply #1 on: February 13, 2015, 10:54:41 am »
After creating the window, change its default view to the desired size.
Laurent Gomila - SFML developer

Mörkö

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: Stretching image to fit window size
« Reply #2 on: February 13, 2015, 11:04:46 am »
Thanks that was simple, I was messing around with setting and changing sf::Views and making it way more difficult  ;D