added texture.IsValid() lua binding
This commit is contained in:
@@ -437,6 +437,7 @@ Gives you the ability to render text with a custom font.
|
||||
A texture image data.
|
||||
- [constructor]Texture(opt string filename) -- creates a texture from file
|
||||
- [outer]texturehelper -- a global helper texture creation utility
|
||||
- IsValid() : bool -- whether the texture contains valid data, if it has been created successfully
|
||||
- GetWidth() : int
|
||||
- GetHeight() : int
|
||||
- GetDepth() : int
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace wi::lua
|
||||
lunamethod(Texture_BindLua, CreateLensDistortionNormalMap),
|
||||
lunamethod(Texture_BindLua, Save),
|
||||
|
||||
lunamethod(Texture_BindLua, IsValid),
|
||||
lunamethod(Texture_BindLua, GetWidth),
|
||||
lunamethod(Texture_BindLua, GetHeight),
|
||||
lunamethod(Texture_BindLua, GetDepth),
|
||||
@@ -203,6 +204,11 @@ namespace wi::lua
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Texture_BindLua::IsValid(lua_State* L)
|
||||
{
|
||||
wi::lua::SSetBool(L, resource.IsValid() && resource.GetTexture().IsValid());
|
||||
return 1;
|
||||
}
|
||||
int Texture_BindLua::GetWidth(lua_State* L)
|
||||
{
|
||||
if (!resource.IsValid() || !resource.GetTexture().IsValid())
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace wi::lua
|
||||
int CreateLensDistortionNormalMap(lua_State* L);
|
||||
int Save(lua_State* L);
|
||||
|
||||
int IsValid(lua_State* L);
|
||||
int GetWidth(lua_State* L);
|
||||
int GetHeight(lua_State* L);
|
||||
int GetDepth(lua_State* L);
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace wi::version
|
||||
// minor features, major updates, breaking compatibility changes
|
||||
const int minor = 71;
|
||||
// minor bug fixes, alterations, refactors, updates
|
||||
const int revision = 562;
|
||||
const int revision = 563;
|
||||
|
||||
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user