mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-02-03 01:01:07 +00:00
[Examples] Only use WinForms when supported.
This commit is contained in:
parent
b23d06eb46
commit
b1a31c08cc
|
@ -23,16 +23,35 @@ namespace Examples.Tests
|
||||||
DisplayDevice dev = DisplayDevice.GetDisplay(DisplayIndex.First + i);
|
DisplayDevice dev = DisplayDevice.GetDisplay(DisplayIndex.First + i);
|
||||||
if (dev != null)
|
if (dev != null)
|
||||||
{
|
{
|
||||||
Trace.WriteLine(dev.ToString());
|
Print(dev.ToString());
|
||||||
MessageBox.Show(dev.ToString());
|
|
||||||
dev.ChangeResolution(dev.SelectResolution(640, 480, 32, 60.0f));
|
dev.ChangeResolution(dev.SelectResolution(640, 480, 32, 60.0f));
|
||||||
Thread.Sleep(1000);
|
Thread.Sleep(1000);
|
||||||
MessageBox.Show(dev.ToString());
|
Print(dev.ToString());
|
||||||
|
|
||||||
dev.RestoreResolution();
|
dev.RestoreResolution();
|
||||||
Thread.Sleep(1000);
|
Thread.Sleep(1000);
|
||||||
MessageBox.Show(dev.ToString());
|
Print(dev.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void Print(string msg)
|
||||||
|
{
|
||||||
|
Trace.WriteLine(msg);
|
||||||
|
|
||||||
|
// Also display a MessageBox when running on a platform
|
||||||
|
// with WinForms support.
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (Configuration.RunningOnWindows || Configuration.RunningOnX11 || Configuration.RunningOnMacOS)
|
||||||
|
{
|
||||||
|
MessageBox.Show(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue