/*****************************************************************************
 * $LastChangedDate: 2011-03-15 14:18:37 -0400 (Tue, 15 Mar 2011) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Interface of C functions for Lua scripts.
 * @remarks @remarks module.txt documents how to export new C++ classes to Lua.
 *
 * ----------------------------
 * -- THIS IS AUTO-GENERATED --
 * ----------------------------
 *
 *//*
 * LEGAL:   COPYRIGHT (C) 2008 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#include "base/module.hh"
using namespace base;
#include "fx/module.hh"
#include "fx/motion_blur.hh"
using namespace fx;
#include "lua_bind/module.hh"
#include "lua_bind/bind.hh"

namespace lua {


namespace bind {

#define BIND_CLASS_NAME      "FX"
#define BIND_METATABLE_NAME  LUABIND_METATABLE_STRING(BIND_CLASS_NAME)

//==============================================================================
// C functions called by Lua that access C++ objects.
//==============================================================================

/*****************************************************************************
 * FX:DisableMotionBlur()
 *****************************************************************************/
INTERN int 
FX_DisableMotionBlur( lua_State* L ) 
{ 
   try { 

        GET_MOTION_BLUR().Disable();
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

/*****************************************************************************
 * FX:EnableMotionBlur( persistence )
 *****************************************************************************/
INTERN int 
FX_EnableMotionBlur( lua_State* L ) 
{ 
   try { 

        const fp persistence = POP_FP( L );
        GET_MOTION_BLUR().Enable( persistence );
    
   } CATCH_LUA_EXCEPTION 
   return 0; 
} 

//==============================================================================
// Register binding with Lua. 
//==============================================================================

#if ! DOXYGEN 

INTERN const struct luaL_reg sMethodTable[] =
{
  // New(),__gc() omitted as Lua cannot instantiate this C++ class.
  { "DisableMotionBlur", FX_DisableMotionBlur },
  { "EnableMotionBlur", FX_EnableMotionBlur },
  { NULL, NULL }
};

void
RegisterFX( lua_State* L )
{
    REGISTER_BINDING( L,
                      BIND_METATABLE_NAME,
                      BIND_CLASS_NAME,
                      sMethodTable );
}

#endif // ! DOXYGEN 

} // namespace bind 

} // namespace lua 
