Example #1
0
 private void SetInputLayout(VertexTypeD11 type)
 {
     inputlayout_ = new InputLayout(
         ApplicationDX11.Instance.Device,
         vertexsignature_,
         AbstractVertex.Infos(type)
         );
 }
Example #2
0
        /// <summary>
        /// Retourne la taille en octet d'un sommet
        /// </summary>
        public static int Size(VertexTypeD11 type)
        {
            switch (type)
            {
            case VertexTypeD11.COLOR_VERTEX:
                return(ColoredVertex.GetSize());

            case VertexTypeD11.STANDARD_VERTEX:
                return(StandardVertex.GetSize());
            }
            return(-1);
        }
Example #3
0
        // Public

        // Static Methods

        /// <summary>
        ///  Retourne les informations concernant le type sommet nécessaire à DirectX
        /// </summary>
        public static InputElement[] Infos(VertexTypeD11 type)
        {
            switch (type)
            {
            case VertexTypeD11.COLOR_VERTEX:
                return(ColoredVertex.GetInfos());

            case VertexTypeD11.STANDARD_VERTEX:
                return(StandardVertex.GetInfos());
            }

            return(null);
        }
Example #4
0
 public LineMesh(VertexTypeD11 type = VertexTypeD11.STANDARD_VERTEX)
     : base(type)
 {
     indexes = new List <int>();
     m_type  = MeshType.LINE_MESH;
 }
Example #5
0
        public MaterialDX11(string vs = "vDefault.cso", string ps = "pUnlit.cso", string gs = "gDefault.cso", VertexTypeD11 type = VertexTypeD11.STANDARD_VERTEX)
        {
            LoadShaders(vs, ps, gs);
            SetInputLayout(type);

            m_TextureConstantBufferDesc = new TextureConstantBufferDesc()
            {
                TilingHeight = 1.0f,
                TilingWidth  = 1.0f,
                XOffset      = 0.0f,
                YOffset      = 0.0f,
                HasTexture   = false,
                MainColor    = new Vector4(0.7f, 0.7f, 0.7f, 1.0f)
            };

            m_MaterialDesc = new MaterialDesc(0.1f, 0.5f, 0.5f);

            m_TextureConstantBuffer = new CBuffer <TextureConstantBufferDesc>(5, m_TextureConstantBufferDesc);
            m_MaterialCBufferDesc   = new CBuffer <MaterialDesc>(4, m_MaterialDesc);
        }
Example #6
0
 public Mesh(VertexTypeD11 type = VertexTypeD11.STANDARD_VERTEX)
 {
     m_VertexType = type;
     m_type       = MeshType.TRIANGLE_MESH;
 }
Example #7
0
        // Public

        // Lifecycle

        public PointMesh(VertexTypeD11 vertextype = VertexTypeD11.STANDARD_VERTEX) : base(vertextype)
        {
        }