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

Author Topic: [Android] Calling Window::create more than once causes blackscreens  (Read 5135 times)

0 Members and 1 Guest are viewing this topic.

BlueCobold

  • Full Member
  • ***
  • Posts: 105
    • View Profile
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!
« Last Edit: November 01, 2016, 03:31:27 pm by BlueCobold »

DarkRoku12

  • Full Member
  • ***
  • Posts: 203
  • Lua coder.
    • View Profile
    • Email
Re: [Android] Calling Window::create more than once causes blackscreens
« Reply #1 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.
I would like a spanish/latin community...
Problems building for Android? Look here

BlueCobold

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: [Android] Calling Window::create more than once causes blackscreens
« Reply #2 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.

korczurekk

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • Email
Re: [Android] Calling Window::create more than once causes blackscreens
« Reply #3 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).

BlueCobold

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: [Android] Calling Window::create more than once causes blackscreens
« Reply #4 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.

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: [Android] Calling Window::create more than once causes blackscreens
« Reply #5 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. ;)

BlueCobold

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: [Android] Calling Window::create more than once causes blackscreens
« Reply #6 on: November 03, 2016, 11:25:36 am »
Bug/Issue-ticket?

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: [Android] Calling Window::create more than once causes blackscreens
« Reply #7 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.