Move the wxwidgets stuff to one directory
[lsnes.git] / lua / screenshot.cpp
blob16b0cedc4aa44667748b04320dfc2f4bb6fcaff8
1 #include "lua-int.hpp"
2 #include "framebuffer.hpp"
4 namespace
6 function_ptr_luafun lua_gui_screenshot("gui.screenshot", [](lua_State* LS, const std::string& fname) -> int {
7 std::string fn = get_string_argument(LS, 1, fname.c_str());
8 try {
9 framebuffer.save_png(fn);
10 return 0;
11 } catch(std::exception& e) {
12 lua_pushstring(LS, e.what());
13 lua_error(LS);
14 return 0;
16 });