From 4165ac7e6616e56ea1de1c2da70e13e115ef4eba Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Sat, 6 Aug 2011 14:22:00 +0200 Subject: [PATCH] Add love.event.quit --- src/modules/event/sdl/wrap_Event.cpp | 9 +++++++++ src/modules/event/sdl/wrap_Event.h | 1 + src/modules/graphics/opengl/wrap_Graphics.h | 1 + 3 files changed, 11 insertions(+) diff --git a/src/modules/event/sdl/wrap_Event.cpp b/src/modules/event/sdl/wrap_Event.cpp index 26c8046f1..8a519b780 100644 --- a/src/modules/event/sdl/wrap_Event.cpp +++ b/src/modules/event/sdl/wrap_Event.cpp @@ -183,6 +183,14 @@ namespace sdl return 0; } + int w_quit(lua_State * L) + { + static Event::Message m; + m.type = Event::TYPE_QUIT; + luax_pushboolean(L, instance->push(m)); + return 1; + } + // List of functions to wrap. static const luaL_Reg functions[] = { { "pump", w_pump }, @@ -190,6 +198,7 @@ namespace sdl { "wait", w_wait }, { "push", w_push }, { "clear", w_clear }, + { "quit", w_quit }, { 0, 0 } }; diff --git a/src/modules/event/sdl/wrap_Event.h b/src/modules/event/sdl/wrap_Event.h index d06401edb..b625641cf 100644 --- a/src/modules/event/sdl/wrap_Event.h +++ b/src/modules/event/sdl/wrap_Event.h @@ -36,6 +36,7 @@ namespace sdl int w_wait(lua_State * L); int w_push(lua_State * L); int w_clear(lua_State * L); + int w_quit(lua_State * L); extern "C" LOVE_EXPORT int luaopen_love_event(lua_State * L); diff --git a/src/modules/graphics/opengl/wrap_Graphics.h b/src/modules/graphics/opengl/wrap_Graphics.h index 84fcf913a..4f216e3d4 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.h +++ b/src/modules/graphics/opengl/wrap_Graphics.h @@ -88,6 +88,7 @@ namespace opengl int w_getMaxPointSize(lua_State * L); int w_newScreenshot(lua_State * L); int w_setRenderTarget(lua_State * L); + int w_getRenderTarget(lua_State * L); int w_setPixelEffect(lua_State * L); int w_isSupported(lua_State * L); int w_getGLSLVersion(lua_State * L);