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

Author Topic: window creation for different resolutions  (Read 2882 times)

0 Members and 1 Guest are viewing this topic.

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
window creation for different resolutions
« on: February 04, 2013, 02:07:42 pm »
Hi

We prepare our graphics to one size (1024x768) and then create a window to that size. For systems that have a different resolution, we then resize the window to the necessary resolution. This all works fine.

The problem is, for a very specific system, they require that the window be created at the correct resolution first of all, and not resized. If we create a window to the correct resolution, then the graphics go crazy (very streched). So my question is, how do I create a window at the right size but stretch my 1024x768 graphics into the window correctly? The window may also be smaller than 1024x768....

Also, how do I get the window at the correct position initially, and not have to call myWindow.setPosition ? This is also a problem on this crazy system :(

Thanks
Ed
« Last Edit: February 04, 2013, 03:16:29 pm by slotdev »
SFML 2.1

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Re: window creation for different resolutions
« Reply #1 on: February 04, 2013, 02:20:32 pm »
I found how to change the default position of a window, WindowImplWin32. It defaults to middle of the screen :)
SFML 2.1

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: window creation for different resolutions
« Reply #2 on: February 04, 2013, 03:58:32 pm »
Whenever you work with changing resolutions, you'll most probably want to take a look at sf::View. I've written a tutorial in the past, which can give a bit of an intuition.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything