Beispiel #1
0
        static Factory()
        {
            if (Configuration.Sdl2Supported) Default = new SDL2.Sdl2Factory();
            else if (Configuration.RunningOnWindows) Default = new Windows.WinFactory();
            else if (Configuration.RunningOnMacOS) Default = new MacOS.MacOSFactory();
            else if (Configuration.RunningOnX11) Default = new X11.X11Factory();
            else Default = new UnsupportedPlatform();

            if (Configuration.Sdl2Supported)
            {
                Embedded = new Egl.EglSdl2PlatformFactory();
            }
            else if (Egl.Egl.IsSupported)
            {
                if (Configuration.RunningOnWindows) Embedded = new Egl.EglWinPlatformFactory();
                else if (Configuration.RunningOnMacOS) Embedded = new Egl.EglMacPlatformFactory();
                else if (Configuration.RunningOnX11) Embedded = new Egl.EglX11PlatformFactory();
                else Embedded = new UnsupportedPlatform();
            }
            else
            {
                Embedded = new UnsupportedPlatform();
            }

            if (Default is UnsupportedPlatform && !(Embedded is UnsupportedPlatform))
                Default = Embedded;
        }
Beispiel #2
0
        static Factory()
        {
            if (Configuration.Sdl2Supported)
            {
                Default = new SDL2.Sdl2Factory();
            }
            else if (Configuration.RunningOnWindows)
            {
                Default = new Windows.WinFactory();
            }
            else if (Configuration.RunningOnMacOS)
            {
                Default = new MacOS.MacOSFactory();
            }
            else if (Configuration.RunningOnX11)
            {
                Default = new X11.X11Factory();
            }
            else
            {
                Default = new UnsupportedPlatform();
            }

            if (Configuration.Sdl2Supported)
            {
                Embedded = new Egl.EglSdl2PlatformFactory();
            }
            else if (Egl.Egl.IsSupported)
            {
                if (Configuration.RunningOnWindows)
                {
                    Embedded = new Egl.EglWinPlatformFactory();
                }
                else if (Configuration.RunningOnMacOS)
                {
                    Embedded = new Egl.EglMacPlatformFactory();
                }
                else if (Configuration.RunningOnX11)
                {
                    Embedded = new Egl.EglX11PlatformFactory();
                }
                else
                {
                    Embedded = new UnsupportedPlatform();
                }
            }
            else
            {
                Embedded = new UnsupportedPlatform();
            }

            if (Default is UnsupportedPlatform && !(Embedded is UnsupportedPlatform))
            {
                Default = Embedded;
            }
        }