Exemple #1
0
 public FatVertexDesc()
 {
     Decl = new VertexLayoutD3d11(new[]
     {
         new InputElement("POSITION", 0, Format.R32G32B32A32_Float, 0, 0),
         new InputElement("NORMAL", 0, Format.R32G32B32A32_Float, Vector4.SizeInBytes, 0),
         new InputElement("TEXCOORD", 0, Format.R32G32B32A32_Float, Vector4.SizeInBytes * 2, 0),
         new InputElement("TEXCOORD", 1, Format.R32G32B32A32_Float, Vector4.SizeInBytes * 3, 0),
     });
 }
        public InputLayout GetInputLayout(string effectName, VertexLayoutD3d11 decl)
        {
            InputLayout   layout = null;
            EffectExD3d11 fx     = null;

            if (m_EffectList.TryGetValue(effectName, out fx))
            {
                if (!m_InputLayoutList.TryGetValue(decl, out layout))
                {
                    // if there isn't a match, try to create a new layout
                    // create a new layout using input elems
                    layout = new InputLayout(m_D3dDevice, fx.GetMainTechnique().Description.Signature, decl.Elems);
                    m_InputLayoutList.Add(decl, layout);
                }
            }

            return(layout);
        }
        public InputLayout GetInputLayout(string effectName, VertexLayoutD3d11 decl)
        {
            InputLayout layout = null;
            EffectExD3d11 fx = null;
            if (m_EffectList.TryGetValue(effectName, out fx))
            {
                if (!m_InputLayoutList.TryGetValue(decl, out layout))
                {
                    // if there isn't a match, try to create a new layout
                    // create a new layout using input elems
                    layout = new InputLayout(m_D3dDevice, fx.GetMainTechnique().Description.Signature, decl.Elems);
                    m_InputLayoutList.Add(decl, layout);
                }
            }

            return layout;
        }
            public static VertexLayoutD3d11 GetVertexDesc()
            {
                if (Decl == null)
                {
                    Decl = new VertexLayoutD3d11(new[]
                    {
                        new InputElement("POSITION", 0, Format.R32G32B32A32_Float, 0, 0),
                        new InputElement("SIZE", 0, Format.R32_Float, Vector4.SizeInBytes, 0),
                    });
                }

                return Decl;
            }