extensions/urho3d: Variant, Material:SetShaderParameter

This commit is contained in:
Perttu Ahola 2014-10-04 09:36:16 +03:00
parent e050dec31d
commit b924d66b3a
2 changed files with 13 additions and 1 deletions

View File

@ -25,3 +25,4 @@ Buildat TODO
- Automatically fetch and build and patch Urho3D when building buildat - Automatically fetch and build and patch Urho3D when building buildat
- Handle module load order properly in reloads (unload by popping from top, - Handle module load order properly in reloads (unload by popping from top,
then reload everything until top) then reload everything until top)
- Try out dynamic geometry

View File

@ -6,9 +6,18 @@ local log = buildat.Logger("safe_classes")
local M = {} local M = {}
function M.define(dst, util) function M.define(dst, util)
util.wc("Variant", {
unsafe_constructor = util.wrap_function({{"Color"}},
function(value)
return util.wrap_instance("Variant", Variant(value))
end),
instance = {
}
})
util.wc("VariantMap", { util.wc("VariantMap", {
unsafe_constructor = util.wrap_function({}, unsafe_constructor = util.wrap_function({},
function(x, y, z) function()
return util.wrap_instance("VariantMap", VariantMap()) return util.wrap_instance("VariantMap", VariantMap())
end), end),
instance = { instance = {
@ -149,6 +158,8 @@ function M.define(dst, util)
-- log:info("Material:SetTexture("..dump(index)..", "..dump(texture)..")") -- log:info("Material:SetTexture("..dump(index)..", "..dump(texture)..")")
-- self:SetTexture(index, texture) -- self:SetTexture(index, texture)
--end), --end),
SetShaderParameter = util.self_function(
"SetShaderParameter", {}, {"Material", "string", "Variant"}),
SetTexture = util.self_function( SetTexture = util.self_function(
"SetTexture", {}, {"Material", "number", "Texture"}), "SetTexture", {}, {"Material", "number", "Texture"}),
SetTechnique = util.self_function( SetTechnique = util.self_function(