コード例 #1
0
 public WVertrexLayoutElement(VertexLayoutElement vertexLayoutElement)
 {
     CtObjectGL.VertexElementFormat(vertexLayoutElement.Format, out GLVertexAttribPointerType, out Dimension, out Type, out Normalized);
     StreamSourceIndex = vertexLayoutElement.InputSlot;
     Offset = vertexLayoutElement.Offset;
     Divisor = vertexLayoutElement.VertexLayoutClassification == VertexLayoutClassification.PerVertexData
         ? 0 : vertexLayoutElement.InstanceDataStepRate;
 }
コード例 #2
0
ファイル: CVertexShader.cs プロジェクト: Zulkir/Beholder
        public InputLayout GenerateD3DInputLayout(VertexLayoutElement[] bElements)
        {
            var d3dElements =  D3DInputElementsDraft.Select(draftPair =>
            {
                var d3dElement = draftPair.First;
                var bElement = bElements[draftPair.Second];

                d3dElement.Format = CtSharpDX11.Format(bElement.Format);
                d3dElement.Slot = bElement.InputSlot;
                d3dElement.AlignedByteOffset = bElement.Offset;
                d3dElement.Classification = CtSharpDX11.InputClassification(bElement.VertexLayoutClassification);
                d3dElement.InstanceDataStepRate = bElement.InstanceDataStepRate;
                return d3dElement;
            }).ToArray();
            return new InputLayout(device.D3DDevice, Bytecode, d3dElements);
        }
コード例 #3
0
ファイル: CVertexShader.cs プロジェクト: Zulkir/Beholder
        public VertexElement[] GenerateD3DVertexDeclarationElements(VertexLayoutElement[] bElements)
        {
            return d3dVertexElementsDraft.Select(draftPair =>
            {
                var d3dElement = draftPair.First;
                var bElement = bElements[draftPair.Second];

                d3dElement.Stream = (short)bElement.InputSlot;
                d3dElement.Offset = (short)bElement.Offset;
                d3dElement.Type = CtSharpDX9.DeclarationType(bElement.Format);

                return d3dElement;
            }).Concat(D3DElementsEdning).ToArray();
        }