static int l_graphics_Image_getWrap(lua_State* state) { l_assertType(state, 1, l_graphics_isImage); l_graphics_Image* img = l_graphics_toImage(state, 1); graphics_Wrap wrap; graphics_Image_getWrap(&img->image, &wrap); l_tools_pushEnum(state, wrap.horMode, l_graphics_WrapMode); l_tools_pushEnum(state, wrap.verMode, l_graphics_WrapMode); return 2; }
static int l_graphics_Font_getFilter(lua_State* state) { l_assertType(state, 1, l_graphics_isFont); graphics_Font* font = l_graphics_toFont(state, 1); graphics_Filter filter; graphics_Font_getFilter(font, &filter); l_tools_pushEnum(state, filter.minMode, l_graphics_FilterMode); l_tools_pushEnum(state, filter.magMode, l_graphics_FilterMode); lua_pushnumber(state, filter.maxAnisotropy); return 3; }
static int l_graphics_Image_getFilter(lua_State* state) { l_assertType(state, 1, l_graphics_isImage); l_graphics_Image* img = l_graphics_toImage(state, 1); graphics_Filter filter; graphics_Image_getFilter(&img->image, &filter); l_tools_pushEnum(state, filter.minMode, l_graphics_FilterMode); l_tools_pushEnum(state, filter.magMode, l_graphics_FilterMode); lua_pushnumber(state, filter.maxAnisotropy); return 3; }
static int l_graphics_Shader_getExternVariable(lua_State* state) { l_assertType(state, 1, l_graphics_isShader); l_graphics_Shader const* shader = l_graphics_toShader(state, 1); char const* name = l_tools_toStringOrError(state, 2); graphics_ShaderUniformInfo const* info = graphics_Shader_getUniform(&shader->shader, name); if(!info) { goto errout; } graphics_ShaderUniformType type = graphics_shader_toMotorType(info->type); if(type == graphics_ShaderUniformType_none) { goto errout; } l_tools_pushEnum(state, type, l_graphics_ShaderUniformType); lua_pushnumber(state, graphics_shader_toMotorComponents(info->type)); lua_pushnumber(state, info->elements); return 3; errout: lua_pushnil(state); lua_pushnil(state); lua_pushnil(state); return 3; }
static int l_graphics_Mesh_getDrawMode(lua_State *state) { l_assertType(state, 1, l_graphics_isMesh); l_graphics_Mesh const *mesh = l_graphics_toMesh(state, 1); graphics_MeshDrawMode mode = graphics_Mesh_getDrawMode(&mesh->mesh); l_tools_pushEnum(state, mode, l_graphics_MeshDrawMode); return 1; }
static int l_graphics_Image_getMipmapFilter(lua_State* state) { l_assertType(state, 1, l_graphics_isImage); l_graphics_Image* img = l_graphics_toImage(state, 1); graphics_Filter filter; graphics_Image_getFilter(&img->image, &filter); l_tools_pushEnum(state, filter.mipmapMode, l_graphics_FilterMode); lua_pushnumber(state, filter.mipmapLodBias); return 2; }