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

Author Topic: 640x480 in 800x600 window  (Read 2294 times)

0 Members and 1 Guest are viewing this topic.

EClaesson

  • Newbie
  • *
  • Posts: 13
    • MSN Messenger - emanuel.claesson@gmail.com
    • View Profile
    • Email
640x480 in 800x600 window
« on: February 26, 2011, 01:14:33 pm »
Hi. I want to show a 640x480 screen in a larger window. The window can be 800x600 or larger. I know that sf::View is good for this.

But how should i do it (for a 800x600 window)?
Code: [Select]
sf::View view;
view.setCenter(400, 300);
view.setHalfSize(400, 300);
view.Zoom(2.0f);


or

Code: [Select]
sf::View view;
view.setCenter(400, 300);
view.setHalfSize(320, 240);

or something else?

Thanks in advance.
//Emanuel Claesson

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
640x480 in 800x600 window
« Reply #1 on: February 26, 2011, 01:56:17 pm »
The view shouldn't know anything about the window it will be displayed in. Just setup with the size that want to view (640x480). Same for the center, this is the center of the world area that you want to display, this has nothing to do with the size of the target window.
Laurent Gomila - SFML developer

EClaesson

  • Newbie
  • *
  • Posts: 13
    • MSN Messenger - emanuel.claesson@gmail.com
    • View Profile
    • Email
640x480 in 800x600 window
« Reply #2 on: February 26, 2011, 02:00:15 pm »
Quote from: "Laurent"
The view shouldn't know anything about the window it will be displayed in. Just setup with the size that want to view (640x480). Same for the center, this is the center of the world area that you want to display, this has nothing to do with the size of the target window.


Thanks a lot Laurent! I really appreciate that you're taking time to help us.
That's worth a Flattr ;)
//Emanuel Claesson