Mercurial > games > semicongine
diff tests/test_mesh.nim @ 1139:114f395b9144
did: finish refactoring and updated all tests accordingly
author | sam <sam@basx.dev> |
---|---|
date | Sat, 08 Jun 2024 14:58:25 +0700 |
parents | 02e1d2658ff5 |
children |
line wrap: on
line diff
--- a/tests/test_mesh.nim Tue Jun 04 22:08:48 2024 +0700 +++ b/tests/test_mesh.nim Sat Jun 08 14:58:25 2024 +0700 @@ -13,12 +13,12 @@ proc main() = var scenes = [ - Scene(name: "Donut", meshes: loadMeshes("donut.glb", MeshMaterial)[0].toSeq), + Scene(name: "Donut", meshes: LoadMeshes("donut.glb", MeshMaterial)[0].toSeq), ] var engine = InitEngine("Test meshes") const - shaderConfiguration = createShaderConfiguration( + shaderConfiguration = CreateShaderConfiguration( name = "default shader", inputs = [ Attr[Vec3f]("position", memoryPerformanceHint = PreferFastRead), @@ -49,8 +49,8 @@ engine.InitRenderer({MeshMaterial: shaderConfiguration}) for scene in scenes.mitems: - scene.addShaderGlobal("projection", Unit4F32) - scene.addShaderGlobal("view", Unit4F32) + scene.AddShaderGlobal("projection", Unit4F32) + scene.AddShaderGlobal("view", Unit4F32) engine.LoadScene(scene) var @@ -78,12 +78,12 @@ elevation = 0'f32 azimut = 0'f32 - let ratio = engine.GetWindow().size[0] / engine.GetWindow().size[1] + let ratio = engine.GetWindow().Size[0] / engine.GetWindow().Size[1] size *= 1'f32 + MouseWheel() * 0.05 azimut += MouseMove().x / 180'f32 elevation -= MouseMove().y / 180'f32 - scenes[currentScene].setShaderGlobal("projection", Perspective(PI / 2, ratio, -0.5, 1)) - scenes[currentScene].setShaderGlobal( + scenes[currentScene].SetShaderGlobal("projection", Perspective(PI / 2, ratio, -0.5, 1)) + scenes[currentScene].SetShaderGlobal( "view", Scale(size, size, size) * Rotate(elevation, NewVec3f(1, 0, 0)) * Rotate(azimut, Yf32) )