Mercurial > games > semicongine
comparison examples/hello_triangle.nim @ 24:71bbe11d8de8
did: change shader compilation to run during program compilation, maybe add dynamic version later
| author | Sam <sam@basx.dev> |
|---|---|
| date | Wed, 11 Jan 2023 11:15:02 +0700 |
| parents | 316923e9247c |
| children | b1b05d4efb52 |
comparison
equal
deleted
inserted
replaced
| 23:0ffdf1f4ecf4 | 24:71bbe11d8de8 |
|---|---|
| 12 color: VertexAttribute[Vec3[float32]] | 12 color: VertexAttribute[Vec3[float32]] |
| 13 | 13 |
| 14 # vertex data (types must match the above VertexAttributes) | 14 # vertex data (types must match the above VertexAttributes) |
| 15 const | 15 const |
| 16 triangle_pos = @[ | 16 triangle_pos = @[ |
| 17 Vec2([-0.5'f32, -0.5'f32]), | 17 Vec2([ 0.0'f32, -0.5'f32]), |
| 18 Vec2([ 0.5'f32, 0.5'f32]), | 18 Vec2([ 0.5'f32, 0.5'f32]), |
| 19 Vec2([-0.5'f32, 0.5'f32]), | 19 Vec2([-0.5'f32, 0.5'f32]), |
| 20 ] | 20 ] |
| 21 triangle_color = @[ | 21 triangle_color = @[ |
| 22 Vec3([1.0'f32, 1.0'f32, 0.0'f32]), | 22 Vec3([1.0'f32, 0.0'f32, 0.0'f32]), |
| 23 Vec3([0.0'f32, 1.0'f32, 0.0'f32]), | 23 Vec3([0.0'f32, 1.0'f32, 0.0'f32]), |
| 24 Vec3([0.0'f32, 1.0'f32, 1.0'f32]), | 24 Vec3([0.0'f32, 0.0'f32, 1.0'f32]), |
| 25 ] | 25 ] |
| 26 | 26 |
| 27 when isMainModule: | 27 when isMainModule: |
| 28 var myengine = igniteEngine() | 28 var myengine = igniteEngine() |
| 29 | 29 |
