コード例 #1
0
        public static IBuffer Create(VertexFormat vertexFormat, BufferUsageHint usageHint)
        {
#if false
            if (Configuration.useOpenRL)
            {
                return(new BufferGLRL(vertexFormat, usageHint));
            }
            else
#endif
            {
                return(new BufferGL(vertexFormat, usageHint));
            }
        }
コード例 #2
0
        public void BindAttributes(IVertexStream vertexStream, VertexFormat vertexFormat)
        {
            foreach (var mapping in mappings)
            {
                if (vertexFormat.HasAttribute(mapping.SrcUsage, mapping.SrcIndex))
                {
                    var attribute = vertexFormat.FindAttribute(mapping.SrcUsage, mapping.SrcIndex);

                    vertexStream.Add(
                        mapping,
                        attribute,
                        vertexFormat.Stride
                        );
                }
            }
        }
コード例 #3
0
        public void BindAttributes(VertexStreamRL vertexStream, IProgram program, VertexFormat vertexFormat)
        {
            foreach (var mapping in mappings)
            {
                var programAttribute = program.Attribute(mapping.Name);
                if (programAttribute == null)
                {
                    continue;
                }
                var vertexFormatAttribute = vertexFormat.FindAttribute(mapping.SrcUsage, mapping.SrcIndex);
                if (vertexFormatAttribute == null)
                {
                    continue;
                }

                vertexStream.Add(
                    mapping,
                    vertexFormatAttribute,
                    vertexFormat.Stride,
                    programAttribute.Slot
                    );
            }
        }
コード例 #4
0
ファイル: BufferRL.cs プロジェクト: tksuoran/renderstack_net
 internal BufferRL(VertexFormat vertexFormat, BufferUsageHint usageHint)
 {
     bufferTarget      = Caustic.OpenRL.BufferTarget.ArrayBuffer;
     bufferUsageHint   = usageHint;
     this.vertexFormat = vertexFormat;
 }
コード例 #5
0
ファイル: BufferRL.cs プロジェクト: tksuoran/renderstack_net
 internal BufferRL(BufferTarget target, BufferUsageHint usageHint)
 {
     bufferTarget      = target;
     bufferUsageHint   = usageHint;
     this.vertexFormat = null;
 }
コード例 #6
0
ファイル: BufferGL.cs プロジェクト: tksuoran/renderstack_net
 internal BufferGL(VertexFormat vertexFormat, BufferUsageHint usageHint)
 {
     bufferTarget      = BufferTarget.ArrayBuffer;
     bufferUsageHint   = usageHint;
     this.vertexFormat = vertexFormat;
 }
コード例 #7
0
 internal BufferGLRL(VertexFormat vertexFormat, BufferUsageHint usageHint)
 {
     bufferGL = new BufferGL(vertexFormat, usageHint);
     bufferRL = new BufferRL(vertexFormat, (Caustic.OpenRL.BufferUsageHint)usageHint);
 }