Mercurial > games > semicongine
comparison tests/test_vulkan_wrapper.nim @ 126:81a8e62215db
did: small name change
author | Sam <sam@basx.dev> |
---|---|
date | Tue, 11 Apr 2023 01:06:37 +0700 |
parents | 6e2c48cb6f60 |
children | 5871acc2977e |
comparison
equal
deleted
inserted
replaced
125:6e2c48cb6f60 | 126:81a8e62215db |
---|---|
89 positions=[newVec3f(0.0, -0.8), newVec3f(0.8, 0.8), newVec3f(-0.8, 0.8)], | 89 positions=[newVec3f(0.0, -0.8), newVec3f(0.8, 0.8), newVec3f(-0.8, 0.8)], |
90 colors=[newVec3f(0.0, 0.0, 1.0), newVec3f(0.0, 0.0, 1.0), newVec3f(0.0, 0.0, 1.0)], | 90 colors=[newVec3f(0.0, 0.0, 1.0), newVec3f(0.0, 0.0, 1.0), newVec3f(0.0, 0.0, 1.0)], |
91 indices=[[0'u16, 1'u16, 2'u16]], | 91 indices=[[0'u16, 1'u16, 2'u16]], |
92 instanceCount=2 | 92 instanceCount=2 |
93 ) | 93 ) |
94 setMeshData[Vec3f](mymesh1, "translate", @[newVec3f(0.3, 0.0)]) | 94 mymesh1.setInstanceData("translate", @[newVec3f(0.3, 0.0)]) |
95 setMeshData[Vec3f](mymesh2, "translate", @[newVec3f(0.0, 0.3)]) | 95 mymesh2.setInstanceData("translate", @[newVec3f(0.0, 0.3)]) |
96 setMeshData[Vec3f](mymesh3, "translate", @[newVec3f(-0.3, 0.0)]) | 96 mymesh3.setInstanceData("translate", @[newVec3f(-0.3, 0.0)]) |
97 setMeshData[Vec3f](mymesh4, "translate", @[newVec3f(0.0, -0.3), newVec3f(0.0, 0.5)]) | 97 mymesh4.setInstanceData("translate", @[newVec3f(0.0, -0.3), newVec3f(0.0, 0.5)]) |
98 result = Scene( | 98 result = Scene( |
99 name: "main", | 99 name: "main", |
100 root: newEntity("root", newEntity("triangle", mymesh4, mymesh3, mymesh2, mymesh1)) | 100 root: newEntity("root", newEntity("triangle", mymesh4, mymesh3, mymesh2, mymesh1)) |
101 ) | 101 ) |
102 | 102 |
103 proc scene_primitives(): Scene = | 103 proc scene_primitives(): Scene = |
104 var r = rect(color="ff0000") | 104 var r = rect(color="ff0000") |
105 var t = tri(color="0000ff") | 105 var t = tri(color="0000ff") |
106 var c = circle(color="00ff00") | 106 var c = circle(color="00ff00") |
107 setMeshData[Vec3f](r, "translate", @[newVec3f(0.5, -0.3)]) | 107 setInstanceData[Vec3f](r, "translate", @[newVec3f(0.5, -0.3)]) |
108 setMeshData[Vec3f](t, "translate", @[newVec3f(0.3, 0.3)]) | 108 setInstanceData[Vec3f](t, "translate", @[newVec3f(0.3, 0.3)]) |
109 setMeshData[Vec3f](c, "translate", @[newVec3f(-0.3, 0.1)]) | 109 setInstanceData[Vec3f](c, "translate", @[newVec3f(-0.3, 0.1)]) |
110 result = Scene( | 110 result = Scene( |
111 name: "main", | 111 name: "main", |
112 root: newEntity("root", t, r, c) | 112 root: newEntity("root", t, r, c) |
113 ) | 113 ) |
114 | 114 |