// ----------------------------------------------------------------------------
// Blitz-Irrlicht 1.8.3 Wrapper by Ed Musolino 2015
// Based off of Frank Dodd's Irrlicht 1.7 Freebasic Wrapper (2006-2010)
// ----------------------------------------------------------------------------

//  This software is provided 'as-is', without any express Or implied
//  warranty.  In no event will the authors be held liable For any damages
//  arising from the use of this software.

//  Permission is granted To anyone To use this software For any purpose,
//  including commercial applications, And To alter it And redistribute it
//  freely, subject To the following restrictions:

//  1. The Origin of this software must Not be misrepresented; you must not
//     claim that you wrote the original software. If you use this software
//     in a product, an acknowledgement in the product documentation would be
//     appreciated but is Not required.
//  2. Altered source versions must be clearly marked as such, And must Not be
//     misrepresented as being the original software.
//  3. This notice may Not be removed Or altered from any source distribution.
//
// /////////////////////////////////////////////////////////////////////////////

/* ////////////////////////////////////////////////////////////////////////////
includes
*/
#include "bIrrlicht.h"

/* ////////////////////////////////////////////////////////////////////////////
Global variables
*/
IrrlichtDevice * device;
IVideoDriver * driver;
ISceneManager * smgr;
IGUIEnvironment * guienv;

ISoundEngine * engine;
ISoundSource * audiosource;
ISound * audios;

// The Instance of the Event Receiver Class
StackedEventReceiver receiver;

EffectHandler* effect = NULL;


//Blitz\Irrlicht Global Variables
// Camera Default Clearscreen Color
int g_CameraCLSRed = 0;
int g_CameraCLSGrn = 0;
int g_CameraCLSBlu = 0;

// Text Default Color
int g_TextColorAlpha = 255;
int g_TextColorRed = 255;
int g_TextColorGrn = 255;
int g_TextColorBlu = 255;

// Default to Direct3D9
E_DRIVER_TYPE g_iDevice = EDT_DIRECT3D9;
bool g_vsync = false;

//Node Collision Information
float g_NodeCollisionPointX = 0.0;
float g_NodeCollisionPointY = 0.0;
float g_NodeCollisionPointZ = 0.0;
float g_NodeCollisionPointNX = 0.0;
float g_NodeCollisionPointNY = 0.0;
float g_NodeCollisionPointNZ = 0.0;

float g_NewPositionX = 0.0;
float g_NewPositionY = 0.0;
float g_NewPositionZ = 0.0;
float g_HitPositionX = 0.0;
float g_HitPositionY = 0.0;
float g_HitPositionZ = 0.0;
bool g_Falling = false;


/* ////////////////////////////////////////////////////////////////////////////
Custom Functions
*/
wchar_t* ConvertCharToWChar(const char* BlitzText)
{
	size_t newsize = strlen(BlitzText) + 1;
	wchar_t * wcstring = new wchar_t[newsize];
	size_t convertedChars = 0;
	mbstowcs_s(&convertedChars, wcstring, newsize, BlitzText, _TRUNCATE);
	return wcstring;
}

/* ////////////////////////////////////////////////////////////////////////////
Global Function Declarations

all of the below functions are delared as C functions and are exposed without
any mangled names so that they can be easily imported into unstructured
languages like FreeBasic
*/
extern "C"
{


/* ////////////////////////////////////////////////////////////////////////////
all of the above functions are delared as C functions and are exposed without
any mangled names
*/
}
