Sdk/Lua: Bind TextureLibrary and TextureManager

This commit is contained in:
Lynix 2016-10-27 11:29:02 +02:00
parent 9206cf65b5
commit 6b1d1a1d64
4 changed files with 41 additions and 0 deletions

View File

@ -756,6 +756,23 @@ namespace Nz
return 1; return 1;
} }
/*!
* \brief Replies by value for Lua
* \return 1 in case of success
*
* \param instance Lua instance to interact with
* \param val Resulting ImageParams
*/
inline int LuaImplReplyVal(const LuaInstance& instance, ImageParams&& val, TypeTag<ImageParams>)
{
instance.PushTable(0, 2);
instance.PushField("LevelCount", val.levelCount);
instance.PushField("LoadFormat", val.loadFormat);
return 1;
}
/*! /*!
* \brief Replies by value for Lua * \brief Replies by value for Lua
* \return 1 in case of success * \return 1 in case of success

View File

@ -80,6 +80,8 @@ namespace Ndk
Nz::LuaClass<Nz::ModelRef> model; Nz::LuaClass<Nz::ModelRef> model;
Nz::LuaClass<Nz::SpriteRef> sprite; Nz::LuaClass<Nz::SpriteRef> sprite;
Nz::LuaClass<Nz::SpriteLibrary> spriteLibrary; Nz::LuaClass<Nz::SpriteLibrary> spriteLibrary;
Nz::LuaClass<Nz::TextureLibrary> textureLibrary;
Nz::LuaClass<Nz::TextureManager> textureManager;
// Renderer // Renderer
Nz::LuaClass<Nz::TextureRef> texture; Nz::LuaClass<Nz::TextureRef> texture;

View File

@ -60,6 +60,8 @@ namespace Ndk
model("Model"), model("Model"),
sprite("Sprite"), sprite("Sprite"),
spriteLibrary("SpriteLibrary"), spriteLibrary("SpriteLibrary"),
textureLibrary("TextureLibrary"),
textureManager("TextureManager"),
// Renderer // Renderer
texture("Texture"), texture("Texture"),

View File

@ -316,6 +316,24 @@ namespace Ndk
spriteLibrary.BindStaticMethod("Register", &Nz::SpriteLibrary::Register); spriteLibrary.BindStaticMethod("Register", &Nz::SpriteLibrary::Register);
spriteLibrary.BindStaticMethod("Query", &Nz::SpriteLibrary::Query); spriteLibrary.BindStaticMethod("Query", &Nz::SpriteLibrary::Query);
spriteLibrary.BindStaticMethod("Unregister", &Nz::SpriteLibrary::Unregister); spriteLibrary.BindStaticMethod("Unregister", &Nz::SpriteLibrary::Unregister);
/*********************************** Nz::TextureLibrary ***********************************/
textureLibrary.BindStaticMethod("Get", &Nz::TextureLibrary::Get);
textureLibrary.BindStaticMethod("Has", &Nz::TextureLibrary::Has);
textureLibrary.BindStaticMethod("Register", &Nz::TextureLibrary::Register);
textureLibrary.BindStaticMethod("Query", &Nz::TextureLibrary::Query);
textureLibrary.BindStaticMethod("Unregister", &Nz::TextureLibrary::Unregister);
/*********************************** Nz::TextureManager ***********************************/
textureManager.BindStaticMethod("Clear", &Nz::TextureManager::Clear);
textureManager.BindStaticMethod("Get", &Nz::TextureManager::Get);
textureManager.BindStaticMethod("GetDefaultParameters", &Nz::TextureManager::GetDefaultParameters);
textureManager.BindStaticMethod("Purge", &Nz::TextureManager::Purge);
textureManager.BindStaticMethod("Register", &Nz::TextureManager::Register);
textureManager.BindStaticMethod("SetDefaultParameters", &Nz::TextureManager::SetDefaultParameters);
textureManager.BindStaticMethod("Unregister", &Nz::TextureManager::Unregister);
} }
/*! /*!
@ -331,5 +349,7 @@ namespace Ndk
model.Register(instance); model.Register(instance);
sprite.Register(instance); sprite.Register(instance);
spriteLibrary.Register(instance); spriteLibrary.Register(instance);
textureLibrary.Register(instance);
textureManager.Register(instance);
} }
} }