/*
 * This source file is part of KEOS (Free 3D Engine)
 * For the latest info, see http://www.keosengine.org/
 * E-mails : thierry.vouriot@keosengine.org, yeri@keosengine.org
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place - Suite 330, Boston, MA 02111-1307, USA, or go to
 * http://www.gnu.org/copyleft/lesser.txt.
 *
 */
#ifndef KEOS_SHADER_H
#define KEOS_SHADER_H

#include "KeosPrerequisites.h"
#include "KeosShaderBase.h"

namespace Keos
{
    //-----------------------------------------------------------------------
    /** Wrapper class for the ITextureBase.
     *
     */
    class KEOS_EXPORT CShader
    {
    public :

        /** Load the shader from a file.
         *  @param strFilename Name of file of the shader.
         */
        void LoadFromFile(const String& strFilename);

        /** Unload the shader.
         */
        void Unload();

        /** Get a pointer on the internal shader.
         *  @return Pointer on the internal representation of the shader.
         */
        const IShaderBase* GetShader() const;

        /** Change a parameter of the shader (float).
         *  @param strName Name of the parameter in the shader.
         *  @param fValue Value to be sent.
         */
        void SetParameter(const String& strName, float fValue);

        /** Change a parameter of the shader (vector2).
         *  @param strName Name of the parameter in the shader.
         *  @param Value Value to be sent.
         */
        void SetParameter(const String& strName, const TVector2F& Value);

		
        /** Change a parameter of the shader (vector3).
         *  @param strName Name of the parameter in the shader.
         *  @param Value Value to be sent.
         */
        void SetParameter(const String& strName, const TVector3F& Value);

		/** Change a parameter of the shader (vector4).
         *  @param strName Name of the parameter in the shader.
         *  @param Value Value to be sent.
         */
        void SetParameter(const String& strName, const TVector4F& Value);

	
        /** Change a parameter of the shader (matrix4).
         *  @param strName Name of the parameter in the shader.
         *  @param Value Value to be sent.
         */
        void SetParameter(const String& strName, const CMatrix4& Value);

		/** Change a parameter of the shader (color).
         *  @param strName Name of the parameter in the shader.
         *  @param Value Value to be sent.
         */
        void SetParameter(const String& strName, const CColor& Value);

    private :

        //! Pointer on the shader
        CSmartPtr<IShaderBase, CCOMRefCounted> m_Shader; 
    };

} // namespace Keos


#endif // KEOS_SHADER_H
