/***************************************************************************
*                                                                          *
*  Copyright (C) Golaem S.A.  All Rights Reserved.                         *
*                                                                          *
****************************************************************************/

#pragma once

#include "glmRTTI.h"

namespace glm
{
    struct ShaderAttributeV0;
	struct ShaderAssetV1;
    struct ShaderAssetV0;

    /**
	* \brief Shader Asset
	*/
    struct ShaderGroupV0
    {
        GLM_RTTI("6ae67488-1211-48d4-823d-7fdce4650283", ShaderGroupV0, addAttributes)

    public:
        GLM_CLASS_STAT_ID( glm::MemoryStatIds::GolaemShared);

        /// The name of the shading group
        glm::GlmString _name;

        /**
		* \brief The shader attributes
		*/
        glm::Array<ShaderAssetV1*> _shaderAssets;
        glm::Array<ShaderAttributeV0*> _shaderAttributes;

        ShaderGroupV0();
        ~ShaderGroupV0();

        /**
		* \brief Returns shader attribute having the given name, or NULL if the shader attribute is absent
		*/
        ShaderAttributeV0* findShaderAttribute(const glm::GlmString& name) const;

        /**
		* \brief Returns shader asset from the given classification
		*/
        ShaderAssetV1* findShaderAsset(const glm::GlmString& classification) const;

        /**
		* \brief V0 backwards compatibility
		*/
        void createFromV0(ShaderAssetV0& shaderAssetV0);
        void exportToV0(ShaderAssetV0& shaderAssetV0, size_t shaderAssetIndex);

    protected:
        /**
		* \brief Inspection needed method declaring the inspectable attributes.
		*/
        static void addAttributes();
    };
} // namespace glm
