diff --git a/Nodes/VVVV.DX11.Nodes/Nodes/Geometry/GeometryTopologyNode.cs b/Nodes/VVVV.DX11.Nodes/Nodes/Geometry/GeometryTopologyNode.cs index 183f4a3e..38bae156 100644 --- a/Nodes/VVVV.DX11.Nodes/Nodes/Geometry/GeometryTopologyNode.cs +++ b/Nodes/VVVV.DX11.Nodes/Nodes/Geometry/GeometryTopologyNode.cs @@ -1,83 +1,83 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.ComponentModel.Composition; - -using SlimDX; -using SlimDX.Direct3D11; - -using VVVV.PluginInterfaces.V2; -using VVVV.PluginInterfaces.V1; - -using FeralTic.DX11; -using FeralTic.DX11.Resources; - -namespace VVVV.DX11.Nodes -{ - [PluginInfo(Name = "Topology", Category = "DX11.Geometry", Version = "", Author = "vux")] - public class GeometryTopologyNode : IPluginEvaluate, IDX11ResourceProvider - { - [Input("Geometry In",CheckIfChanged=true)] - protected Pin> FInGeom; - - [Input("Topology")] - protected IDiffSpread FInTopology; - - [Input("Enabled")] - protected IDiffSpread FInEnabled; - - [Output("Geometry Out")] - protected ISpread> FOutGeom; - - bool invalidate = false; - - public void Evaluate(int SpreadMax) - { - invalidate = false; - - if (this.FInGeom.PluginIO.IsConnected) - { - this.FOutGeom.SliceCount = SpreadMax; - - for (int i = 0; i < SpreadMax; i++) { if (this.FOutGeom[i] == null) { this.FOutGeom[i] = new DX11Resource(); } } - - invalidate = this.FInGeom.IsChanged || this.FInEnabled.IsChanged || this.FInTopology.IsChanged; - - if (invalidate) { this.FOutGeom.Stream.IsChanged = true; } - } - else - { - this.FOutGeom.SliceCount = 0; - } - } - - public void Update(IPluginIO pin, DX11RenderContext context) - { - Device device = context.Device; - - if (this.invalidate) - { - for (int i = 0; i < this.FOutGeom.SliceCount; i++) - { - if (this.FInEnabled[i] && this.FInTopology[i] != PrimitiveTopology.Undefined) - { - - IDX11Geometry geom = this.FInGeom[i][context].ShallowCopy(); - geom.Topology = this.FInTopology[i]; - this.FOutGeom[i][context] = geom; - } - else - { - this.FOutGeom[i][context] = this.FInGeom[i][context]; - } - } - } - } - - public void Destroy(IPluginIO pin, DX11RenderContext context, bool force) - { - //Not ownding resource eg: do nothing - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.ComponentModel.Composition; + +using SlimDX; +using SlimDX.Direct3D11; + +using VVVV.PluginInterfaces.V2; +using VVVV.PluginInterfaces.V1; + +using FeralTic.DX11; +using FeralTic.DX11.Resources; + +namespace VVVV.DX11.Nodes +{ + [PluginInfo(Name = "Topology", Category = "DX11.Geometry", Version = "", Author = "vux")] + public class GeometryTopologyNode : IPluginEvaluate, IDX11ResourceProvider + { + [Input("Geometry In",CheckIfChanged=true)] + protected Pin> FInGeom; + + [Input("Topology")] + protected IDiffSpread FInTopology; + + [Input("Enabled")] + protected IDiffSpread FInEnabled; + + [Output("Geometry Out")] + protected ISpread> FOutGeom; + + bool invalidate = false; + + public void Evaluate(int SpreadMax) + { + invalidate = false; + + if (this.FInGeom.PluginIO.IsConnected) + { + this.FOutGeom.SliceCount = SpreadMax; + + for (int i = 0; i < SpreadMax; i++) { if (this.FOutGeom[i] == null) { this.FOutGeom[i] = new DX11Resource(); } } + + invalidate = this.FInGeom.IsChanged || this.FInEnabled.IsChanged || this.FInTopology.IsChanged; + + if (invalidate) { this.FOutGeom.Stream.IsChanged = true; } + } + else + { + this.FOutGeom.SliceCount = 0; + } + } + + public void Update(IPluginIO pin, DX11RenderContext context) + { + Device device = context.Device; + + if (this.invalidate) + { + for (int i = 0; i < this.FOutGeom.SliceCount; i++) + { + if (this.FInEnabled[i] && this.FInTopology[i] != PrimitiveTopology.Undefined) + { + + IDX11Geometry geom = this.FInGeom[i][context].ShallowCopy(); + geom.Topology = this.FInTopology[i]; + this.FOutGeom[i][context] = geom; + } + else + { + this.FOutGeom[i][context] = this.FInGeom[i][context]; + } + } + } + } + + public void Destroy(IPluginIO pin, DX11RenderContext context, bool force) + { + + } + } +} diff --git a/vvvv-dx11.sln b/vvvv-dx11.sln index b9375b53..465b9b6e 100644 --- a/vvvv-dx11.sln +++ b/vvvv-dx11.sln @@ -40,6 +40,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VVVV.DX11.Nodes.kinect2", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VVVV.DX11.Nodes.QrCode", "Nodes\VVVV.DX11.Nodes.QrCode\VVVV.DX11.Nodes.QrCode.csproj", "{347BF0F2-19E1-4B2B-B125-8AC265CB034A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VVVV.Nodes.Bullet", "Nodes\VVVV.DX11.Nodes.Bullet\VVVV.Nodes.Bullet.csproj", "{220F0ECF-6A3B-4DEF-9C34-95ED87DFE439}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -142,6 +144,14 @@ Global {347BF0F2-19E1-4B2B-B125-8AC265CB034A}.Release|x64.Build.0 = Release|x64 {347BF0F2-19E1-4B2B-B125-8AC265CB034A}.Release|x86.ActiveCfg = Release|x86 {347BF0F2-19E1-4B2B-B125-8AC265CB034A}.Release|x86.Build.0 = Release|x86 + {220F0ECF-6A3B-4DEF-9C34-95ED87DFE439}.Debug|x64.ActiveCfg = Debug|x64 + {220F0ECF-6A3B-4DEF-9C34-95ED87DFE439}.Debug|x64.Build.0 = Debug|x64 + {220F0ECF-6A3B-4DEF-9C34-95ED87DFE439}.Debug|x86.ActiveCfg = Debug|x86 + {220F0ECF-6A3B-4DEF-9C34-95ED87DFE439}.Debug|x86.Build.0 = Debug|x86 + {220F0ECF-6A3B-4DEF-9C34-95ED87DFE439}.Release|x64.ActiveCfg = Release|x64 + {220F0ECF-6A3B-4DEF-9C34-95ED87DFE439}.Release|x64.Build.0 = Release|x64 + {220F0ECF-6A3B-4DEF-9C34-95ED87DFE439}.Release|x86.ActiveCfg = Release|x86 + {220F0ECF-6A3B-4DEF-9C34-95ED87DFE439}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -159,5 +169,6 @@ Global {63DD04AC-9DF1-43B2-937F-82C30A2EB280} = {34741DBE-D233-4D94-BDD9-1469F48C2F16} {F7A2D9C3-515C-4045-B8D1-4AE0CC8802CD} = {34741DBE-D233-4D94-BDD9-1469F48C2F16} {347BF0F2-19E1-4B2B-B125-8AC265CB034A} = {34741DBE-D233-4D94-BDD9-1469F48C2F16} + {220F0ECF-6A3B-4DEF-9C34-95ED87DFE439} = {34741DBE-D233-4D94-BDD9-1469F48C2F16} EndGlobalSection EndGlobal