Sdk/LuaAPI: Add Application binding
Former-commit-id: fd926aaaf6a8df85c93a2ceae14db7bc49516759
This commit is contained in:
parent
6669733af3
commit
50f25e6bcc
|
|
@ -26,6 +26,7 @@ namespace Ndk
|
|||
nodeClass("Node"),
|
||||
|
||||
// SDK
|
||||
application("Application"),
|
||||
nodeComponent("NodeComponent"),
|
||||
entityClass("Entity"),
|
||||
velocityComponent("VelocityComponent"),
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include <Nazara/Math.hpp>
|
||||
#include <Nazara/Network.hpp>
|
||||
#include <Nazara/Utility.hpp>
|
||||
#include <NDK/Application.hpp>
|
||||
#include <NDK/Components.hpp>
|
||||
#include <NDK/Entity.hpp>
|
||||
#include <NDK/Systems.hpp>
|
||||
|
|
@ -80,6 +81,7 @@ namespace Ndk
|
|||
Nz::LuaClass<Nz::Node> nodeClass;
|
||||
|
||||
// SDK
|
||||
Nz::LuaClass<Application*> application;
|
||||
Nz::LuaClass<EntityHandle> entityClass;
|
||||
Nz::LuaClass<NodeComponentHandle> nodeComponent;
|
||||
Nz::LuaClass<VelocityComponentHandle> velocityComponent;
|
||||
|
|
|
|||
|
|
@ -44,6 +44,19 @@ namespace Ndk
|
|||
|
||||
void LuaBinding::BindSDK()
|
||||
{
|
||||
/*********************************** Ndk::Application **********************************/
|
||||
|
||||
#ifndef NDK_SERVER
|
||||
//application.SetMethod("AddWindow", &Application::AddWindow);
|
||||
#endif
|
||||
application.SetMethod("AddWorld", [] (Nz::LuaInstance& instance, Application* application) -> int
|
||||
{
|
||||
instance.Push(application->AddWorld().CreateHandle());
|
||||
return 1;
|
||||
});
|
||||
|
||||
application.SetMethod("GetUpdateTime", &Application::GetUpdateTime);
|
||||
application.SetMethod("Quit", &Application::Quit);
|
||||
|
||||
/*********************************** Ndk::Console **********************************/
|
||||
consoleClass.Inherit<Nz::Node>(nodeClass, [] (ConsoleHandle* handle) -> Nz::Node*
|
||||
|
|
@ -206,6 +219,7 @@ namespace Ndk
|
|||
void LuaBinding::RegisterSDK(Nz::LuaInstance& instance)
|
||||
{
|
||||
// Classes
|
||||
application.Register(instance);
|
||||
entityClass.Register(instance);
|
||||
nodeComponent.Register(instance);
|
||||
velocityComponent.Register(instance);
|
||||
|
|
|
|||
Loading…
Reference in New Issue