WinRT keep display on
hardcoredaniel <[email protected]>
| Newsgroups | gmane.comp.lib.sdl |
|---|---|
| Message-ID | <Rxm.BD9D.2tku2uRh6Mg.1NmN{[email protected]> |
Hi David,
I'm trying to keep the screen programmatically on for some time, but I'm not
doing it right. This is my simple code:
--------------------------
using namespace Windows::System::Display;
DisplayRequest ^ request = ref new DisplayRequest();
if (keepOn != 0)
{
request->RequestActive();
}
else
{
request->RequestRelease();
}
---------------------------
but there must be sth. fundamentally wrong with it, because when I call
RequestRelease() I get an exception from WinRT about calling something at an
unexpected time. I'm calling it from SDL's main thread, which is probably
not the UI thread.
I saw in your code for the game bar that you are using something called a
"dispatcher", I suppose this is to run sth. on the UI thread. Do I need to
do the same for DisplayRequest()? Anything else I have missed?
Regards,
Daniel
_______________________________________________
SDL mailing list
[email protected]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org