RenderStack 11.06.1
Public Member Functions | Properties
RenderStack.Graphics.VertexFormat Class Reference

List of all members.

Public Member Functions

 VertexFormat ()
override string ToString ()
void Clear ()
Attribute Add (Attribute vertexAttribute)
bool HasAttribute (VertexUsage usage, int index)
Attribute FindAttribute (VertexUsage usage, int index)

Properties

int Stride [get, set]

Detailed Description

Note:
Mostly stable.

Definition at line 30 of file VertexFormat.cs.


Constructor & Destructor Documentation

RenderStack.Graphics.VertexFormat.VertexFormat ( )

Definition at line 37 of file VertexFormat.cs.

        {
        }

Member Function Documentation

override string RenderStack.Graphics.VertexFormat.ToString ( )

Definition at line 41 of file VertexFormat.cs.

References RenderStack.Graphics.Attribute.Dimension, RenderStack.Graphics.VertexFormat.ToString(), and RenderStack.Graphics.Attribute.UsageString.

Referenced by RenderStack.Graphics.VertexFormat.ToString().

        {
            var s = new System.Text.StringBuilder();
            foreach(Attribute attribute in attributes)
            {
                s.Append(attribute.UsageString + " " + attribute.Dimension + " ");
            }
            return s.ToString();
        }
void RenderStack.Graphics.VertexFormat.Clear ( )

Definition at line 59 of file VertexFormat.cs.

        {
            Stride = 0;
            attributes.Clear();
        }
Attribute RenderStack.Graphics.VertexFormat.Add ( Attribute  vertexAttribute)

Definition at line 64 of file VertexFormat.cs.

References RenderStack.Graphics.Attribute.Offset, and RenderStack.Graphics.Attribute.Stride().

        {
            vertexAttribute.Offset = Stride;
            Stride += vertexAttribute.Stride();
            attributes.Add(vertexAttribute);

            prepareAlignment();

            return vertexAttribute;
        }
bool RenderStack.Graphics.VertexFormat.HasAttribute ( VertexUsage  usage,
int  index 
)

Definition at line 74 of file VertexFormat.cs.

References RenderStack.Graphics.Attribute.Index, and RenderStack.Graphics.Attribute.Usage.

        {
            foreach(Attribute attribute in attributes)
            {
                if(
                    ((attribute.Usage & usage) == usage) &&
                    (attribute.Index == index)
                )
                {
                    return true;
                }
            }
            return false;
        }
Attribute RenderStack.Graphics.VertexFormat.FindAttribute ( VertexUsage  usage,
int  index 
)

Definition at line 88 of file VertexFormat.cs.

References RenderStack.Graphics.Attribute.Index, and RenderStack.Graphics.Attribute.Usage.

Referenced by RenderStack.Graphics.AttributeMappings.BindAttributes(), RenderStack.Graphics.Buffer.Normal(), RenderStack.UI.NinePatch.Place(), RenderStack.Graphics.Buffer.Position(), RenderStack.UI.FontStyle.Print(), and RenderStack.Graphics.Buffer.TexCoord().

        {
            foreach(Attribute attribute in attributes)
            {
                if(
                    ((attribute.Usage & usage) == usage) &&
                    (attribute.Index == index)
                )
                {
                    return attribute;
                }
            }
            throw new System.Exception("Attribute not found");
        }

Property Documentation

int RenderStack.Graphics.VertexFormat.Stride [get, set]

Definition at line 35 of file VertexFormat.cs.

Referenced by RenderStack.Graphics.Buffer.Set().


The documentation for this class was generated from the following file: