Exemplo n.º 1
0
 public DX11PreviewNode(IPluginHost host, IIOFactory iofactory)
 {
     this.ctrl = new Control();
      this.ctrl.Dock = DockStyle.Fill;
      this.ctrl.Resize += new EventHandler(ctrl_Resize);
      this.ctrl.BackColor = System.Drawing.Color.Black;
 }
Exemplo n.º 2
0
        public DX11CubeRendererNode(IPluginHost FHost, IIOFactory iofactory)
        {
            string ename = DX11EnumFormatHelper.NullDeviceFormats.GetEnumName(FormatSupport.RenderTarget);

            InputAttribute tattr = new InputAttribute("Target Format");
            tattr.IsSingle = true;
            tattr.EnumName = ename;
            tattr.DefaultEnumEntry = "R8G8B8A8_UNorm";

            this.FInFormat = iofactory.CreateDiffSpread<EnumEntry>(tattr);

            this.depthmanager = new DepthBufferManager(FHost, iofactory);

            this.lookats.Add(new Vector3(1.0f, 0.0f, 0.0f));
            this.lookats.Add(new Vector3(-1.0f, 0.0f, 0.0f));
            this.lookats.Add(new Vector3(0.0f, 1.0f, 0.0f));

            this.lookats.Add(new Vector3(0.0f, - 1.0f, 0.0f));
            this.lookats.Add(new Vector3(0.0f, 0.0f, 1.0f));
            this.lookats.Add(new Vector3(0.0f, 0.0f, -1.0f));

            this.upvectors.Add(new Vector3(0.0f, 1.0f, 0.0f));
            this.upvectors.Add(new Vector3(0.0f, 1.0f, 0.0f));
            this.upvectors.Add(new Vector3(0.0f, 0.0f, -1.0f));
            this.upvectors.Add(new Vector3(0.0f, 0.0f, 1.0f));
            this.upvectors.Add(new Vector3(0.0f, 1.0f, 0.0f));
            this.upvectors.Add(new Vector3(0.0f, 1.0f, 0.0f));
        }
Exemplo n.º 3
0
        public DX11RendererNode(IPluginHost host, IIOFactory iofactory,IHDEHost hdehost)
        {
            InitializeComponent();
            this.FHost = host;
            this.hde = hdehost;

            //this.hde.BeforeComponentModeChange += new ComponentModeEventHandler(hde_BeforeComponentModeChange);

            this.Resize += DX11RendererNode_Resize;
            this.Load += new EventHandler(DX11RendererNode_Load);
            this.Click += new EventHandler(DX11RendererNode_Click);
            this.MouseEnter += new EventHandler(DX11RendererNode_MouseEnter);
            this.MouseLeave += new EventHandler(DX11RendererNode_MouseLeave);
            this.LostFocus += new EventHandler(DX11RendererNode_LostFocus);
            this.MouseWheel += new System.Windows.Forms.MouseEventHandler(DX11RendererNode_MouseWheel);
            this.BackColor = Color.Black;
            Touchdown += OnTouchDownHandler;
            Touchup += OnTouchUpHandler;
            TouchMove += OnTouchMoveHandler;

            this.depthmanager = new DepthBufferManager(host,iofactory);

            ConfigAttribute bbAttr = new ConfigAttribute("Back Buffer Format");
            bbAttr.IsSingle = true;
            bbAttr.EnumName = DX11EnumFormatHelper.NullDeviceFormats.GetEnumName(FormatSupport.BackBufferCast);
            bbAttr.DefaultEnumEntry = DX11EnumFormatHelper.NullDeviceFormats.GetAllowedFormats(FormatSupport.BackBufferCast)[0];

            this.FCfgBackBufferFormat = iofactory.CreateDiffSpread<EnumEntry>(bbAttr);
            this.FCfgBackBufferFormat[0] = new EnumEntry(DX11EnumFormatHelper.NullDeviceFormats.GetEnumName(FormatSupport.BackBufferCast), 0);
        }
        public BaseDX11RenderStateSimple(IPluginHost host,IIOFactory iofactory)
        {
            this.FHost = host;
            this.FIOFactory = iofactory;

            InputAttribute attr = this.GetEnumPin();
            attr.CheckIfChanged = true;
            this.FInPreset = this.FIOFactory.CreatePin<EnumEntry>(attr);
        }
Exemplo n.º 5
0
        public DX11PreviewNode(IPluginHost host, IIOFactory iofactory)
        {
            this.ctrl = new Control();
             this.ctrl.Dock = DockStyle.Fill;
             this.ctrl.Resize += new EventHandler(ctrl_Resize);

             this.ctrl.PreviewKeyDown += new PreviewKeyDownEventHandler(ctrl_PreviewKeyDown);
             this.ctrl.KeyDown += new KeyEventHandler(ctrl_KeyDown);
        }
Exemplo n.º 6
0
        public InputElementJoinNode(IPluginHost host,IIOFactory iofactory)
        {
            this.FHost = host;
            this.FIOFactory = iofactory;

            InputAttribute fmtAttr = new InputAttribute("Format");
            fmtAttr.EnumName = DX11EnumFormatHelper.NullDeviceFormats.GetEnumName(FormatSupport.VertexBuffer);
            fmtAttr.DefaultEnumEntry = "R32G32B32A32_Float";
            FInFormat = this.FIOFactory.CreateDiffSpread<EnumEntry>(fmtAttr);
        }
        public DX11Texture1dArrayRendererNode(IPluginHost FHost, IIOFactory iofactory)
        {
            string ename = DX11EnumFormatHelper.NullDeviceFormats.GetEnumName(FormatSupport.UnorderedAccessView);

            InputAttribute tattr = new InputAttribute("Target Format");
            tattr.EnumName = ename;
            tattr.DefaultEnumEntry = "R8G8B8A8_UNorm";

            this.FInFormat = iofactory.CreateDiffSpread<EnumEntry>(tattr);
        }
Exemplo n.º 8
0
        public DX11ShaderNode(IPluginHost host, IIOFactory factory)
        {
            this.FHost = host;
            this.FFactory = factory;
            this.TechniqueEnumId = Guid.NewGuid().ToString();

            this.varmanager = new DX11ShaderVariableManager(host, factory);

            this.FHost.CreateTransformInput("Transform In", TSliceMode.Dynamic, TPinVisibility.True, out this.FInWorld);
        }
Exemplo n.º 9
0
        public DX11VolumeRendererNode(IPluginHost FHost,IIOFactory factory)
        {
            string ename = DX11EnumFormatHelper.NullDeviceFormats.GetEnumName(FormatSupport.RenderTarget);

            InputAttribute tattr = new InputAttribute("Target Format");
            tattr.EnumName = ename;
            tattr.DefaultEnumEntry = "R8G8B8A8_UNorm";
            tattr.CheckIfChanged = true;

            this.FInFormat = factory.CreateDiffSpread<EnumEntry>(tattr);
        }
Exemplo n.º 10
0
        public DX11SamplerStatePresetNode(IPluginHost host, IIOFactory iofactory)
        {
            string[] enums = DX11SamplerStates.Instance.StateKeys;

            host.UpdateEnum(DX11SamplerStates.Instance.EnumName, enums[0], enums);

            InputAttribute attr = new InputAttribute("Mode");
            attr.EnumName = DX11SamplerStates.Instance.EnumName;
            attr.DefaultEnumEntry = enums[0];
            this.FInPreset = iofactory.CreateDiffSpread<EnumEntry>(attr);
        }
Exemplo n.º 11
0
        public DX11TextureArrayRendererNode(IPluginHost FHost, IIOFactory iofactory)
        {
            string ename = DX11EnumFormatHelper.NullDeviceFormats.GetEnumName(FormatSupport.RenderTarget);

            InputAttribute tattr = new InputAttribute("Target Format");
            tattr.EnumName = ename;
            tattr.DefaultEnumEntry = "R8G8B8A8_UNorm";

            this.FInFormat = iofactory.CreateDiffSpread<EnumEntry>(tattr);

            //this.depthmanager = new DepthBufferManager(FHost,iofactory);
        }
Exemplo n.º 12
0
        public DepthBufferManager(IPluginHost host, IIOFactory factory)
        {
            this.host = host;
            this.factory = factory;

            ConfigAttribute cattr = new ConfigAttribute("Depth Buffer Mode");
            cattr.IsSingle = true;
            pinmode = this.factory.CreateDiffSpread<eDepthBufferMode>(cattr);

            pinmode.Changed += Pinmode_Changed;

            this.currentmode = eDepthBufferMode.None;
        }
Exemplo n.º 13
0
 public IShaderPin CreatePin(string type, EffectVariable var, IPluginHost host, IIOFactory iofactory)
 {
     if (this.delegates.ContainsKey(type))
     {
         IShaderPin sp = this.delegates[type](var);
         sp.Initialize(iofactory, var);
         return sp;
     }
     else
     {
         return null;
     }
 }
Exemplo n.º 14
0
        public DX11RenderStatePresetNode(IPluginHost host, IIOFactory iofactory)
        {
            InputAttribute attr = new InputAttribute("Blend Mode");
            attr.EnumName = DX11BlendStates.Instance.EnumName;
            this.FInBlendPreset = iofactory.CreateDiffSpread<EnumEntry>(attr);

            attr = new InputAttribute("Rasterizer Mode");
            attr.EnumName = DX11RasterizerStates.Instance.EnumName;
            this.FInRasterPreset = iofactory.CreateDiffSpread<EnumEntry>(attr);

            attr = new InputAttribute("Depth Stencil Mode");
            attr.EnumName = DX11DepthStencilStates.Instance.EnumName;
            this.FInDepthPreset = iofactory.CreateDiffSpread<EnumEntry>(attr);
        }
Exemplo n.º 15
0
        public DX11ImageShaderNode(IPluginHost host, IIOFactory factory)
        {
            this.FHost = host;
            this.FFactory = factory;
            this.TechniqueEnumId = Guid.NewGuid().ToString();

            InputAttribute inAttr = new InputAttribute("Technique");
            inAttr.EnumName = this.TechniqueEnumId;
            //inAttr.DefaultEnumEntry = defaultenum;
            inAttr.Order = 1000;
            this.FInTechnique = this.FFactory.CreateDiffSpread<EnumEntry>(inAttr);

            this.varmanager = new DX11ImageShaderVariableManager(host, factory);
        }
Exemplo n.º 16
0
        private static IIOContainer CreateOutput(IIOFactory factory, IOBuildContext <OutputAttribute> context)
        {
            var container  = factory.CreateIOContainer(context.ReplaceIOType(typeof(IEnumOut)));
            var streamType = typeof(EnumOutStream <>).MakeGenericType(context.DataType);
            var stream     = Activator.CreateInstance(streamType, container.RawIOObject) as IOutStream;

            if (context.IOAttribute.AutoFlush)
            {
                return(IOContainer.Create(context, stream, container, null, s => s.Flush()));
            }
            else
            {
                return(IOContainer.Create(context, stream, container));
            }
        }
Exemplo n.º 17
0
        public DX11StreamOutShaderNode(IPluginHost host, IIOFactory factory)
        {
            this.FHost           = host;
            this.FFactory        = factory;
            this.TechniqueEnumId = Guid.NewGuid().ToString();

            InputAttribute inAttr = new InputAttribute("Technique");

            inAttr.EnumName = this.TechniqueEnumId;
            //inAttr.DefaultEnumEntry = defaultenum;
            inAttr.Order      = 1000;
            this.FInTechnique = this.FFactory.CreateDiffSpread <EnumEntry>(inAttr);

            this.varmanager = new DX11ImageShaderVariableManager(host, factory);
        }
Exemplo n.º 18
0
        public override void Init()
        {
            //由于是demo需要所以强制更改默认路径
            Env env = App[typeof(Env)] as Env;

            env.SetResourcesBuildPath(Global.BasePath + "/CsvStore/Resources");
            env.SetResourcesNoBuildPath(Global.BasePath + "/CsvStore/Resources");
            env.SetDebugLevel(DebugLevels.Dev);

            //单纯由于是demo所以强制更改全局配置的路径,正常项目请不要这样用
            IIOFactory io = App.Make <IIOFactory>();

            Store.CsvStore csvStore = App[typeof(Store.CsvStore)] as Store.CsvStore;
            csvStore.SetDirctory(io.Disk().Directory(Global.BasePath + "/CsvStore/Resources"));
        }
Exemplo n.º 19
0
        public DX11RenderFormNode2(IPluginHost host, IIOFactory iofactory, IHDEHost hdehost)
        {
            this.FHost = host;
            this.hde   = hdehost;

            this.form        = new Form();
            this.form.Width  = 400;
            this.form.Height = 300;
            //this.form.
            //this.form.ResizeEnd += form_ResizeEnd;
            this.form.Show();
            this.form.ShowIcon = false;
            this.displayCursor = new WindowDisplayCursor(this.form);

            this.depthmanager = new DepthBufferManager(host, iofactory);
        }
Exemplo n.º 20
0
        private static IIOContainer CreateInput(IIOFactory factory, IOBuildContext <InputAttribute> context)
        {
            var container  = factory.CreateIOContainer(context.ReplaceIOType(typeof(IEnumIn)));
            var streamType = typeof(EnumInStream <>).MakeGenericType(context.DataType);
            var stream     = Activator.CreateInstance(streamType, container.RawIOObject) as IInStream;

            // Using ManagedIOStream -> needs to be synced on managed side.
            if (context.IOAttribute.AutoValidate)
            {
                return(IOContainer.Create(context, stream, container, s => s.Sync()));
            }
            else
            {
                return(IOContainer.Create(context, stream, container));
            }
        }
Exemplo n.º 21
0
        public DX11RenderStatePresetNode(IPluginHost host, IIOFactory iofactory)
        {
            InputAttribute attr = new InputAttribute("Blend Mode");

            attr.EnumName       = DX11BlendStates.Instance.EnumName;
            this.FInBlendPreset = iofactory.CreateDiffSpread <EnumEntry>(attr);

            attr                 = new InputAttribute("Rasterizer Mode");
            attr.EnumName        = DX11RasterizerStates.Instance.EnumName;
            this.FInRasterPreset = iofactory.CreateDiffSpread <EnumEntry>(attr);


            attr                = new InputAttribute("Depth Stencil Mode");
            attr.EnumName       = DX11DepthStencilStates.Instance.EnumName;
            this.FInDepthPreset = iofactory.CreateDiffSpread <EnumEntry>(attr);
        }
Exemplo n.º 22
0
 public MouseEventsSplitNode(IIOFactory factory)
 {
     MouseIn    = factory.CreateSpread <Mouse>(new InputAttribute("Mouse"));
     BinSizePin = factory.CreateBinSizeOutput(new OutputAttribute("Bin Size")
     {
         Order = int.MaxValue
     });
     EventTypeOut       = BinSizePin.CreateBinSizeSpread <MouseNotificationKind>(new OutputAttribute("Event Type"));
     PositionOut        = BinSizePin.CreateBinSizeSpread <Vector2D>(new OutputAttribute("Position"));
     MouseWheelDeltaOut = BinSizePin.CreateBinSizeSpread <int>(new OutputAttribute("Mouse Wheel Delta"));
     LeftButtonOut      = BinSizePin.CreateBinSizeSpread <bool>(new OutputAttribute("Left Button"));
     MiddleButtonOut    = BinSizePin.CreateBinSizeSpread <bool>(new OutputAttribute("Middle Button"));
     RightButtonOut     = BinSizePin.CreateBinSizeSpread <bool>(new OutputAttribute("Right Button"));
     X1ButtonOut        = BinSizePin.CreateBinSizeSpread <bool>(new OutputAttribute("X1 Button"));
     X2ButtonOut        = BinSizePin.CreateBinSizeSpread <bool>(new OutputAttribute("X2 Button"));
 }
Exemplo n.º 23
0
        public DX11RenderFormNode2(IPluginHost host, IIOFactory iofactory, IHDEHost hdehost)
        {
            this.FHost = host;
            this.hde = hdehost;

            this.form = new Form();
            this.form.Width = 400;
            this.form.Height = 300;
            //this.form.
            //this.form.ResizeEnd += form_ResizeEnd;
            this.invalidate = true;
            this.form.Show();

            /*this.form.Resize += DX11RendererNode_Resize;
            this.form.Load += new EventHandler(DX11RendererNode_Load);*/
        }
Exemplo n.º 24
0
        public RenderTargetManager(IPluginHost host, IIOFactory iofactory)
        {
            this.host = host;
            this.iofactory = iofactory;

            ConfigAttribute cattr = new ConfigAttribute("Texture Input Mode");
            cattr.IsSingle = true;
            cattr.DefaultEnumEntry = "Manual";

            pinmode = this.iofactory.CreateIOContainer<IDiffSpread<eRenderFormatMode>>(cattr);
            pinmode.IOObject.Changed += Pinmode_Changed;

            this.currentmode = eRenderFormatMode.Manual;

            this.CreateFormat();
            this.CreateSize();
        }
Exemplo n.º 25
0
 public MouseEventsJoinNode(IIOFactory factory)
 {
     BinSizePin = factory.CreateBinSizeInput(new InputAttribute("Bin Size")
     {
         DefaultValue = InputAttribute.DefaultBinSize, Order = int.MaxValue
     });
     EventTypeIn         = BinSizePin.CreateBinSizeSpread <MouseNotificationKind>(new InputAttribute("Event Type"));
     PositionIn          = BinSizePin.CreateBinSizeSpread <Vector2D>(new InputAttribute("Position"));
     MouseWheelIn        = BinSizePin.CreateBinSizeSpread <int>(new InputAttribute("Mouse Wheel Delta"));
     LeftButtonIn        = BinSizePin.CreateBinSizeSpread <bool>(new InputAttribute("Left Button"));
     MiddleButtonIn      = BinSizePin.CreateBinSizeSpread <bool>(new InputAttribute("Middle Button"));
     RightButtonIn       = BinSizePin.CreateBinSizeSpread <bool>(new InputAttribute("Right Button"));
     X1ButtonIn          = BinSizePin.CreateBinSizeSpread <bool>(new InputAttribute("X1 Button"));
     X2ButtonIn          = BinSizePin.CreateBinSizeSpread <bool>(new InputAttribute("X2 Button"));
     MouseOut            = factory.CreateSpread <Mouse>(new OutputAttribute("Mouse"));
     MouseOut.SliceCount = 0;
 }
Exemplo n.º 26
0
        public static IShaderPin GetShaderPin(EffectVariable var, IPluginHost host, IIOFactory iofactory)
        {
            string semantic = var.Description.Semantic;
            string type = var.GetVariableType().Description.TypeName;
            bool array = var.GetVariableType().Description.Elements > 0;
            //Exclude if immutable
            if (semantic != "") { return null; }

            if (array)
            {
                return arrayregistry.CreatePin(type, var, host, iofactory);
            }
            else
            {
                return stdregistry.CreatePin(type, var, host, iofactory);
            }
        }
Exemplo n.º 27
0
        public DX11RendererNode2(IPluginHost host, IIOFactory iofactory)
        {
            this.ctrl = new Control();
            this.ctrl.Dock = DockStyle.Fill;
            this.ctrl.Resize += new EventHandler(ctrl_Resize);

            this.depthmanager = new DepthBufferManager(host, iofactory);

            ConfigAttribute bbAttr = new ConfigAttribute("Back Buffer Format");
            bbAttr.IsSingle = true;
            bbAttr.EnumName = DX11EnumFormatHelper.NullDeviceFormats.GetEnumName(FormatSupport.BackBufferCast);
            bbAttr.DefaultEnumEntry = DX11EnumFormatHelper.NullDeviceFormats.GetAllowedFormats(FormatSupport.BackBufferCast)[0];

            this.FCfgBackBufferFormat = iofactory.CreateDiffSpread<EnumEntry>(bbAttr);
            this.FCfgBackBufferFormat[0] = new EnumEntry(DX11EnumFormatHelper.NullDeviceFormats.GetEnumName(FormatSupport.BackBufferCast), 0);
            this.FCfgBackBufferFormat.Changed += new SpreadChangedEventHander<EnumEntry>(FCfgBackBufferFormat_Changed);
        }
Exemplo n.º 28
0
        public DX11RenderFormNode2(IPluginHost host, IIOFactory iofactory, IHDEHost hdehost)
        {
            this.FHost = host;
            this.hde   = hdehost;

            this.form        = new Form();
            this.form.Width  = 400;
            this.form.Height = 300;
            //this.form.
            //this.form.ResizeEnd += form_ResizeEnd;
            this.invalidate = true;
            this.form.Show();


            /*this.form.Resize += DX11RendererNode_Resize;
             * this.form.Load += new EventHandler(DX11RendererNode_Load);*/
        }
Exemplo n.º 29
0
        public DiffSpreadList(IIOFactory ioFactory, IOAttribute attribute)
            : base(0)
        {
            //store fields
            FIOFactory = ioFactory;
            FAttribute = attribute;

            //create config pin
            var att = new ConfigAttribute(FAttribute.Name + " Count");

            att.DefaultValue = 2;

            //increment instance Counter and store it as pin offset
            FOffsetCounter = FInstanceCounter++;

            FCountSpread          = ioFactory.CreateIO <IDiffSpread <int> >(att);
            FCountSpread.Changed += UpdatePins;
        }
Exemplo n.º 30
0
 public OutputBinSpreadStream(IIOFactory ioFactory, OutputAttribute attribute, Func <IIOContainer, IIOContainer <IOutStream <int> > > binSizeIOContainerFactory)
 {
     if (attribute.IsBinSizeEnabled)
     {
         var container = ioFactory.CreateIOContainer <ISpread <T> >(attribute.DecreaseBinSizeWrapCount(), false); // Ask for a spread, otherwise we lose track of bin size wrapping
         FDataContainer = container;
         FDataStream    = container.IOObject.Stream;
     }
     else
     {
         var container = ioFactory.CreateIOContainer <IOutStream <T> >(attribute, false); // No need for another indirection, access the node output directly
         FDataContainer = container;
         FDataStream    = container.IOObject;
     }
     FBinSizeContainer = binSizeIOContainerFactory(FDataContainer);
     FBinSizeStream    = FBinSizeContainer.IOObject;
     Length            = 1;
 }
Exemplo n.º 31
0
        public RenderTargetManager(IPluginHost host, IIOFactory iofactory)
        {
            this.host      = host;
            this.iofactory = iofactory;

            ConfigAttribute cattr = new ConfigAttribute("Texture Input Mode");

            cattr.IsSingle         = true;
            cattr.DefaultEnumEntry = "Manual";

            pinmode = this.iofactory.CreateIOContainer <IDiffSpread <eRenderFormatMode> >(cattr);
            pinmode.IOObject.Changed += Pinmode_Changed;

            this.currentmode = eRenderFormatMode.Manual;

            this.CreateFormat();
            this.CreateSize();
        }
Exemplo n.º 32
0
        public GroupOutStream(IIOFactory factory, OutputAttribute attribute)
        {
            FFactory         = factory;
            FOutputAttribute = attribute;
            //increment instance Counter and store it as pin offset
            FOffsetCounter = FInstanceCounter++;

            FCountSpread = factory.CreateIO <IDiffSpread <int> >(
                new ConfigAttribute(FOutputAttribute.Name + " Count")
            {
                DefaultValue = 2,
                MinValue     = 2
            }
                );

            FCountSpread.Changed += HandleCountSpreadChanged;
            FCountSpread.Sync();
        }
Exemplo n.º 33
0
        public DX11TextureSpreadRendererNode(IPluginHost FHost, IIOFactory iofactory)
        {
            string ename = DX11EnumFormatHelper.NullDeviceFormats.GetEnumName(FormatSupport.RenderTarget);

            InputAttribute tattr = new InputAttribute("Target Format");
            tattr.EnumName = ename;
            tattr.DefaultEnumEntry = "R8G8B8A8_UNorm";

            ConfigAttribute dfAttr = new ConfigAttribute("Depth Buffer Format");
            dfAttr.EnumName = DX11EnumFormatHelper.NullDeviceFormats.GetEnumName(FormatSupport.DepthStencil);
            dfAttr.DefaultEnumEntry = "D32_Float";
            dfAttr.IsSingle = true;

            this.depthformatpin = iofactory.CreateDiffSpread<EnumEntry>(dfAttr);
            this.depthformatpin[0] = new EnumEntry(dfAttr.EnumName, 1);

            this.FInFormat = iofactory.CreateDiffSpread<EnumEntry>(tattr);
        }
Exemplo n.º 34
0
        public DX11RendererNode2(IPluginHost host, IIOFactory iofactory)
        {
            this.ctrl         = new Control();
            this.ctrl.Dock    = DockStyle.Fill;
            this.ctrl.Resize += new EventHandler(ctrl_Resize);

            this.depthmanager = new DepthBufferManager(host, iofactory);

            ConfigAttribute bbAttr = new ConfigAttribute("Back Buffer Format");

            bbAttr.IsSingle         = true;
            bbAttr.EnumName         = DX11EnumFormatHelper.NullDeviceFormats.GetEnumName(FormatSupport.BackBufferCast);
            bbAttr.DefaultEnumEntry = DX11EnumFormatHelper.NullDeviceFormats.GetAllowedFormats(FormatSupport.BackBufferCast)[0];


            this.FCfgBackBufferFormat          = iofactory.CreateDiffSpread <EnumEntry>(bbAttr);
            this.FCfgBackBufferFormat[0]       = new EnumEntry(DX11EnumFormatHelper.NullDeviceFormats.GetEnumName(FormatSupport.BackBufferCast), 0);
            this.FCfgBackBufferFormat.Changed += new SpreadChangedEventHander <EnumEntry>(FCfgBackBufferFormat_Changed);
        }
Exemplo n.º 35
0
        private IIOContainer GetValueContainer(IIOFactory factory, IOBuildContext <InputAttribute> context, out int *pLength, out double **ppDoubleData, out Func <bool> validateFunc)
        {
            IIOContainer container;

            if (context.IOAttribute.CheckIfChanged)
            {
                container = factory.CreateIOContainer(context.ReplaceIOType(typeof(IValueIn)));
                var valueIn = container.RawIOObject as IValueIn;
                valueIn.GetValuePointer(out pLength, out ppDoubleData);
                validateFunc = GetValidateFunc(valueIn, context.IOAttribute.AutoValidate);
            }
            else
            {
                container = factory.CreateIOContainer(context.ReplaceIOType(typeof(IValueFastIn)));
                var valueFastIn = container.RawIOObject as IValueFastIn;
                valueFastIn.GetValuePointer(out pLength, out ppDoubleData);
                validateFunc = GetValidateFunc(valueFastIn, context.IOAttribute.AutoValidate);
            }
            return(container);
        }
        public DX11TextureSpreadRendererNode(IPluginHost FHost, IIOFactory iofactory)
        {
            string ename = DX11EnumFormatHelper.NullDeviceFormats.GetEnumName(FormatSupport.RenderTarget);

            InputAttribute tattr = new InputAttribute("Target Format");

            tattr.EnumName         = ename;
            tattr.DefaultEnumEntry = "R8G8B8A8_UNorm";

            ConfigAttribute dfAttr = new ConfigAttribute("Depth Buffer Format");

            dfAttr.EnumName         = DX11EnumFormatHelper.NullDeviceFormats.GetEnumName(FormatSupport.DepthStencil);
            dfAttr.DefaultEnumEntry = "D32_Float";
            dfAttr.IsSingle         = true;

            this.depthformatpin    = iofactory.CreateDiffSpread <EnumEntry>(dfAttr);
            this.depthformatpin[0] = new EnumEntry(dfAttr.EnumName, 1);

            this.FInFormat = iofactory.CreateDiffSpread <EnumEntry>(tattr);
        }
Exemplo n.º 37
0
        public DX11RendererNode(IPluginHost host, IIOFactory iofactory, IHDEHost hdehost)
        {
            InitializeComponent();

            this.FHost     = host;
            this.hde       = hdehost;
            this.BackColor = System.Drawing.Color.Black;

            this.cursorDisplay = new Windows.WindowDisplayCursor(this);
            this.Resize       += DX11RendererNode_Resize;
            this.Load         += new EventHandler(DX11RendererNode_Load);
            this.MouseWheel   += new System.Windows.Forms.MouseEventHandler(DX11RendererNode_MouseWheel);
            this.GotFocus     += DX11RendererNode_GotFocus;
            this.LostFocus    += DX11RendererNode_LostFocus;

            TouchDown += OnTouchDownHandler;
            TouchUp   += OnTouchUpHandler;
            TouchMove += OnTouchMoveHandler;

            this.depthmanager = new DepthBufferManager(host, iofactory);
        }
Exemplo n.º 38
0
        protected void RegisterLoader()
        {
            App.Singleton("translation.loader", (app, param) => {
                IEnv env = app.Make <IEnv>();

                IIOFactory factory = app.Make <IIOFactory>();
                IDisk disk         = factory.Disk();

                                #if UNITY_EDITOR
                if (env.DebugLevel == DebugLevels.Auto || env.DebugLevel == DebugLevels.Dev)
                {
                    disk.SetConfig(new Hashtable()
                    {
                        { "root", env.AssetPath + env.ResourcesNoBuildPath }
                    });
                }
                                #endif

                return(new FileLoader(disk, app.Make <IINILoader>()));
            });
        }
Exemplo n.º 39
0
        public static IIOContainer Create <T>(
            IOBuildContext context,
            IIOFactory factory,
            T ioObject,
            Action <T> syncAction  = null,
            Action <T> flushAction = null
            )
        {
            // We need to construct with runtime type here, as compiletime type might be too simple (cast exceptions later).
            var ioHandlerType = typeof(GenericIOContainer <>).MakeGenericType(ioObject.GetType());
            var containers    = ioObject as IIOMultiPin;

            if (containers == null)
            {
                return((IIOContainer)Activator.CreateInstance(ioHandlerType, context, factory, null, ioObject, null, syncAction, flushAction));
            }
            else
            {
                return((IIOContainer)Activator.CreateInstance(ioHandlerType, context, factory, containers.BaseContainer, ioObject, containers.AssociatedContainers, syncAction, flushAction));
            }
        }
Exemplo n.º 40
0
        public SpreadList(IIOFactory factory, IOAttribute attribute)
            : base(new SpreadListStream())
        {
            //store fields
            FFactory   = factory;
            FAttribute = attribute;

            //increment instance Counter and store it as pin offset
            FOffsetCounter = FInstanceCounter++;

            //create config pin
            FCountSpread = factory.CreateIO <IDiffSpread <int> >(
                new ConfigAttribute(FAttribute.Name + " Count")
            {
                DefaultValue = 2,
                MinValue     = 2
            }
                );
            FCountSpread.Changed += HandleCountSpreadChanged;
            FCountSpread.Sync();
        }
Exemplo n.º 41
0
        public static IShaderPin GetShaderPin(EffectVariable var, IPluginHost host, IIOFactory iofactory)
        {
            string semantic = var.Description.Semantic;
            string type     = var.GetVariableType().Description.TypeName;
            bool   array    = var.GetVariableType().Description.Elements > 0;

            //Exclude if immutable
            if (semantic != "")
            {
                return(null);
            }

            if (array)
            {
                return(arrayregistry.CreatePin(type, var, host, iofactory));
            }
            else
            {
                return(stdregistry.CreatePin(type, var, host, iofactory));
            }
        }
Exemplo n.º 42
0
        public bool CreateIO(IIOFactory ioFactory, Dictionary <Field, IOContainer> ioContainers, Field field, bool isInput = true, bool isBinSized = false, int order = 0)
        {
            Type t = typeof(ISpread <>).MakeGenericType(field.FieldType);

            if (isBinSized)
            {
                t = typeof(ISpread <>).MakeGenericType(t);
            }

            if (ioContainers.ContainsKey(field))
            {
                ioContainers[field].SetOrder(order);
                return(false);
            }
            else
            {
                if (isInput)
                {
                    var inAttr = new InputAttribute(field.Name)
                    {
                        Order = order, BinOrder = order + 1, AutoValidate = false
                    };
                    inAttr.SetDefaultAttribute(field);
                    var ioCont = ioFactory.CreateIOContainer(t, inAttr);

                    ioContainers.Add(field, new IOContainer(ioCont, isInput, isBinSized, order));
                }
                else
                {
                    var outAttr = new OutputAttribute(field.Name)
                    {
                        Order = order, BinOrder = order + 1
                    };                                                                                     //, AutoFlush = false
                    var ioCont = ioFactory.CreateIOContainer(t, outAttr);
                    ioContainers.Add(field, new IOContainer(ioCont, isInput, isBinSized, order));
                    (ioContainers[field].RawIOObject as ISpread).SliceCount = 0;
                }
            }
            return(true);
        }
Exemplo n.º 43
0
        public DX11RendererNode(IPluginHost host, IIOFactory iofactory,IHDEHost hdehost)
        {
            InitializeComponent();
            this.FHost = host;
            this.hde = hdehost;

            //this.hde.BeforeComponentModeChange += new ComponentModeEventHandler(hde_BeforeComponentModeChange);

            this.Resize += DX11RendererNode_Resize;
            this.Load += new EventHandler(DX11RendererNode_Load);
            this.Click += new EventHandler(DX11RendererNode_Click);
            this.MouseEnter += new EventHandler(DX11RendererNode_MouseEnter);
            this.MouseLeave += new EventHandler(DX11RendererNode_MouseLeave);
            this.LostFocus += new EventHandler(DX11RendererNode_LostFocus);
            this.MouseWheel += new System.Windows.Forms.MouseEventHandler(DX11RendererNode_MouseWheel);
            this.BackColor = Color.Black;
            Touchdown += OnTouchDownHandler;
            Touchup += OnTouchUpHandler;
            TouchMove += OnTouchMoveHandler;

            this.depthmanager = new DepthBufferManager(host,iofactory);
        }
Exemplo n.º 44
0
        public DX11RendererNode(IPluginHost host, IIOFactory iofactory, IHDEHost hdehost)
        {
            InitializeComponent();
            this.FHost = host;
            this.hde   = hdehost;

            //this.hde.BeforeComponentModeChange += new ComponentModeEventHandler(hde_BeforeComponentModeChange);

            this.Resize     += DX11RendererNode_Resize;
            this.Load       += new EventHandler(DX11RendererNode_Load);
            this.Click      += new EventHandler(DX11RendererNode_Click);
            this.MouseEnter += new EventHandler(DX11RendererNode_MouseEnter);
            this.MouseLeave += new EventHandler(DX11RendererNode_MouseLeave);
            this.LostFocus  += new EventHandler(DX11RendererNode_LostFocus);
            this.MouseWheel += new System.Windows.Forms.MouseEventHandler(DX11RendererNode_MouseWheel);
            this.BackColor   = Color.Black;
            Touchdown       += OnTouchDownHandler;
            Touchup         += OnTouchUpHandler;
            TouchMove       += OnTouchMoveHandler;

            this.depthmanager = new DepthBufferManager(host, iofactory);
        }
Exemplo n.º 45
0
            public InputBinSpreadStream(IIOFactory ioFactory, InputAttribute attribute, bool checkIfChanged, Func <IIOContainer, IIOContainer <IInStream <int> > > binSizeIOContainerFactory)
            {
                // Don't do this, as spread max won't get computed for this pin
                // attribute.AutoValidate = false;
                attribute.CheckIfChanged = checkIfChanged;

                if (attribute.IsBinSizeEnabled)
                {
                    var container = ioFactory.CreateIOContainer <ISpread <T> >(attribute.DecreaseBinSizeWrapCount(), false); // Ask for a spread, otherwise we lose track of bin size wrapping
                    FDataContainer = container;
                    FDataStream    = container.IOObject.Stream;
                }
                else
                {
                    var container = ioFactory.CreateIOContainer <IInStream <T> >(attribute, false); // No need for another indirection, access the node input directly
                    FDataContainer = container;
                    FDataStream    = container.IOObject;
                }

                FBinSizeContainer = binSizeIOContainerFactory(FDataContainer);
                FBinSizeStream    = FBinSizeContainer.IOObject;
                FDataIO           = FDataContainer.GetPluginIO();
            }
Exemplo n.º 46
0
        // TODO: Change all dependencies to interfaces
        public ImpostorDependencies(
            [CanBeNull] IIOFactory ioFactory = null,
            [CanBeNull] MessageSerializer messageSerializer = null,
            [CanBeNull] RequestMatcher requestMatcher       = null,
            [CanBeNull] Func <IIOFactory, MessageSerializer, ResponseHandler> responseHandlerFactory = null,
            [CanBeNull] VariableInterpolator variableInterpolator = null,
            [CanBeNull] Func <Type, ILog> loggerFactory           = null
            )
        {
            ioFactory            = ioFactory ?? new IOFactory();
            messageSerializer    = messageSerializer ?? new MessageSerializer();
            requestMatcher       = requestMatcher ?? new RequestMatcher();
            variableInterpolator = variableInterpolator ?? new VariableInterpolator();
            loggerFactory        = loggerFactory ?? LogProvider.GetLogger;

            var responseHandler = (responseHandlerFactory ?? ((x1, x2) => new ResponseHandler(x1, x2)))(ioFactory, messageSerializer);

            IOFactory            = ioFactory;
            MessageSerializer    = messageSerializer;
            RequestMatcher       = requestMatcher;
            ResponseHandler      = responseHandler;
            VariableInterpolator = variableInterpolator;
            LoggerFactory        = loggerFactory;
        }
Exemplo n.º 47
0
 public static IWorldRenderVariable GetWorldRenderVariable(EffectVariable var, IPluginHost host, IIOFactory iofactory)
 {
     return worldregistry.CreatePin(var.GetVariableType().Description.TypeName, var.Description.Semantic, var.GetVariableType().Description.Elements > 0, var, host, iofactory);
 }
Exemplo n.º 48
0
 public BlendPresetNode(IPluginHost host,IIOFactory iofactory)
     : base(host,iofactory)
 {
 }
Exemplo n.º 49
0
 public DepthStencilPresetNode(IPluginHost host, IIOFactory iofactory) : base(host, iofactory)
 {
 }
Exemplo n.º 50
0
 public IOContainerBase(IOBuildContext context, IIOFactory factory, object rawIOObject)
     : this(context, factory, null, rawIOObject, null)
 {
 }
Exemplo n.º 51
0
 public DepthStencilPresetNode(IPluginHost host, IIOFactory iofactory)
     : base(host, iofactory)
 {
 }
 public DX11ShaderVariableManager(IPluginHost host, IIOFactory iofactory)
 {
     this.host = host;
     this.iofactory = iofactory;
 }
Exemplo n.º 53
0
 public DX11ImageShaderVariableManager(IPluginHost host, IIOFactory iofactory)
     : base(host, iofactory)
 {
 }
Exemplo n.º 54
0
 public DX11QuadLayerNode(IPluginHost host, IIOFactory iofactory)
 {
 }
Exemplo n.º 55
0
 public DX11LayerGroupNode(IPluginHost host,IIOFactory iofactory)
 {
     this.FHost = host;
     this.FIOFactory = iofactory;
 }
 public DX11TempRTRendererNode(IPluginHost FHost, IIOFactory iofactory)
 {
     this.depthmanager = new DepthBufferManager(FHost,iofactory);
     this.rtm = new RenderTargetManager(FHost,iofactory);
 }
Exemplo n.º 57
0
 public DX11QuadLayerNode(IPluginHost host, IIOFactory iofactory)
 {
 }
Exemplo n.º 58
0
 public void Initialize(IIOFactory factory, EffectVariable variable)
 {
     this.TypeName = variable.GetVariableType().Description.TypeName;
     this.Elements = variable.GetVariableType().Description.Elements;
     this.Name     = variable.Description.Name;
 }
Exemplo n.º 59
0
 public BinSpread(IIOFactory ioFactory, IOAttribute attribute, BinSpreadStream stream)
     : base(stream)
 {
     FIOFactory = ioFactory;
 }
Exemplo n.º 60
0
 public RasterizerPresetNode(IPluginHost host, IIOFactory iofactory)
     : base(host, iofactory)
 {
 }