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

Author Topic: How to always draw texture in its original resolution?  (Read 1766 times)

0 Members and 1 Guest are viewing this topic.

wixy0

  • Newbie
  • *
  • Posts: 4
    • View Profile
How to always draw texture in its original resolution?
« on: March 15, 2021, 12:47:10 am »
I want to draw texture always in its original resolution independent of resizing the window etc. Is it possible?

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: How to always draw texture in its original resolution?
« Reply #1 on: March 15, 2021, 04:04:28 am »
Draw on an sf::View that is the same size as the window.
If the window gets resized, resize the view accordingly. https://www.sfml-dev.org/tutorials/2.5/graphics-view.php#showing-more-when-the-window-is-resized

nfect

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: How to always draw texture in its original resolution?
« Reply #2 on: March 17, 2021, 02:35:37 am »
We might need a bit of your code to see what you're doing with your texture to point you  to the right solution. An sf::View is a good idea, but it really depends on what you want to do with that texture