コード例 #1
0
ファイル: GraphicsFramework.cs プロジェクト: tmp7701/Gorgon
        /// <summary>
        /// Initializes a new instance of the <see cref="GraphicsFramework"/> class.
        /// </summary>
        public GraphicsFramework()
        {
            ClearScreen = true;
            GorgonVideoDeviceEnumerator.Enumerate(true, true);

            _form = new TestForm();
            //Graphics = new GorgonGraphics(GorgonVideoDeviceEnumerator.VideoDevices.Single(item => item.VideoDeviceType == VideoDeviceType.ReferenceRasterizer));
            Graphics = new GorgonGraphics();
        }
コード例 #2
0
ファイル: AppContext.cs プロジェクト: tmp7701/Gorgon
        /// <summary>
        /// Function to initialize the graphics interface.
        /// </summary>
        private void InitializeGraphics()
        {
            // Initialize our graphics interface.
            _splash.UpdateVersion(Resources.GOREDIT_TEXT_INITIALIZE_GRAPHICS);

            // Find the best device in the system.
            GorgonVideoDeviceEnumerator.Enumerate(false, false);

            GorgonVideoDevice bestDevice = GorgonVideoDeviceEnumerator.VideoDevices[0];

            // If we have more than one device, use the best available device.
            if (GorgonVideoDeviceEnumerator.VideoDevices.Count > 1)
            {
                bestDevice = (from device in GorgonVideoDeviceEnumerator.VideoDevices
                              orderby device.SupportedFeatureLevel descending, GorgonVideoDeviceEnumerator.VideoDevices.IndexOf(device)
                              select device).First();
            }

            ContentObject.Graphics = new GorgonGraphics(bestDevice);
        }