Mercurial > games > semicongine
comparison examples/E01_hello_triangle.nim @ 1027:d6c27f0ed3e4
fix: examples not compiling
author | sam <sam@basx.dev> |
---|---|
date | Wed, 22 May 2024 03:45:16 +0700 |
parents | d27c8dbfef1c |
children | 71315636ba82 |
comparison
equal
deleted
inserted
replaced
1026:f7802c5069ce | 1027:d6c27f0ed3e4 |
---|---|
3 import ../semicongine | 3 import ../semicongine |
4 | 4 |
5 # shader setup | 5 # shader setup |
6 const | 6 const |
7 shaderConfiguration = createShaderConfiguration( | 7 shaderConfiguration = createShaderConfiguration( |
8 name = "default shader", | |
8 inputs = [ | 9 inputs = [ |
9 attr[Vec3f]("position"), | 10 attr[Vec3f]("position"), |
10 attr[Vec4f]("color"), | 11 attr[Vec4f]("color"), |
11 ], | 12 ], |
12 intermediates = [attr[Vec4f]("outcolor")], | 13 intermediates = [attr[Vec4f]("outcolor")], |
27 myengine = initEngine("Hello triangle", showFps = true) | 28 myengine = initEngine("Hello triangle", showFps = true) |
28 | 29 |
29 myengine.initRenderer({VERTEX_COLORED_MATERIAL: shaderConfiguration}, inFlightFrames = 2) | 30 myengine.initRenderer({VERTEX_COLORED_MATERIAL: shaderConfiguration}, inFlightFrames = 2) |
30 myengine.loadScene(scene) | 31 myengine.loadScene(scene) |
31 | 32 |
32 while myengine.updateInputs() == Running and not myengine.keyWasPressed(Escape): | 33 while myengine.UpdateInputs() and not KeyWasPressed(Escape): |
33 transform[Vec3f](scene.meshes[0][], "position", scale(1.001, 1.001)) | 34 transform[Vec3f](scene.meshes[0][], "position", scale(1.001, 1.001)) |
34 myengine.renderScene(scene) | 35 myengine.renderScene(scene) |
35 | 36 |
36 myengine.destroy() | 37 myengine.destroy() |