MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / Bind

Method Bind

GTE/Graphics/VertexFormat.cpp:31–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31void VertexFormat::Bind(VASemantic semantic, DFType type, uint32_t unit)
32{
33 // Validate the inputs.
34 LogAssert(0 <= mNumAttributes && mNumAttributes < VAConstant::MAX_ATTRIBUTES, "Exceeded maximum attributes.");
35 if (semantic == VASemantic::COLOR)
36 {
37 LogAssert(unit < VAConstant::MAX_COLOR_UNITS, "Invalid color unit.");
38 }
39 else if (semantic == VASemantic::TEXCOORD)
40 {
41 LogAssert(unit < VAConstant::MAX_TCOORD_UNITS, "Invalid texture unit.");
42 }
43 else
44 {
45 LogAssert(unit == 0, "Invalid semantic unit.");
46 }
47
48 // Accept the attribute.
49 Attribute& attribute = mAttributes[mNumAttributes];
50 attribute.semantic = semantic;
51 attribute.type = type;
52 attribute.unit = unit;
53 attribute.offset = mVertexSize;
54 ++mNumAttributes;
55
56 // Advance the offset.
57 mVertexSize += DataFormat::GetNumBytesPerStruct(type);
58}
59
60void VertexFormat::GetAttribute(int32_t i, VASemantic& semantic, DFType& type,
61 uint32_t& unit, uint32_t& offset) const

Callers 15

InitializeMethod · 0.45
FontMethod · 0.45
DrawMethod · 0.45
MeshFactoryMethod · 0.45
CreatePointsMethod · 0.45
CreateConeMeshMethod · 0.45
CreateSceneMethod · 0.45
CreatePointsMethod · 0.45
CreateTorusMeshMethod · 0.45
CreateSceneMethod · 0.45
CreateEighthSphereMethod · 0.45
CreateHalfSphereMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected