<commit_before>//
// gd-proto
// Copyright (c) 2014 <NAME>
//
// Distributed under the MIT Software License
// See accompanying file LICENSE.txt or copy at
// http://opensource.org/licenses/MIT
//
// main application class definition
#pragma once

#include "GDProto.pch.h"
#include "Application.h"
#include "MainWindow.h"

#include "VersionInfo.h"

using namespace std;
using namespace mathgp;

Application::Application()
    : m_mainWindow(nullptr)
    , m_mainScene(nullptr)
    , m_isRunning(false)
    , m_desiredFrameTime(10) // work with 100 fps
    // fps stuff
    , m_frameCount(0)
    , m_lastFrameEnd(0)
    , m_lastFPSStatusUpdateTime(0)
    , m_lastFPSStatusUpdateFrameCount(0)
    // debug stuff
    , m_isWireframe(false)    
{
}

Application::~Application()
{
}

void Application::run()
{
    initialize();

    m_isRunning = true;
    while(m_isRunning)
    {
        unsigned frameStart = SDL_GetTicks();

        handleInput();
        drawFrame();
        updateFPSData();

        unsigned frameLength = SDL_GetTicks() - frameStart;
        if(frameLength < m_desiredFrameTime)
        {
            SDL_Delay(m_desiredFrameTime - frameLength);
        }
    }

    deinitialize();
}

void Application::initialize()
{
    if(SDL_Init(SDL_INIT_EVERYTHING) < 0)
    {<commit_msg>small comment<commit_after>//
// gd-proto
// Copyright (c) 2014 <NAME>
//
// Distributed under the MIT Software License
// See accompanying file LICENSE.txt or copy at
// http://opensource.org/licenses/MIT
//
// main application class definition
#pragma once

#include "GDProto.pch.h"
#include "Application.h"
#include "MainWindow.h"

#include "VersionInfo.h"

using namespace std;
using namespace mathgp;

Application::Application()
    : m_mainWindow(nullptr)
    , m_mainScene(nullptr)
    , m_isRunning(false)
    , m_desiredFrameTime(10) // work with 100 fps
    // fps stuff
    , m_frameCount(0)
    , m_lastFrameEnd(0)
    , m_lastFPSStatusUpdateTime(0)
    , m_lastFPSStatusUpdateFrameCount(0)
    // debug stuff
    , m_isWireframe(false)    
{
}

Application::~Application()
{
}

void Application::run()
{
    initialize();

    m_isRunning = true;
    while(m_isRunning)
    {
        unsigned frameStart = SDL_GetTicks();

        handleInput();
        drawFrame();
        updateFPSData();

        // force framerate
        unsigned frameLength = SDL_GetTicks() - frameStart;
        if(frameLength < m_desiredFrameTime)
        {
            SDL_Delay(m_desiredFrameTime - frameLength);
        }
    }

    deinitialize();
}

void Application::initialize()
{
    if(SDL_Init(SDL_INIT_EVERYTHING) < 0)
    {
{'fraction_non_alphanumeric': 0.11894776972931757, 'fraction_numerical': 0.01067479984750286, 'mean_word_length': 2.922272047832586, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '4077369', 'n_tokens_mistral': 889, 'n_tokens_neox': 853, 'n_words': 171}