Sdk: Remake LuaAPI internal
Former-commit-id: 297c30dbeca443d934edfd8d889cd7a6c725d0e1
This commit is contained in:
47
SDK/src/NDK/LuaBinding_Graphics.cpp
Normal file
47
SDK/src/NDK/LuaBinding_Graphics.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
// This file is part of the "Nazara Development Kit"
|
||||
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
|
||||
|
||||
#include <NDK/LuaBinding.hpp>
|
||||
#include <NDK/LuaAPI.hpp>
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
void LuaBinding::BindGraphics()
|
||||
{
|
||||
/*********************************** Nz::InstancedRenderable ***********************************/
|
||||
|
||||
/*********************************** Nz::Model ***********************************/
|
||||
modelClass.Inherit<Nz::InstancedRenderableRef>(instancedRenderable, [] (Nz::ModelRef* model) -> Nz::InstancedRenderableRef*
|
||||
{
|
||||
return reinterpret_cast<Nz::InstancedRenderableRef*>(model); //TODO: Make a ObjectRefCast
|
||||
});
|
||||
|
||||
modelClass.SetConstructor([] (Nz::LuaInstance& lua) -> Nz::ModelRef*
|
||||
{
|
||||
return new Nz::ModelRef(new Nz::Model);
|
||||
});
|
||||
|
||||
//modelClass.SetMethod("GetMaterial", &Nz::Model::GetMaterial);
|
||||
modelClass.SetMethod("GetMaterialCount", &Nz::Model::GetMaterialCount);
|
||||
//modelClass.SetMethod("GetMesh", &Nz::Model::GetMesh);
|
||||
modelClass.SetMethod("GetSkin", &Nz::Model::GetSkin);
|
||||
modelClass.SetMethod("GetSkinCount", &Nz::Model::GetSkinCount);
|
||||
|
||||
modelClass.SetMethod("IsAnimated", &Nz::Model::IsAnimated);
|
||||
modelClass.SetMethod("LoadFromFile", &Nz::Model::LoadFromFile, Nz::ModelParameters());
|
||||
|
||||
modelClass.SetMethod("Reset", &Nz::Model::Reset);
|
||||
|
||||
//modelClass.SetMethod("SetMaterial", &Nz::Model::SetMaterial);
|
||||
//modelClass.SetMethod("SetMesh", &Nz::Model::SetMesh);
|
||||
//modelClass.SetMethod("SetSequence", &Nz::Model::SetSequence);
|
||||
modelClass.SetMethod("SetSkin", &Nz::Model::SetSkin);
|
||||
modelClass.SetMethod("SetSkinCount", &Nz::Model::SetSkinCount);
|
||||
}
|
||||
|
||||
void LuaBinding::RegisterGraphics(Nz::LuaInstance& instance)
|
||||
{
|
||||
instancedRenderable.Register(instance);
|
||||
modelClass.Register(instance);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user