Skip to content

Commit

Permalink
feat(lua): add shader.get_all
Browse files Browse the repository at this point in the history
  • Loading branch information
Silverlan committed Nov 1, 2024
1 parent 5809656 commit 7edaed0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/client/src/lua/c_luaclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,19 @@ void ClientState::RegisterSharedLuaClasses(Lua::Interface &lua, bool bGUI)
Lua::shader::push_shader(l, *whShader.get());
return 1;
}},
{"get_all",
[](lua_State *l) {
auto t = luabind::newtable(l);
uint32_t idx = 1;
for(auto &shader : c_engine->GetShaderManager().GetShaders()) {
Lua::shader::push_shader(l, *shader);
luabind::object o {luabind::from_stack(l, -1)};
Lua::Pop(l, 1);
t[idx++] = o;
}
t.push(l);
return 1;
}},
{"cubemap_to_equirectangular_texture", [](lua_State *l) {
auto *shader = static_cast<pragma::ShaderCubemapToEquirectangular *>(c_engine->GetShader("cubemap_to_equirectangular").get());
if(!shader)
Expand Down

0 comments on commit 7edaed0

Please sign in to comment.