Mercurial > games > semicongine
diff tests/test_materials.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_materials.nim Tue Jun 04 22:08:48 2024 +0700 +++ b/tests/test_materials.nim Sat Jun 08 14:58:25 2024 +0700 @@ -13,7 +13,7 @@ WT, WT, WT, WT, WT, WT, WT, RT, RT, RT, RT, RT, RT, RT, ]) - swiss = loadImage[RGBAPixel]("flag.png") + swiss = LoadImage[RGBAPixel]("flag.png") doubleTextureMaterial = MaterialType( name: "Double texture", vertexAttributes: { @@ -22,7 +22,7 @@ }.toTable, attributes: {"tex1": TextureType, "tex2": TextureType}.toTable ) - material = initMaterialData( + material = InitMaterialData( theType = doubleTextureMaterial, name = "swiss-thai", attributes = { @@ -32,15 +32,15 @@ ) proc main() = - var flag = rect() + var flag = Rect() flag.material = material var scene = Scene(name: "main", meshes: @[flag]) - scene.addShaderGlobalArray("test2", @[NewVec4f(), NewVec4f()]) + scene.AddShaderGlobalArray("test2", @[NewVec4f(), NewVec4f()]) var engine = InitEngine("Test materials") const - shaderConfiguration1 = createShaderConfiguration( + shaderConfiguration1 = CreateShaderConfiguration( name = "shader 1", inputs = [ Attr[Vec3f]("position", memoryPerformanceHint = PreferFastRead), @@ -70,7 +70,7 @@ var t = cpuTime() while engine.UpdateInputs() and not KeyIsDown(Escape): var d = float32(cpuTime() - t) - setShaderGlobalArray(scene, "test2", @[NewVec4f(d), NewVec4f(d * 2)]) + SetShaderGlobalArray(scene, "test2", @[NewVec4f(d), NewVec4f(d * 2)]) engine.RenderScene(scene) engine.Destroy()