Пример #1
0
        protected void TryFindSupportedFeatureLevel(GameGraphicsParameters prefferedParameters,
                                                    GraphicsAdapter graphicsAdapter,
                                                    List <GraphicsDeviceInformation> graphicsDeviceInfos,
                                                    AddDeviceToListDelegate addDelegate)
        {
            // Check if the adapter has an output with the preffered index
            if (prefferedParameters.IsFullScreen && graphicsAdapter.OutputsCount <= prefferedParameters.PreferredFullScreenOutputIndex)
            {
                return;
            }

            // Iterate on each preferred graphics profile
            foreach (var featureLevel in prefferedParameters.PreferredGraphicsProfile)
            {
                // Check if this profile is supported.
                if (graphicsAdapter.IsProfileSupported(featureLevel))
                {
                    var deviceInfo = CreateGraphicsDeviceInformation(prefferedParameters, graphicsAdapter, featureLevel);

                    addDelegate(prefferedParameters, graphicsAdapter, deviceInfo, graphicsDeviceInfos);

                    // If the profile is supported, we are just using the first best one
                    break;
                }
            }
        }
Пример #2
0
 private void AddDeviceToList(ListBox list, DeviceDiscovered device)
 {
     if (list.InvokeRequired)
     {
         AddDeviceToListDelegate del = new AddDeviceToListDelegate(AddDeviceToList);
         list.Invoke(del, new object[] { list, device });
     }
     else
     {
         list.Items.Add(device);
     }
 }
Пример #3
0
        protected void TryFindSupportedFeatureLevel(GameGraphicsParameters prefferedParameters,
                                                    GraphicsAdapter graphicsAdapter,
                                                    List<GraphicsDeviceInformation> graphicsDeviceInfos,
                                                    AddDeviceToListDelegate addDelegate)
        {
            // Check if the adapter has an output with the preffered index
            if (prefferedParameters.IsFullScreen && graphicsAdapter.OutputsCount <= prefferedParameters.PreferredFullScreenOutputIndex)
                return;

            // Iterate on each preferred graphics profile
            foreach (var featureLevel in prefferedParameters.PreferredGraphicsProfile)
            {
                // Check if this profile is supported.
                if (graphicsAdapter.IsProfileSupported(featureLevel))
                {
                    var deviceInfo = CreateGraphicsDeviceInformation(prefferedParameters, graphicsAdapter, featureLevel);

                    addDelegate(prefferedParameters, graphicsAdapter, deviceInfo, graphicsDeviceInfos);

                    // If the profile is supported, we are just using the first best one
                    break;
                }
            }
        }