@@ -3,28 +3,28 @@ local ffi = require("ffi")
33--- @alias AttributeType " f32" | " i32"
44--- @alias Attribute { type : " f32" | " i32" , size : number , offset : number , normalized : boolean }
55
6- --- @class gfx.VertexLayoutDescriptor
6+ --- @class gfx.VertexLayout
77--- @field attributes Attribute[]
88--- @field stride number ?
9- local VertexLayoutDescriptor = {}
10- VertexLayoutDescriptor .__index = VertexLayoutDescriptor
9+ local VertexLayout = {}
10+ VertexLayout .__index = VertexLayout
1111
12- function VertexLayoutDescriptor .new ()
13- return setmetatable ({ attributes = {}, stride = 0 }, VertexLayoutDescriptor )
12+ function VertexLayout .new ()
13+ return setmetatable ({ attributes = {}, stride = 0 }, VertexLayout )
1414end
1515
1616--- @param attribute Attribute
17- function VertexLayoutDescriptor :withAttribute (attribute )
17+ function VertexLayout :withAttribute (attribute )
1818 table.insert (self .attributes , attribute )
1919 return self
2020end
2121
22- function VertexLayoutDescriptor :withStride (stride )
22+ function VertexLayout :withStride (stride )
2323 self .stride = stride
2424 return self
2525end
2626
27- function VertexLayoutDescriptor :getStride ()
27+ function VertexLayout :getStride ()
2828 if self .stride and self .stride > 0 then
2929 return self .stride
3030 end
@@ -47,4 +47,4 @@ function VertexLayoutDescriptor:getStride()
4747 return maxEnd
4848end
4949
50- return VertexLayoutDescriptor
50+ return VertexLayout
0 commit comments