<commit_before>//
//  SFMLIntegration.hpp
//  SwingGame
//
//  Created by <NAME> on 18/10/2014.
//  Copyright (c) 2014 tbrier. All rights reserved.
//

#ifndef SwingGame_SFMLIntegration_hpp
#define SwingGame_SFMLIntegration_hpp

// =============================================================================
// Include files
// -----------------------------------------------------------------------------
#include "CClock.hpp"
#include "CColour.hpp"
#include "CEvent.hpp"
#include "CFloatRect.hpp"
#include "CImage.hpp"
#include "CKeyboard.hpp"
#include "CMouse.hpp"
#include "CTexture.hpp"
#include "CTime.hpp"
#include "CVector2.hpp"
#include "CFont.hpp"
#include "CMusic.hpp"
#include "CConvexShape.hpp"
#include "CSprite.hpp"
#include "CText.hpp"
#include "CWindow.hpp"
#include "CView.hpp"
#include "CVertex.hpp"

#include "../GameOptions.hpp"


// =============================================================================
// Helper methods
// -----------------------------------------------------------------------------
static void InitSFML(sf::Window *theWindow)
{
    // When we're not in debug mode redirect SFML errors to nowhere
#if !SG_DEBUG
    sf::err().rdbuf(NULL);
#endif
    
    // Don't repeat keypress events
    theWindow->setKeyRepeatEnabled(false);
    
#if USE_SFML_VSYNC
    // Set frame rate limit
    if (GameOptions::doVsync)
    {
        theWindow->setFramerateLimit(GameOptions::maxFPS);
    }
#endif
}

#endif<commit_msg>Use sfml windows vsync instead of framerate limit<commit_after>//
//  SFMLIntegration.hpp
//  SwingGame
//
//  Created by <NAME> on 18/10/2014.
//  Copyright (c) 2014 tbrier. All rights reserved.
//

#ifndef SwingGame_SFMLIntegration_hpp
#define SwingGame_SFMLIntegration_hpp

// =============================================================================
// Include files
// -----------------------------------------------------------------------------
#include "CClock.hpp"
#include "CColour.hpp"
#include "CEvent.hpp"
#include "CFloatRect.hpp"
#include "CImage.hpp"
#include "CKeyboard.hpp"
#include "CMouse.hpp"
#include "CTexture.hpp"
#include "CTime.hpp"
#include "CVector2.hpp"
#include "CFont.hpp"
#include "CMusic.hpp"
#include "CConvexShape.hpp"
#include "CSprite.hpp"
#include "CText.hpp"
#include "CWindow.hpp"
#include "CView.hpp"
#include "CVertex.hpp"

#include "../GameOptions.hpp"


// =============================================================================
// Helper methods
// -----------------------------------------------------------------------------
static void InitSFML(sf::Window *theWindow)
{
    // When we're not in debug mode redirect SFML errors to nowhere
#if !SG_DEBUG
    sf::err().rdbuf(NULL);
#endif
    
    // Don't repeat keypress events
    theWindow->setKeyRepeatEnabled(false);
    
#if USE_SFML_VSYNC
    theWindow->setVerticalSyncEnabled(GameOptions::doVsync);
#endif
}

#endif
{'fraction_non_alphanumeric': 0.3259515570934256, 'fraction_numerical': 0.008996539792387544, 'mean_word_length': 2.769230769230769, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '4030502', 'n_tokens_mistral': 891, 'n_tokens_neox': 853, 'n_words': 192}