SFML community forums

Help => Window => Topic started by: netrick on August 09, 2012, 07:54:08 pm

Title: Creating maximized window using SFML?
Post by: netrick 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 (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.
Title: Re: Creating maximized window using SFML?
Post by: eXpl0it3r 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?
Title: Re: Creating maximized window using SFML?
Post by: netrick 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?
Title: Re: Creating maximized window using SFML?
Post by: Laurent on August 09, 2012, 08:19:01 pm
No, sorry :(
Title: Re: Creating maximized window using SFML?
Post by: eXpl0it3r 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.
Title: Re: Creating maximized window using SFML?
Post by: netrick 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!
Title: Re: Creating maximized window using SFML?
Post by: eXpl0it3r 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. :-\