//LensFlareNode.cpp
//Adapted by Frank Dodd for IrrlichtWrapper
//Adapted by nespa for Ninfa3D

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

	extern ISceneNode* parent;
	extern IrrlichtDevice* device;
	extern IVideoDriver* driver;
	extern ISceneManager* SceneManager;
	extern ILensFlareSceneNode* flare;


extern "C"
{

/* ----------------------------------------------------------------------------
Adds a lens flare patch object to the scene based on the supplied parameters
*/
DLL_EXPORT void* DLL_APIENTRY nAddLensFlare( ITexture * txture )
{
    CLensFlareSceneNode* flare = new CLensFlareSceneNode(SceneManager->getRootSceneNode(),SceneManager,-1, core::vector3df(0,0,0));

    // set the texture used for the lens flare effect
    flare->setMaterialTexture(0, txture);

    return (void*)flare ;
}

/* ----------------------------------------------------------------------------
Sets the scale of optics in the scene
*/
void DLL_EXPORT nSetFlareScale( CLensFlareSceneNode * flare, float source, float optics )
{
    flare->setOpticsScale( source, optics );
}



}	