<commit_before>#include "XsiliumFramework.h"

using namespace Ogre;

XsiliumFramework::XsiliumFramework()
{
    m_pRoot				= 0;
    m_pRenderWnd		= 0;
    m_pViewport			= 0;
    m_pLog				= 0;
    m_pTimer			= 0;
    inputManager 		= 0;
}

XsiliumFramework::~XsiliumFramework()
{
    XsiliumFramework::getInstance()->m_pLog->logMessage("Extinction OGRE...");
    if(m_pRoot)			delete m_pRoot;
    if(inputManager) delete inputManager;
}

bool XsiliumFramework::initOgre(Ogre::String wndTitle)
{
    std::string mResourcePath ;

    inputManager = InputManager::getSingletonPtr();

#ifdef __APPLE__
    mResourcePath = Ogre::macBundlePath() + "/Contents/Resources/";
#else
    mResourcePath = "";
#endif
    
    
    Ogre::LogManager* logMgr = new Ogre::LogManager();
    
    m_pLog = Ogre::LogManager::getSingleton().createLog("OgreLogfile.log", true, true, false);
    m_pLog->setDebugOutputEnabled(true);
    
    m_pRoot = new Ogre::Root(mResourcePath + "plugins.cfg",mResourcePath + "ogre.cfg","ogre.log");
    
    
    if (!m_pRoot->restoreConfig())
    {
    	if(!m_pRoot->showConfigDialog())
    		return false;
    }
    m_pRenderWnd = m_pRoot->initialise(true, wndTitle);
    
    inputManager->initialise(m_pRenderWnd);

    m_pViewport = m_pRenderWnd->addViewport(0);
    m_pViewport->setBackgroundColour(ColourValue(0.5f, 0.5f, 0.5f, 1.0f));
    
    m_pViewport->setCamera(0);
    
    size_t hWnd = 0;
    m_pRenderWnd->getCustomAttribute("WINDOW", &hWnd);
    
    Ogre::String secName, typeName, archName;
    Ogre::ConfigFile cf;
    cf.load(mResourcePath + "resources.cfg");
    
    Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
    while (seci.hasMoreElements())
    {
        secName = seci.peekNextKey();
        Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
        Ogre::ConfigFile::SettingsMultiMap::iterator i;
        for (i = settings->begin(); i != settings->end(); ++i)
        {
            typeName = i->first;
            archName = i->second;
            
#ifdef __APPLE__
            if (!Ogre::StringUtil::startsWith(archName, "/", false)) // only adjust relative dirs
                archName = Ogre::String(Ogre::macBundlePath() + "/" + archName);
#endif
            
            Ogre::ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName);
        }
    }
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
    
    Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();

    // Calling methods from Interface class into the engine
    Interface cegui;
    cegui.initialiseDefaultResourceGroups();<commit_msg>Mise a jour de l'implémentation de la fenêtre pour windows<commit_after>#include "XsiliumFramework.h"

using namespace Ogre;

XsiliumFramework::XsiliumFramework()
{
    m_pRoot				= 0;
    m_pRenderWnd		= 0;
    m_pViewport			= 0;
    m_pLog				= 0;
    m_pTimer			= 0;
    inputManager 		= 0;
}

XsiliumFramework::~XsiliumFramework()
{
    XsiliumFramework::getInstance()->m_pLog->logMessage("Extinction OGRE...");
    if(m_pRoot)			delete m_pRoot;
    if(inputManager) delete inputManager;
}

bool XsiliumFramework::initOgre(Ogre::String wndTitle)
{
    std::string mResourcePath ;

    inputManager = InputManager::getSingletonPtr();

#ifdef __APPLE__
    mResourcePath = Ogre::macBundlePath() + "/Contents/Resources/";
#else
    mResourcePath = "";
#endif
    
    
    Ogre::LogManager* logMgr = new Ogre::LogManager();
    
    m_pLog = Ogre::LogManager::getSingleton().createLog("OgreLogfile.log", true, true, false);
    m_pLog->setDebugOutputEnabled(true);
    
    m_pRoot = new Ogre::Root(mResourcePath + "plugins.cfg",mResourcePath + "ogre.cfg","ogre.log");
    
    
    if (!m_pRoot->restoreConfig())
    {
    	if(!m_pRoot->showConfigDialog())
    		return false;
    }
    m_pRenderWnd = m_pRoot->initialise(true, wndTitle);

    inputManager->initialise(m_pRenderWnd);

    m_pViewport = m_pRenderWnd->addViewport(0);
    m_pViewport->setBackgroundColour(ColourValue(0.5f, 0.5f, 0.5f, 1.0f));
    
    m_pViewport->setCamera(0);
    
    Ogre::String secName, typeName, archName;
    Ogre::ConfigFile cf;
    cf.load(mResourcePath + "resources.cfg");
    
    Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
    while (seci.hasMoreElements())
    {
        secName = seci.peekNextKey();
        Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
        Ogre::ConfigFile::SettingsMultiMap::iterator i;
        for (i = settings->begin(); i != settings->end(); ++i)
        {
            typeName = i->first;
            archName = i->second;
            
#ifdef __APPLE__
            if (!Ogre::StringUtil::startsWith(archName, "/", false)) // only adjust relative dirs
                archName = Ogre::String(Ogre::macBundlePath() + "/" + archName);
#endif
            
            Ogre::ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName);
        }
    }
    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
    
    Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();

    // Calling methods from Interface class into the engine
    Interface cegui;
    cegui.initialiseDefaultResourceGroups();
{'fraction_non_alphanumeric': 0.1340167046317388, 'fraction_numerical': 0.006643887623386484, 'mean_word_length': 3.3188524590163935, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3072000', 'n_tokens_mistral': 1816, 'n_tokens_neox': 1769, 'n_words': 277}