/*****************************************************************************
 * $LastChangedDate: 2009-12-14 20:05:10 -0500 (Mon, 14 Dec 2009) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Initialize/start module.
 *//*
 * LEGAL:   COPYRIGHT (C) 2007 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#define INPUT_MODULE_CC 1
#include "base/module.hh"
#include "base/module_macros.hh"
using namespace base;
#include "glue/module.hh"
using namespace glue;
#include "input/module.hh"
#include "input/conf.hh"
#include "input/device_keyboard.hh"
#include "input/device_joystick.hh"
#include "input/device_mouse.hh"

namespace input {

/*****************************************************************************
 * Initialize module.
 *****************************************************************************/
void
Init( const base::InitArgs& initArgs )
{
    MODULE_INIT_LOAD_CONF_TXT( input )
}

/*****************************************************************************
 * Start module.
 *****************************************************************************/
void
Start( void )
{
    // Enable devices.
    GET_KEYBOARD_DEVICE().Enable( true );
  //GET_JOYSTICK_DEVICE().Enable( true );  // enabled by control::Joystick
#if COMPILE_PALOMINO != 3
    GET_MOUSE_DEVICE().Enable( true );
#endif

    // Configure queues to drop events on slow systems.
    GET_KEYBOARD_DEVICE().SetQueueOverflow( INPUT_CONF.mKeyboardInputQueueOverflow );
    GET_JOYSTICK_DEVICE().SetQueueOverflow( INPUT_CONF.mJoystickInputQueueOverflow );
       GET_MOUSE_DEVICE().SetQueueOverflow( INPUT_CONF.mMouseInputQueueOverflow    );
}

} // namespace input
