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

Author Topic: Creating maximized window using SFML?  (Read 8521 times)

0 Members and 1 Guest are viewing this topic.

netrick

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Creating maximized window using SFML?
« on: August 09, 2012, 07:54:08 pm »
Well I can't find a way to create window that is created maximized. I thought about using VideoMode::getDesktopMode() and deduct taskbar, title and borders dimensions, but that's impossible because there are so many possibilities, skins etc so that wouldn't work. Is there any way to create maximized window in sfml? By maximized I mean this http://i.imgur.com/yCP1o.png (i mean file browser window ofc). Probably it can be done somehow in winapi but I'd prefer to find SFML solution.

Thanks in advance!

EDIT:
Yes, doing it while creating window in winapi is pretty easy. However I'm still looking for SFML solution to this problem (portable code is very important to me). So I'm still in need of sfml solution!

EDIT2:
SFML has window.setSize function (obviously), so I think there is some way to force sfml to send "maximize window" to OS. But I simply can't find it in documentation but I think it must exist.
« Last Edit: August 09, 2012, 08:07:48 pm by netrick »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Creating maximized window using SFML?
« Reply #1 on: August 09, 2012, 08:06:26 pm »
SFML doesn't implement such a feature.
The exacte reasons can only give Laurent, but since SFML is targeting game development this feature is rarely to never used (either window mode or fullscreen).
May I ask why you need it?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

netrick

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Re: Creating maximized window using SFML?
« Reply #2 on: August 09, 2012, 08:09:45 pm »
I need it for 2D game and it would be the most convenient to start it maximized automatically. Also, I need it for my editor too (I need a lot of screen space, and maximizing it every time isn't convenient as I said). So no chance for doing it without rewriting some functions manually?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Creating maximized window using SFML?
« Reply #3 on: August 09, 2012, 08:19:01 pm »
No, sorry :(
Laurent Gomila - SFML developer

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Creating maximized window using SFML?
« Reply #4 on: August 09, 2012, 08:22:52 pm »
As you've noticed yourself there's no such thing in the documentation and if it's not there it's not in the source. ;)
I've never seen a game that starts maximized, so I don't see how this would be convenient, it's usually windowed at a fixed size or fullscreen...
For an editor it could be usefull but like I said SFML doesn't target editors.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

netrick

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Re: Creating maximized window using SFML?
« Reply #5 on: August 09, 2012, 08:24:02 pm »
Okay so I'll have to do it other way. I don't want to start another thread so I'll ask here - is there in sfml any kind of event that says that window got maximized? And is there a way to disable window resizing (but keeping the maximize button available at the same time)?

Thanks

EDIT:
I think I'll just use some small library for advanced window features. Luckily it's very easy to integrate SFML with another window library. Again, amazing work Lauren!
« Last Edit: August 09, 2012, 08:35:37 pm by netrick »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Creating maximized window using SFML?
« Reply #6 on: August 09, 2012, 08:55:24 pm »
Is there in sfml any kind of event that says that window got maximized?
And is there a way to disable window resizing (but keeping the maximize button available at the same time)?
No and no. :-\
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything