예제 #1
0
        void switchToTrueFullScreen(iDiligentWindow window)
        {
            if (window.windowState == eShowWindow.TrueFullscreen)
            {
                // Already in true full screen mode. Switch to maximized borderless.
                window.moveWindow(eShowWindow.Fullscreen);
                return;
            }

            iGraphicsEngine graphicsEngine = Render.graphicsEngine;

            using (var gpuEnum = graphicsEngine.createGpuEnumerator())
                using (var gpu = gpuEnum.openDefaultAdapter())
                    using (var connector = gpu.openDefaultConnector())
                    {
                        var format = context.swapChainFormats.color;
                        if (format == Diligent.Graphics.TextureFormat.Unknown)
                        {
                            throw new ApplicationException("The swap chain was not created");
                        }
                        connector.setSurfaceFormat(format);

                        // Debug code below
                        // Console.WriteLine( "Following is available:\n{0}", string.Join( "\n", connector.getAllModes() ) );
                        // connector.enumModes();

                        CSize trueFullScreenRez = new CSize(1920, 1080);
                        if (!connector.findVideoMode(out var mode, ref trueFullScreenRez))
                        {
                            throw new ApplicationException("The default monitor doesn't support FullHD");
                        }
                        window.fullScreen(connector, ref mode);
                    }
        }
예제 #2
0
 public static void print(iGraphicsEngine engine)
 {
     using (var dispatcher = engine.dispatcher())
         using (var gpuEnum = engine.createGpuEnumerator())
             using (var gpu = gpuEnum.openFirstAdapter())
             {
                 int count = gpu.getInfo().numConnectors;
                 for (int i = 0; i < count; i++)
                 {
                     using (var c = gpu.openConnector(i))
                         Console.WriteLine(c.getInfo().ToString());
                 }
             }
 }