/*
 * 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.
 *
 */
#include "KeosRenderSystemCapabilities.h"
#include "KeosLogger.h"
#include "KeosException.h"
#include "KeosString.h"

namespace Keos 
{

    //=======================================================================
    // CRenderSystemCapabilities implementation
    //=======================================================================
    
    //-----------------------------------------------------------------------
    CRenderSystemCapabilities::CRenderSystemCapabilities() 
      :  m_nNumTextureUnits(0), m_nCapabilities(0)
    {
    }

    //-----------------------------------------------------------------------
    CRenderSystemCapabilities::~CRenderSystemCapabilities()
    {
    }

    //-----------------------------------------------------------------------
    void CRenderSystemCapabilities::Log()
    {
        ILogger::Log("RenderSystem capabilities :");
        ILogger::Log("---------------------------");
        
        ILogger::Log("* Texture units                    : %d", GetNumTextureUnits());
        ILogger::Log("* Hardware generation of mipmaps   : %s",
            CStringConverter::ToString(HasCapability(CAP_HW_MIPMAPPING), true).c_str());
        ILogger::Log("* DXT Texture Compression          : %s",
            CStringConverter::ToString(HasCapability(CAP_TEXTURE_COMPRESSION_DXT), true).c_str());
        ILogger::Log("* Non-power-of-two textures        : %s",
            CStringConverter::ToString(HasCapability(CAP_NON_POWER_OF_2_TEXTURES), true).c_str());
        
        if (HasCapability(CAP_VERTEX_PROGRAM))
            ILogger::Log("* Vertex programs (vertex shaders) : %s", 
            GetMaxVertexProgramVersion().c_str());
        else ILogger::Log("* Vertex programs (vertex shaders) : no");
        if (HasCapability(CAP_FRAGMENT_PROGRAM))
            ILogger::Log("* Fragment programs (pixel shaders): %s", 
            GetMaxFragmentProgramVersion().c_str());
        else ILogger::Log("* Fragment programs (pixel shaders): no");
    }

} // namespace Keos

