comparison examples/hello_triangle.nim @ 485:b4a972bd37d5

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 1670f8e70964
children 54a1f8ee208e
comparison
equal deleted inserted replaced
484:04605ca6dd8a 485:b4a972bd37d5
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