From 2831e232b886c5e3b0791ea5192f9e5194e6abf3 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Fri, 9 Mar 2018 23:55:49 -0500 Subject: Added IGUIImages Added the ability to display itextures on the gui --- src/client/lua_api/video/smaterial.cpp | 51 ++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/client/lua_api/video/smaterial.cpp (limited to 'src/client/lua_api/video/smaterial.cpp') diff --git a/src/client/lua_api/video/smaterial.cpp b/src/client/lua_api/video/smaterial.cpp new file mode 100644 index 0000000..e5b9eff --- /dev/null +++ b/src/client/lua_api/video/smaterial.cpp @@ -0,0 +1,51 @@ + +extern "C" { + #include + #include + #include +} +#include +#include "smaterial.hpp" + +using namespace irr::video; + +/*This probably needs a _gc metamethod*/ +int newsmaterial(lua_State* L){ + SMaterial* mat = new SMaterial(); + lua_pushlightuserdata(L,mat); + + return 0; +} + +#define set_const(l,x) lua_pushstring(l,#x);lua_pushinteger(l,x);lua_settable(l,-3); + +void smaterial_register(lua_State* L){ + //Add globals dealing with material flags + + lua_getglobal(L,"video");//{} + + set_const(L,EMF_WIREFRAME); + set_const(L,EMF_POINTCLOUD); + set_const(L,EMF_GOURAUD_SHADING); + set_const(L,EMF_LIGHTING); + set_const(L,EMF_ZBUFFER); + set_const(L,EMF_ZWRITE_ENABLE); + set_const(L,EMF_BACK_FACE_CULLING); + set_const(L,EMF_FRONT_FACE_CULLING); + set_const(L,EMF_BILINEAR_FILTER); + set_const(L,EMF_TRILINEAR_FILTER); + set_const(L,EMF_ANISOTROPIC_FILTER); + set_const(L,EMF_FOG_ENABLE); + set_const(L,EMF_NORMALIZE_NORMALS); + set_const(L,EMF_TEXTURE_WRAP); + set_const(L,EMF_ANTI_ALIASING); + set_const(L,EMF_COLOR_MASK); + set_const(L,EMF_COLOR_MATERIAL); + set_const(L,EMF_USE_MIP_MAPS); + set_const(L,EMF_BLEND_OPERATION); + set_const(L,EMF_POLYGON_OFFSET); + + lua_pushcfunction(L,newsmaterial);//{},newsmaterial + lua_setfield(L,-2,"newsmaterial"); + +} -- cgit v1.2.3-70-g09d2