diff --git a/Engine.cc b/Engine.cc index 4cdaaec..32efd04 100644 --- a/Engine.cc +++ b/Engine.cc @@ -210,7 +210,7 @@ void Engine::update() if (m_autoPhysics) doPhysics(); lua_getfield(m_luaState, LUA_GLOBALSINDEX, "update"); - if (lua_type(m_luaState, -1) == LUA_TFUNCTION) + if (lua_isfunction(m_luaState, -1)) { /* call the update function - pops the function ref from the stack */ int s = lua_pcall(m_luaState, 0, LUA_MULTRET, 0); diff --git a/anaglym.cc b/anaglym.cc index c03db9a..be741ad 100644 --- a/anaglym.cc +++ b/anaglym.cc @@ -79,8 +79,6 @@ static int engine_thread(void * param) { case EVENT_UPDATE: g_engine->update(); - GLUquadric * quad = gluNewQuadric(); - gluSphere(quad, 4.0, 16, 8); lastUpdateCompleted = true; break; } @@ -184,7 +182,6 @@ static void mainloop() case SDL_USEREVENT: if (event.user.code == 0) { - if (lastUpdateCompleted) SDL_GL_SwapBuffers(); update(); }