<commit_before>// Copyright 2016 <NAME>

#include "framework.h"

Window::Window() {
}

// Display Information

int Window::DISPLAY_INDEX = 0;
bool Window::displayModeLoaded = false;
SDL_DisplayMode Window::displayMode;

int Window::getDisplayWidth() {
  loadDisplayMode();
  return displayMode.w;
}

int Window::getDisplayHeight() {
  loadDisplayMode();
  return displayMode.h;
}

void Window::loadDisplayMode(bool reload) {
  if(!displayModeLoaded || reload) {
    if(SDL_GetCurrentDisplayMode(DISPLAY_INDEX, &displayMode) != 0) {
      displayModeLoaded = false;
    }
    displayModeLoaded = true;
  }
}

// Window Manager
bool Window::create(string title, bool hide) {
  uint flags = hide ? 0 : SDL_WINDOW_SHOWN;
  flags = flags | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_INPUT_GRABBED;

  currentWindow = SDL_CreateWindow(title.c_str(), 0, 0, getDisplayWidth(), getDisplayHeight(), flags);
  if(currentWindow == NULL) {
    SDL_DestroyWindow(currentWindow);
    return false;
  }

  Logger::Debug("Initialize window with %dx%dpx resolution.", getDisplayWidth(), getDisplayHeight());

  return true;
}

void Window::destroy() {
  SDL_DestroyWindow(currentWindow);
}<commit_msg>Switch create window message from debug to info<commit_after>// Copyright 2016 <NAME>

#include "framework.h"

Window::Window() {
}

// Display Information

int Window::DISPLAY_INDEX = 0;
bool Window::displayModeLoaded = false;
SDL_DisplayMode Window::displayMode;

int Window::getDisplayWidth() {
  loadDisplayMode();
  return displayMode.w;
}

int Window::getDisplayHeight() {
  loadDisplayMode();
  return displayMode.h;
}

void Window::loadDisplayMode(bool reload) {
  if(!displayModeLoaded || reload) {
    if(SDL_GetCurrentDisplayMode(DISPLAY_INDEX, &displayMode) != 0) {
      displayModeLoaded = false;
    }
    displayModeLoaded = true;
  }
}

// Window Manager
bool Window::create(string title, bool hide) {
  uint flags = hide ? 0 : SDL_WINDOW_SHOWN;
  flags = flags | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_INPUT_GRABBED;

  currentWindow = SDL_CreateWindow(title.c_str(), 0, 0, getDisplayWidth(), getDisplayHeight(), flags);
  if(currentWindow == NULL) {
    SDL_DestroyWindow(currentWindow);
    return false;
  }

  Logger::Info("Initialize window with %dx%dpx resolution.", getDisplayWidth(), getDisplayHeight());

  return true;
}

void Window::destroy() {
  SDL_DestroyWindow(currentWindow);
}
{'fraction_non_alphanumeric': 0.12390121389702805, 'fraction_numerical': 0.007534533277521975, 'mean_word_length': 5.191709844559585, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5581318', 'n_tokens_mistral': 790, 'n_tokens_neox': 744, 'n_words': 165}