Mercurial > games > semicongine
comparison tests/test_mesh.nim @ 1135:74957cbf589b
fix: update tests according to some API renaming
author | sam <sam@basx.dev> |
---|---|
date | Mon, 03 Jun 2024 16:05:17 +0700 |
parents | 73b572f82a1f |
children | 71315636ba82 |
comparison
equal
deleted
inserted
replaced
1134:055eb17ce31e | 1135:74957cbf589b |
---|---|
57 size = 1'f32 | 57 size = 1'f32 |
58 elevation = 0'f32 | 58 elevation = 0'f32 |
59 azimut = 0'f32 | 59 azimut = 0'f32 |
60 currentScene = 0 | 60 currentScene = 0 |
61 | 61 |
62 while engine.updateInputs() and not keyIsDown(Escape): | 62 while engine.UpdateInputs() and not KeyIsDown(Escape): |
63 if keyWasPressed(`1`): | 63 if KeyWasPressed(`1`): |
64 currentScene = 0 | 64 currentScene = 0 |
65 elif keyWasPressed(`2`): | 65 elif KeyWasPressed(`2`): |
66 currentScene = 1 | 66 currentScene = 1 |
67 elif keyWasPressed(`3`): | 67 elif KeyWasPressed(`3`): |
68 currentScene = 2 | 68 currentScene = 2 |
69 elif keyWasPressed(`4`): | 69 elif KeyWasPressed(`4`): |
70 currentScene = 3 | 70 currentScene = 3 |
71 elif keyWasPressed(`5`): | 71 elif KeyWasPressed(`5`): |
72 currentScene = 4 | 72 currentScene = 4 |
73 elif keyWasPressed(`6`): | 73 elif KeyWasPressed(`6`): |
74 currentScene = 5 | 74 currentScene = 5 |
75 | 75 |
76 if keyWasPressed(NumberRowExtra3): | 76 if KeyWasPressed(NumberRowExtra3): |
77 size = 0.3'f32 | 77 size = 0.3'f32 |
78 elevation = 0'f32 | 78 elevation = 0'f32 |
79 azimut = 0'f32 | 79 azimut = 0'f32 |
80 | 80 |
81 let ratio = engine.getWindow().size[0] / engine.getWindow().size[1] | 81 let ratio = engine.GetWindow().size[0] / engine.GetWindow().size[1] |
82 size *= 1'f32 + mouseWheel() * 0.05 | 82 size *= 1'f32 + MouseWheel() * 0.05 |
83 azimut += mouseMove().x / 180'f32 | 83 azimut += MouseMove().x / 180'f32 |
84 elevation -= mouseMove().y / 180'f32 | 84 elevation -= MouseMove().y / 180'f32 |
85 scenes[currentScene].setShaderGlobal("projection", perspective(PI / 2, ratio, -0.5, 1)) | 85 scenes[currentScene].setShaderGlobal("projection", perspective(PI / 2, ratio, -0.5, 1)) |
86 scenes[currentScene].setShaderGlobal( | 86 scenes[currentScene].setShaderGlobal( |
87 "view", | 87 "view", |
88 scale(size, size, size) * rotate(elevation, newVec3f(1, 0, 0)) * rotate(azimut, Yf32) | 88 scale(size, size, size) * rotate(elevation, newVec3f(1, 0, 0)) * rotate(azimut, Yf32) |
89 ) | 89 ) |