[windows]on neko or cpp - screen going blank after vga un/plug

Hello everyone,

I am a beginner programmer and I have started using haxe - openfl a month ago.
I develop on programmes windows 8.

so here is what happened:

I was playing at piratepig on my laptop,
I had plugged an extra screen to my laptop using a vga cable (I haven’t tried with hdmi), then there was a power failure (which is an everyday case scenario where I live).
thus everything came back to my inbuilt screen. and right after, I noticed that piratepig went dark. when the power came back I plugged it hoping for a change but nothing… then I thought of minimizing the game and get it back up… and the screen become blank, pure white.

After, i tried many combinaison on different apps, and realized this:

  • it only occured on neko and cpp
  • all sounds and Mouse events were working perfectly. I tried only those because they are the only ones I could easily use with trace. sorry I am still a beginner.
  • flash and html weren’t affected at all, I guess because of the browser and the adobe flash-thing.

conclusion, the programmes work after vga unplug or plug but nothing is showing on the window frame.

PS: I don’t know if there are logs for neko and cpp, neither do I know where all logs are located.
So those are the only info I can bring. Sorry I am still a beginner.

Sounds like the OpenGL context got disposed. I’ve seen similar results on Android after the app is sent to the background.

Though I could be wrong. They mentioned in passing that Android is more likely to lose the GL context than other platforms.

wow opengl, I know nothing about it, thus I won’t be able to fix.
thanks player_03

In the past, we used SDL, which lost it’s GL context whenever you resized the window. We now use SDL2, which preserves the context during these events, I have not been able to lose the context with SDL2 yet on the desktop, though I understand how this could be possible.

I think we just need to add proper context lost support in the “next” renderer, and perhaps find some event we could listen for on the desktop. The current native target should handle a context lost on, say, Android, but it expects it won’t happen on the desktop with SDL.

Is there a simpler way to force it to occur? I’m guessing this is so rare, we don’t have to worry at the moment, but it would still be nice to handle

I haven’t found any simpler way to force it to occur, except changing the multiple displays settings while having an extra screen plugged in.

Multiple displays setting:
control Panel -> Appearance and Personalisation -> display -> screen resolution on windows8.

I understand it not being a priority at the moment because power failure doesn’t happen often wherever you live.

But it is kind of worry for me, because I am more likely to run into this kind of scenario:

let’s say I want to show a programme to an audience, and I have more than one screen connected to a desktop. During the presentation, we have another usual, power failure meaning my program goes blank again. Then someone switchs on the generator of electricity, and the audience sees my program all blank.

And this thought threaten me, because power outage is a everyday situation. So running into this scenario is more than a possibility.

If I knew what kind of specific events happens, or how computers behave when the setting changes, I would have helped with more info.

EDIT: I have noticed something very helpful!!! OpenGL context only gets disposed when the display settings are changing from the state extended to any other(duplicate, 1st screen only, 2nd screen only).
the other states doesn’t affect OpenGL at all even after a power failure!
sad story - noticed that during a power failure.

Okay, that’s good, I am testing a newer SDL version, perhaps it handles this case, otherwise, we’ll just need to detect a trigger for when the context has been lost or restored, I wonder what we should use