diff src/semicongine/engine.nim @ 776:002d9c576756

did: preparations to refactor material system, still tons to do
author Sam <sam@basx.dev>
date Sun, 23 Jul 2023 19:53:10 +0700
parents bb4c36d68444
children b145a05c2459
line wrap: on
line diff
--- a/src/semicongine/engine.nim	Sun Jul 09 17:40:46 2023 +0700
+++ b/src/semicongine/engine.nim	Sun Jul 23 19:53:10 2023 +0700
@@ -106,10 +106,10 @@
     engine.renderer.get.destroy()
   engine.renderer = some(engine.device.initRenderer(renderPass))
 
-proc addScene*(engine: var Engine, scene: Scene, vertexInput: seq[ShaderAttribute], samplers: seq[ShaderAttribute], transformAttribute="transform") =
+proc addScene*(engine: var Engine, scene: Scene, vertexInput: seq[ShaderAttribute], samplers: seq[ShaderAttribute], transformAttribute="transform", materialIndexAttribute="materialIndex") =
   assert transformAttribute == "" or transformAttribute in map(vertexInput, proc(a: ShaderAttribute): string = a.name)
   assert engine.renderer.isSome
-  engine.renderer.get.setupDrawableBuffers(scene, vertexInput, samplers, transformAttribute=transformAttribute)
+  engine.renderer.get.setupDrawableBuffers(scene, vertexInput, samplers, transformAttribute=transformAttribute, materialIndexAttribute=materialIndexAttribute)
 
 proc renderScene*(engine: var Engine, scene: var Scene) =
   assert engine.state == Running