maui-linux/Xamarin.Forms.Platform.GTK/GtkOpenGL.cs

25 строки
789 B
C#
Исходник Обычный вид История

2017-09-28 14:52:27 +03:00
using OpenTK;
namespace Xamarin.Forms.Platform.GTK
{
public static class GtkOpenGL
{
public static bool IsInitialized { get; private set; }
public static void Init()
{
if (IsInitialized)
return;
// Initializes OpenTK. This method is necessary because we are using OpenTK alongside a different windowing toolkit (GTK#).
// Should be the very first method called by the application (i.e. calling this method should be the very first statement executed by the "Main" method).
Toolkit.Init(new ToolkitOptions
{
Backend = PlatformBackend.PreferNative,
EnableHighResolution = true
});
IsInitialized = true;
}
}
}