Files
WickedEngine/WickedEngine/LoadingScreen_BindLua.cpp
T
Turánszki János f1ced24f05 Multi swapchain support (#257)
* multi swapchain draft

* uwp fix

* swapchain resize handling

* swapchain buffercount

* vsync toggle

* tests fix

* update

* everything removed from graphicsdevice regarding global screen params, engine refactor

* added GetSwapChainTexture() function to graphics device; screenshot() now requires swapChain

* linux fix: vulkan device needs window handle for instance creation

* refactor

* removed unused includes

* shader refactor and lensflare fix

* swapchain clearcolor and other refactors

* vulkan: no vector allocation in submit

* tests fix

* refactors

* lens flare canvas size fix

* gui refactor for canvas support

* refactors

* removed global canvas state

* msaa fix

* fixes

* refactor to minimize interface changes

* gui changes

* checkbox fix

* gui fixes

* fixes

* input system will accept window handle

* editor fixes

* refactor and removed resolution related system events

* small editor update

* refactor: renderpath inherits from canvas

* fixed tests duh

* image refactor

* image fix

* removed every using namespace std

* pushconstant fix

* editor: object picking only when necessary

* removed include

* dx12: copy fence waiting performed on CPU

* dx12 copyallocator update

* vulkan: copy allocator with timeline semaphores

* missing include

* dx12 copy allocator update

* refactor

* editor update

* vulkan copy allocator fix

* dx12 update

* vulkan, dx12 fixes

* version bump

* vsync event helper

* documentation update

* updated vulkan, dx12, dxc
2021-04-22 11:36:22 +02:00

81 lines
2.3 KiB
C++

#include "LoadingScreen_BindLua.h"
const char LoadingScreen_BindLua::className[] = "LoadingScreen";
Luna<LoadingScreen_BindLua>::FunctionType LoadingScreen_BindLua::methods[] = {
lunamethod(RenderPath2D_BindLua, AddSprite),
lunamethod(RenderPath2D_BindLua, AddFont),
lunamethod(RenderPath2D_BindLua, RemoveSprite),
lunamethod(RenderPath2D_BindLua, RemoveFont),
lunamethod(RenderPath2D_BindLua, ClearSprites),
lunamethod(RenderPath2D_BindLua, ClearFonts),
lunamethod(RenderPath2D_BindLua, GetSpriteOrder),
lunamethod(RenderPath2D_BindLua, GetFontOrder),
lunamethod(RenderPath2D_BindLua, AddLayer),
lunamethod(RenderPath2D_BindLua, GetLayers),
lunamethod(RenderPath2D_BindLua, SetLayerOrder),
lunamethod(RenderPath2D_BindLua, SetSpriteOrder),
lunamethod(RenderPath2D_BindLua, SetFontOrder),
lunamethod(RenderPath_BindLua, GetLayerMask),
lunamethod(RenderPath_BindLua, SetLayerMask),
lunamethod(LoadingScreen_BindLua, AddLoadingTask),
lunamethod(LoadingScreen_BindLua, OnFinished),
{ NULL, NULL }
};
Luna<LoadingScreen_BindLua>::PropertyType LoadingScreen_BindLua::properties[] = {
{ NULL, NULL }
};
int LoadingScreen_BindLua::AddLoadingTask(lua_State* L)
{
int argc = wiLua::SGetArgCount(L);
if (argc > 0)
{
std::string task = wiLua::SGetString(L, 1);
LoadingScreen* loading = dynamic_cast<LoadingScreen*>(component);
if (loading != nullptr)
{
loading->addLoadingFunction([=](wiJobArgs args) {
wiLua::RunText(task);
});
}
else
wiLua::SError(L, "AddLoader(string taskScript) component is not a LoadingScreen!");
}
else
wiLua::SError(L, "AddLoader(string taskScript) not enough arguments!");
return 0;
}
int LoadingScreen_BindLua::OnFinished(lua_State* L)
{
int argc = wiLua::SGetArgCount(L);
if (argc > 0)
{
std::string task = wiLua::SGetString(L, 1);
LoadingScreen* loading = dynamic_cast<LoadingScreen*>(component);
if (loading != nullptr)
{
loading->onFinished([=] {
wiLua::RunText(task);
});
}
else
wiLua::SError(L, "OnFinished(string taskScript) component is not a LoadingScreen!");
}
else
wiLua::SError(L, "OnFinished(string taskScript) not enough arguments!");
return 0;
}
void LoadingScreen_BindLua::Bind()
{
static bool initialized = false;
if (!initialized)
{
initialized = true;
Luna<LoadingScreen_BindLua>::Register(wiLua::GetLuaState());
}
}