From 866e00474be3bfe0e7dac73b720af0b9ebf7109a Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 13 Apr 2019 20:15:07 +0800 Subject: *misc --- .../asura-core/graphics/binding/_shader.cpp | 35 +++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'source/modules/asura-core/graphics/binding/_shader.cpp') diff --git a/source/modules/asura-core/graphics/binding/_shader.cpp b/source/modules/asura-core/graphics/binding/_shader.cpp index e0a6320..0484997 100644 --- a/source/modules/asura-core/graphics/binding/_shader.cpp +++ b/source/modules/asura-core/graphics/binding/_shader.cpp @@ -136,11 +136,16 @@ namespace AsuraEngine return 0; } - // shader:SetAttribPosition() + // shader:SetAttribPosition(vbo, offseti, stridei, normalized) LUAX_IMPL_METHOD(Shader, _SetAttribPosition) { LUAX_PREPARE(L, Shader); + VertexBuffer* vbo = state.CheckUserdata(2); + uint offseti = state.GetValue(3, 0); + uint stridei = state.GetValue(4, 0); + bool normalized = state.GetValue(5, false); + self->SetAttribPosition(vbo, offseti, stridei, normalized); return 0; } @@ -149,6 +154,10 @@ namespace AsuraEngine { LUAX_PREPARE(L, Shader); + VertexBuffer* vbo = state.CheckUserdata(2); + uint offseti = state.GetValue(3, 0); + uint stridei = state.GetValue(4, 0); + self->SetAttribTangent(vbo, offseti, stridei); return 0; } @@ -157,6 +166,10 @@ namespace AsuraEngine { LUAX_PREPARE(L, Shader); + VertexBuffer* vbo = state.CheckUserdata(2); + uint offseti = state.GetValue(3, 0); + uint stridei = state.GetValue(4, 0); + self->SetAttribNormal(vbo, offseti, stridei); return 0; } @@ -165,6 +178,10 @@ namespace AsuraEngine { LUAX_PREPARE(L, Shader); + VertexBuffer* vbo = state.CheckUserdata(2); + uint offseti = state.GetValue(3, 0); + uint stridei = state.GetValue(4, 0); + self->SetAttribColor(vbo, offseti, stridei); return 0; } @@ -173,6 +190,10 @@ namespace AsuraEngine { LUAX_PREPARE(L, Shader); + VertexBuffer* vbo = state.CheckUserdata(2); + uint offseti = state.GetValue(3, 0); + uint stridei = state.GetValue(4, 0); + self->SetAttribPosition(vbo, offseti, stridei); return 0; } @@ -181,6 +202,10 @@ namespace AsuraEngine { LUAX_PREPARE(L, Shader); + VertexBuffer* vbo = state.CheckUserdata(2); + uint offseti = state.GetValue(3, 0); + uint stridei = state.GetValue(4, 0); + self->SetAttribPosition(vbo, offseti, stridei); return 0; } @@ -189,6 +214,10 @@ namespace AsuraEngine { LUAX_PREPARE(L, Shader); + VertexBuffer* vbo = state.CheckUserdata(2); + uint offseti = state.GetValue(3, 0); + uint stridei = state.GetValue(4, 0); + self->SetAttribPosition(vbo, offseti, stridei); return 0; } @@ -197,6 +226,10 @@ namespace AsuraEngine { LUAX_PREPARE(L, Shader); + VertexBuffer* vbo = state.CheckUserdata(2); + uint offseti = state.GetValue(3, 0); + uint stridei = state.GetValue(4, 0); + self->SetAttribPosition(vbo, offseti, stridei); return 0; } -- cgit v1.1-26-g67d0