diff options
Diffstat (limited to 'Runtime/Scripting/Rendering/Rendering.bind.cpp')
-rw-r--r-- | Runtime/Scripting/Rendering/Rendering.bind.cpp | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/Runtime/Scripting/Rendering/Rendering.bind.cpp b/Runtime/Scripting/Rendering/Rendering.bind.cpp index 40b3ac5..9bb6242 100644 --- a/Runtime/Scripting/Rendering/Rendering.bind.cpp +++ b/Runtime/Scripting/Rendering/Rendering.bind.cpp @@ -2,29 +2,7 @@ #include "Runtime/Graphics/Texture.h" #include "Runtime/Graphics/ImageData.h" -#define STB_IMAGE_IMPLEMENTATION -#include "ThirdParty/stb/stb_image.h" - -// imgData = Rendering.LoadImage(path) -int LoadImage(lua_State* L) -{ - LUA_BIND_STATE(L); - - const char* path = state.GetValue<const char*>(1, ""); - - stbi_set_flip_vertically_on_load(true); - ImageData* data = new ImageData(state.GetVM()); - int channels; - data->pixels = stbi_load(path, &data->width, &data->height, &channels, 0);
- data->format = ImageData::EPixelFormat::RGB; - data->type = ImageData::EPixelElementType::UNSIGNED_BYTE; - - data->PushUserdata(state); - return 1; -} - static luaL_Reg funcs[] = { - {"LoadImage", LoadImage}, {0, 0} }; |