public virtual OutputRequirements GetDeviceRequirements(RenderingEffectSettings settings)
 {
     if (settings.LOD <= lodR.Max || settings.LOD >= lodR.Min)
     {
         return(oReqs[settings.LOD]);
     }
     return(null);
 }
        public void SetEffect(RenderingEffectSettings settings)
        {
            lock (this)
            {
                this.effect = settings.GetEffect(device);
                this.settings = settings;

                sceneManger.SetEffect(this.effect);
                status = Status.Rendering;
                Invalidate();
            }
        }
 public virtual OutputRequirements GetDeviceRequirements(RenderingEffectSettings settings)
 {
     if (settings.LOD <= lodR.Max || settings.LOD >= lodR.Min)
     {
         return oReqs[settings.LOD];
     }
     return null;
 }
        private void SetRequiredEffects(RenderingEffectSettings[] effects)
        {
            if (effects != null)
            {
                // find effects locally
                requiredEffects = new Effect[effects.Length];
                for (int i = 0; i < effects.Length; i++)
                {
                    requiredEffects[i] = new Effect();
                    requiredEffects[i].settings = effects[i];
                    foreach (Effect effect in allEffects)
                    {
                        if (effect.settings.GetType() == effects[i].GetType())
                        {
                            // copy over
                            requiredEffects[i].previewImage = effect.previewImage;
                            requiredEffects[i].effect = effect.effect;
                            break;
                        }
                    }
                }

                // add to control list
                uiEffectsReqList.Groups[0].Items.Clear();
                foreach (Effect effect in requiredEffects)
                {
                    ButtonBarItem item = new ButtonBarItem();
                    item.Image = effect.previewImage;
                    item.ToolTipText = effect.effect.Name;
                    item.Tag = effect;
                    uiEffectsReqList.Groups[0].Items.Add(item);
                }

                // check through current effects for conflicts to remove
                if (currentEffects != null)
                {
                    foreach (Effect effect in currentEffects)
                    {
                    }
                }
            }
        }
        private void AddEffects(RenderingEffectSettings[] abEffects, RenderingEffectSettings[] uabEffects)
        {
            string base_path = (string)settings["Base.Path"];

            availableEffects = new Effect[abEffects.Length];
            allEffects = new Effect[abEffects.Length + uabEffects.Length];
            for (int effect = 0; effect < abEffects.Length; effect++)
            {
                // create scheme instance
                allEffects[effect] = availableEffects[effect] = new Effect();
                availableEffects[effect].settings = abEffects[effect];
                availableEffects[effect].effect = abEffects[effect].GetEffect(refDevice);
                //availableEffects[effect].sUI = effects[effect].GetSUI();
                //if (availableEffects[effect].sUI != null)
                //    availableEffects[effect].sUI.SetChangeEvent(new EventHandler(OnSettingsChanged));

                // compare requirements to adapter capabilities
                //availableEffects[effect].compatibility = outCaps.CheckCapabilities(availableSchemes[effect].scheme.DeviceRequirements);
                bool available = availableSchemes[effect].available = true;// (availableSchemes[effect].compatibility.NumFails == 0);
                // NOTE: ^ availablity is not per effect but context sensitive also
                
                // look for preview image
                string previewImgPath = base_path + @"Media\UI\previews\effects\" + availableEffects[effect].effect.Name + ".jpg";
                if (File.Exists(previewImgPath))
                    availableEffects[effect].previewImage = WriteNameText(ApplyBorder(Image.FromFile(previewImgPath), available), availableEffects[effect].effect.Name, false);
                else if (available)
                    availableEffects[effect].previewImage = WriteNameText(previewNotAvailableAvailable, availableEffects[effect].effect.Name, true);
                else
                    availableEffects[effect].previewImage = WriteNameText(previewNotAvailableUnavailable, availableEffects[effect].effect.Name, true);

                // add to list
                ButtonBarItem button = new ButtonBarItem();
                button.Image = availableEffects[effect].previewImage;
                button.ToolTipText = availableEffects[effect].effect.Name;
                button.Tag = availableEffects[effect];

                uiEffectsList.Groups[0].Items.Add(button);
            }

            for (int effect = 0; effect < uabEffects.Length; effect++)
            {
                // create scheme instance
                allEffects[effect + abEffects.Length] = new Effect();
                allEffects[effect].settings = uabEffects[effect];
                allEffects[effect].effect = uabEffects[effect].GetEffect(refDevice);

                // compare requirements to adapter capabilities
                bool available = allEffects[effect].available = true;
                // NOTE: ^ availablity is not per effect but context sensitive also

                // look for preview image
                string previewImgPath = base_path + @"Media\UI\previews\effects\" + allEffects[effect].effect.Name + ".jpg";
                if (File.Exists(previewImgPath))
                    allEffects[effect].previewImage = WriteNameText(ApplyBorder(Image.FromFile(previewImgPath), available), allEffects[effect].effect.Name, false);
                else if (available)
                    allEffects[effect].previewImage = WriteNameText(previewNotAvailableAvailable, allEffects[effect].effect.Name, true);
                else
                    allEffects[effect].previewImage = WriteNameText(previewNotAvailableUnavailable, allEffects[effect].effect.Name, true);
            }
        }