Made error screen and reverted love.event.wait.

This commit is contained in:
rude
2009-08-24 21:38:35 +02:00
parent 090d2e1cdb
commit ab981ea982
5 changed files with 119 additions and 68 deletions
+8 -16
View File
@@ -44,8 +44,14 @@ namespace sdl
int Event::wait(lua_State * L)
{
lua_pushcclosure(L, &wait_i, 0);
return 1;
SDL_EnableUNICODE(1);
// The union used to get SDL events.
static SDL_Event e;
SDL_WaitEvent(&e);
return Event::pushEvent(L, e);
}
void Event::quit()
@@ -82,20 +88,6 @@ namespace sdl
return 0;
}
int Event::wait_i(lua_State * L)
{
SDL_EnableUNICODE(1);
// The union used to get SDL events.
static SDL_Event e;
SDL_WaitEvent(&e);
int args = Event::pushEvent(L, e);
return args;
}
int Event::pushEvent(lua_State * L, SDL_Event & e)
{
switch(e.type)
-2
View File
@@ -76,8 +76,6 @@ namespace sdl
* The iterator function.
**/
static int poll_i(lua_State * L);
static int wait_i(lua_State * L);
private:
static int pushEvent(lua_State * L, SDL_Event & e);