//********************************************************************
// This source file is part of Ninfa3D Engine
// 
// Copyright (C) 2008-2009 Viz_fuerte. All rights reserved.
// 
// LIMITED WARRANTY
// This software is provided "as-is", without any express or implied warranty.
// In no event shall the author be held liable for any damages arising from the use of this software.
// This is a contract. By accepting the Ninfa3D Engine (the SOFTWARE), 
// you (either an individual or a single entity, the LICENSEE) accept the terms and conditions of this licensing agreement.
// 
// If the LICENSEE does not accept the terms and conditions, then LICENSEE must not accept the SOFTWARE.
// If at a later time the LICENSEE decides not to continue licensing the SOFTWARE under these terms and 
// conditions, then the LICENSEE must delete permanently all files constituting the SOFTWARE.
//
// File: Input.cpp
//********************************************************************

/*--------------------------------------------------------------------
Includos*/

	#include "..\..\Header Files\Ninfa3D.h"
	#include "..\..\Codes\CMastEventReceiver.h"

/*--------------------------------------------------------------------
Variables externas*/

	extern IrrlichtDevice* device;
	extern IVideoDriver* driver;
	extern ISceneManager* SceneManager;
	extern IGUIEnvironment* guienv;
	extern MastEventReceiver eventReceiver;

/*--------------------------------------------------------------------
Declaracion global de funciones*/

extern "C"
{

	/*====================================================================
	Crea un cuerpo vacio*/

	DLL_EXPORT bool DLL_APIENTRY KeyDown(int keycode)
	{
		return eventReceiver.keyDown(keycode);
	}

	DLL_EXPORT bool DLL_APIENTRY KeyHit(int keycode)
	{
		return eventReceiver.keyPressed(keycode);
	}

	DLL_EXPORT int DLL_APIENTRY MouseX()
	{
		return eventReceiver.MouseX();
	}

	DLL_EXPORT int DLL_APIENTRY MouseY()
	{
		return eventReceiver.MouseY();
	}

	DLL_EXPORT bool DLL_APIENTRY MouseDown(int button)
	{
		return eventReceiver.MouseDown(button);
	}

	DLL_EXPORT bool DLL_APIENTRY MouseHit(int button)
	{
		return eventReceiver.MousePressed(button);
	}

	DLL_EXPORT float DLL_APIENTRY MouseWheel()
	{
		return eventReceiver.MouseWheel();
	}

	DLL_EXPORT void DLL_APIENTRY ShowMouse()
	{
		device->getCursorControl()->setVisible(true);
	}

	DLL_EXPORT void DLL_APIENTRY HideMouse()
	{
		device->getCursorControl()->setVisible(false);
	}

	DLL_EXPORT void DLL_APIENTRY MoveMouse(int x,int y)
	{
		device->getCursorControl()->setPosition(x,y);
	}

}