1 module ecs_utils.gfx.vertex; 2 3 import bubel.ecs.std; 4 5 struct Vertex 6 { 7 void create() 8 { 9 data = Mallocator.make!Data; 10 } 11 12 void bind() 13 { 14 15 } 16 17 void enableStates() 18 { 19 20 } 21 22 void attachBindings(scope Binding[] bindings) 23 { 24 data.bindings = Mallocator.makeArray(bindings); 25 } 26 27 enum Type 28 { 29 byte_r_snorm, 30 byte_r_unorm, 31 byte_rg_snorm, 32 byte_rg_unorm, 33 byte_rgb_snorm, 34 byte_rgb_unorm, 35 byte_rgba_snorm, 36 byte_rgba_unorm, 37 short_r_snorm, 38 short_r_unorm, 39 short_rg_snorm, 40 short_rg_unorm, 41 short_rgb_snorm, 42 short_rgb_unorm, 43 short_rgba_snorm, 44 short_rgba_unorm, 45 float_r, 46 float_rg, 47 float_rgb, 48 float_rgba 49 } 50 51 struct Binding 52 { 53 Type type; 54 uint stride; 55 } 56 57 struct Data 58 { 59 Binding[] bindings; 60 uint size; 61 } 62 63 Data* data; 64 }