/*****************************************************************************
 * $LastChangedDate: 2011-04-09 21:58:06 -0400 (Sat, 09 Apr 2011) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Interface to light sources implemented by shaders and hw.
 *//*
 * LEGAL:   COPYRIGHT (C) 2009 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#ifndef SHADER_LIGHT_HH
#define SHADER_LIGHT_HH 1

#include "base/singleton.hh"
#include "shader/light_base.hh"

namespace shader {

#define GET_LIGHT() (Light::GetInstance())

class ShaderLight;
class HwLight;

////////////////////////////////////////////////////////////////////////////////
/// @brief Interface to light sources implemented by shaders and hw.
///
/// Most clients should use this class.
/// This class forwards method calls to appropriate shader and hardware light sources.
///
class Light : public BaseLight
{
PREVENT_COPYING(Light)
private:
    Light( void );
    ~Light();

public:
                DEFINE_GetInstance( Light )  // Singleton

// Individual lights:
    void        SetLightType( const uint lightNum, const shader::defs::eLightType type );
    void        SetLightPosition( const uint lightNum, const WorldVertex& pos );
    WorldVertex GetLightPosition( const uint lightNum );
    void        SetLightColor( const uint lightNum, const RGBA color );

// Brightness:
    void        SetLightBrightness( const fp brightness, const shader::defs::eBrightness setting = shader::defs::BRIGHTNESS_RELATIVE );
    fp          GetLightBrightness( void );
    void        SetLightBaseAmbient( const RGBA color );

// Fog:
    void        SetFogDensity( const fpx fogDensity, const osg::Fog::Mode fogMode = osg::Fog::EXP );
    void        SetFogColor( const RGBA fogColor );
    void        SetFogMin( const fp fogMin );

private:
    CLASS_VAR Light*    msInstance;
    ShaderLight&        mShaderLight;
#if COMPILE_HW_LIGHT
    HwLight&            mHwLight;
#endif
};

} // namespace shader

#endif // SHADER_LIGHT_HH
