Files
WickedEngine/WickedEngine/wiRenderPath_BindLua.cpp
T
Turánszki János 74cb74d3c9 version 0.60 (#367)
- namespace refactor (example: wiGraphics:: -> wi::graphics)
  - provided namespace compatibility macro for old user code: WICKEDENGINE_BACKWARDS_COMPATIBILITY_0_59
- resource manager will return `Resource` instead of `shared_ptr<Resource>` objects
- MAD shader optimizations
- implemented alpha to coverage with alpha tested materials when MSAA is enabled
- alpha testing fix with transparent shadow maps
- TLAS and scene buffers will be recreated less frequently when things get added/removed from the scene
2021-12-03 21:22:27 +01:00

49 lines
1.1 KiB
C++

#include "wiRenderPath_BindLua.h"
namespace wi::lua
{
const char RenderPath_BindLua::className[] = "RenderPath";
Luna<RenderPath_BindLua>::FunctionType RenderPath_BindLua::methods[] = {
lunamethod(RenderPath_BindLua, GetLayerMask),
lunamethod(RenderPath_BindLua, SetLayerMask),
{ NULL, NULL }
};
Luna<RenderPath_BindLua>::PropertyType RenderPath_BindLua::properties[] = {
{ NULL, NULL }
};
int RenderPath_BindLua::GetLayerMask(lua_State* L)
{
uint32_t mask = component->getLayerMask();
wi::lua::SSetInt(L, *reinterpret_cast<int*>(&mask));
return 1;
}
int RenderPath_BindLua::SetLayerMask(lua_State* L)
{
int argc = wi::lua::SGetArgCount(L);
if (argc > 0)
{
int mask = wi::lua::SGetInt(L, 1);
component->setlayerMask(*reinterpret_cast<uint32_t*>(&mask));
}
else
wi::lua::SError(L, "SetLayerMask(uint mask) not enough arguments!");
return 0;
}
void RenderPath_BindLua::Bind()
{
static bool initialized = false;
if (!initialized)
{
initialized = true;
Luna<RenderPath_BindLua>::Register(wi::lua::GetLuaState());
}
}
}