Fix bug causing ext0...ext3 to sometimes appear pressed on 12btn gamepad
[lsnes.git] / src / lua / screenshot.cpp
blob14e7956730a8333d8169290dc3e801d25673ac3e
1 #include "core/framebuffer.hpp"
2 #include "lua/internal.hpp"
4 namespace
6 function_ptr_luafun lua_gui_screenshot(LS, "gui.screenshot", [](lua_state& L, const std::string& fname) ->
7 int {
8 std::string fn = L.get_string(1, fname.c_str());
9 try {
10 take_screenshot(fn);
11 return 0;
12 } catch(std::exception& e) {
13 L.pushstring(e.what());
14 L.error();
15 return 0;
17 });