mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
add 'camera' library
This commit is contained in:
parent
24ecb94942
commit
ffb7aa1189
6 changed files with 56 additions and 26 deletions
18
src/logic/scripting/lua/libcamera.cpp
Normal file
18
src/logic/scripting/lua/libcamera.cpp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include "api_lua.hpp"
|
||||
|
||||
#include "../../../content/Content.hpp"
|
||||
#include "../../../world/Level.hpp"
|
||||
|
||||
using namespace scripting;
|
||||
|
||||
int l_index(lua::State* L) {
|
||||
auto name = lua::require_string(L, 1);
|
||||
auto& indices = content->getIndices(ResourceType::CAMERA);
|
||||
std::cout << "index: " << name << std::endl;
|
||||
return lua::pushinteger(L, indices.indexOf(name));
|
||||
}
|
||||
|
||||
const luaL_Reg cameralib [] = {
|
||||
{"index", lua::wrap<l_index>},
|
||||
{NULL, NULL}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue