SFML community forums

Help => Window => Topic started by: BlueCobold on November 01, 2016, 03:05:51 pm

Title: [Android] Calling Window::create more than once causes blackscreens
Post by: BlueCobold on November 01, 2016, 03:05:51 pm
As the title says. In case you're calling window.create() more than once on Android, the screen goes black and that's it. Even when calling it on the same window-instance!
Title: Re: [Android] Calling Window::create more than once causes blackscreens
Post by: DarkRoku12 on November 02, 2016, 12:20:09 am
I don't know is this would be a bug or better a "not-to-do" issue.

We tend to call
window.create()
agian because we need to change some window's settings.

Why would one do that on Android? 
I believe that we need to have only one (and permanent) window until the apps get closed.
Title: Re: [Android] Calling Window::create more than once causes blackscreens
Post by: BlueCobold on November 02, 2016, 06:46:52 am
The questions is this one: Why would I need to change my code which works on windows (where it can actually make changes to the window) to be different on Android? Sure it doesn't make sense, but the program shouldn't go black and be unrecoverable. That's just bad behaviour for a library. If it should not make any sense to call it multiple times on Android, shouldn't SFML take care of not doing anything at the 2nd call instead?

On iOS is also makes no sense to change the window properties, but on iOS calling it more than once isn't a problem at all and works just fine.
Title: Re: [Android] Calling Window::create more than once causes blackscreens
Post by: korczurekk on November 02, 2016, 07:01:59 am
No, second call may have sense even on Android, eg. changing depth. It's an SFML Bug and should be fixed. Or you have some memory problems (In ur code).
Title: Re: [Android] Calling Window::create more than once causes blackscreens
Post by: BlueCobold on November 02, 2016, 07:14:39 am
It's not a memory problem on my side. Even with a minimal sample, calling it more than once leads to the same issue.
Title: Re: [Android] Calling Window::create more than once causes blackscreens
Post by: Mario on November 03, 2016, 11:12:56 am
Can't look it up right now, but I'm pretty sure it's a bug related to how some Android stuff is handled right now (like sensors). You can only create one single window and that's it. It's definitely not intentional though. ;)
Title: Re: [Android] Calling Window::create more than once causes blackscreens
Post by: BlueCobold on November 03, 2016, 11:25:36 am
Bug/Issue-ticket?
Title: Re: [Android] Calling Window::create more than once causes blackscreens
Post by: Mario on November 09, 2016, 04:59:50 pm
Look if there's one, otherwise create one, it's definitely a valid issue, but I'm also not really sure how to handle this properly.