<commit_before>#include <easylogging.h>

#include "gui/window.h"

#include <functional>
#include <stdexcept>

using namespace std::placeholders;

namespace gui
{
    const glm::vec3& initial_camera_pos = glm::vec3(0, 25, -5);
    const glm::vec3& initial_camera_dir = glm::vec3(-0.2f, -0.1f, 0.9f);

    window::window(const std::string& window_title, const glm::ivec2& dims) :
        m_cursor_locked(false), m_dims(dims), m_fps(60),
        m_fft(glm::ivec2(2048)),
        m_context(window_title, dims,
                  std::bind(&window::on_mouse_up,   this, _1),
                  std::bind(&window::on_mouse_down, this, _1),
                  std::bind(&window::on_mouse_move, this, _1),
                  std::bind(&window::on_key_press,  this, _1),
                  std::bind(&window::on_key_up,     this, _1),
                  std::bind(&window::on_special,    this, _1),
                  std::bind(&window::on_special_up, this, _1),
                  std::bind(&window::on_resize,     this, _1),
                  std::bind(&window::on_display,    this),
                  std::bind(&window::on_update,     this)),
        m_bar("main", "Configuration"),
        m_camera(m_dims,
                 initial_camera_pos,
                 initial_camera_dir,
                 glm::radians(m_bar.cam_fov)),
		models({std::unique_ptr<Model>(new Model("models/Lighthouse.obj")),
		std::unique_ptr<Model>(new Model("models/OutBuilding.obj")),
		std::unique_ptr<Model>(new Model("models/Terrain.obj")),
		std::unique_ptr<Model>(new Model("models/Tree.obj")),
		std::unique_ptr<Model>(new Model("models/STLamp.obj")) }),
        m_skybox(),
        #if !NO_LENS_FLARES
        m_overlay(m_bar.lens_density),
        m_aperture(m_fft),
        m_occlusion(),
        #endif
        m_framebuffer(m_dims),
        m_light_renderer()
    {
        LOG(INFO) << "All components initialized.";
        LOG(TRACE) << "Window resolution is "
                   << m_dims.x << " by "
                   << m_dims.y << " pixels.";

		on_update();
    }

    void window::run()
    {
        m_context.main_loop();
    }

    void window::on_resize(const glm::ivec2& new_dims)
    {
        m_framebuffer.resize(m_dims = new_dims);
        m_camera.resize(m_dims = new_dims);
    }
<commit_msg>shared_ptr fix<commit_after>#include <easylogging.h>

#include "gui/window.h"

#include <functional>
#include <stdexcept>

using namespace std::placeholders;

namespace gui
{
    const glm::vec3& initial_camera_pos = glm::vec3(0, 25, -5);
    const glm::vec3& initial_camera_dir = glm::vec3(-0.2f, -0.1f, 0.9f);

    window::window(const std::string& window_title, const glm::ivec2& dims) :
        m_cursor_locked(false), m_dims(dims), m_fps(60),
        m_fft(glm::ivec2(2048)),
        m_context(window_title, dims,
                  std::bind(&window::on_mouse_up,   this, _1),
                  std::bind(&window::on_mouse_down, this, _1),
                  std::bind(&window::on_mouse_move, this, _1),
                  std::bind(&window::on_key_press,  this, _1),
                  std::bind(&window::on_key_up,     this, _1),
                  std::bind(&window::on_special,    this, _1),
                  std::bind(&window::on_special_up, this, _1),
                  std::bind(&window::on_resize,     this, _1),
                  std::bind(&window::on_display,    this),
                  std::bind(&window::on_update,     this)),
        m_bar("main", "Configuration"),
        m_camera(m_dims,
                 initial_camera_pos,
                 initial_camera_dir,
                 glm::radians(m_bar.cam_fov)),
		models(
        {
            std::shared_ptr<Model>(new Model("models/Lighthouse.obj")),
            std::shared_ptr<Model>(new Model("models/OutBuilding.obj")),
            std::shared_ptr<Model>(new Model("models/Terrain.obj")),
            std::shared_ptr<Model>(new Model("models/Tree.obj")),
            std::shared_ptr<Model>(new Model("models/STLamp.obj"))
        }),
        m_skybox(),
        #if !NO_LENS_FLARES
        m_overlay(m_bar.lens_density),
        m_aperture(m_fft),
        m_occlusion(),
        #endif
        m_framebuffer(m_dims),
        m_light_renderer()
    {
        LOG(INFO) << "All components initialized.";
        LOG(TRACE) << "Window resolution is "
                   << m_dims.x << " by "
                   << m_dims.y << " pixels.";

		on_update();
    }

    void window::run()
    {
        m_context.main_loop();
    }

    void window::on_resize(const glm::ivec2& new_dims)
    {
        m_framebuffer.resize(m_dims = new_dims);
        m_camera.resize(m_dims = new_dims);
    }

{'fraction_non_alphanumeric': 0.1519913885898816, 'fraction_numerical': 0.013347685683530678, 'mean_word_length': 2.323319027181688, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 19, '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': '764056', 'n_tokens_mistral': 1611, 'n_tokens_neox': 1575, 'n_words': 230}