<commit_before>#include "Gui.h"
#include "GfxWindow.h"
#include <imgui/imgui.h>
#include <imgui/imgui_internal.h>
#include "Gfx.h"
#include "DX11.h"
#include "BlackBox.h"
#include "utils_imgui.h"
#include <bblib/codecvt.h>
#include <logging.h>
#include <bblib/ScopeGuard.h>
#include <functional>

namespace bb {
namespace imgui {

	void Gui::OnResize (unsigned w, unsigned h)
	{
		if (m_gfxWindow->IsReady())
		{
			ReleaseDeviceObjects();
			if (m_gfxWindow->m_view)
			{
				m_gfxWindow->m_view->Release();
				m_gfxWindow->m_view = nullptr;
			}
			m_gfx->m_dx11->m_pd3dDeviceContext->OMSetRenderTargets(0, nullptr, nullptr);
			if (!SUCCEEDED(m_gfxWindow->m_chain->ResizeBuffers(0, w, h, DXGI_FORMAT_UNKNOWN, 0)))
			{
			}

			m_gfxWindow->m_view = m_gfx->m_dx11->CreateRenderTarget(m_gfxWindow->m_chain);

			CreateDeviceObjects();
		}
	}

	GuiWidget * Gui::FindWidget (wchar_t const * widgetId)
	{
		for (GuiWidgetPtr & w : m_widgets)
			if (widgetId == w->GetId())
				return w.get();
		return nullptr;
	}

	bool Gui::RmWidget (GuiWidget * widget)
	{
		// TODO
		return 123;
	}
<commit_msg>* gfx perf - on resize window<commit_after>#include "Gui.h"
#include "GfxWindow.h"
#include <imgui/imgui.h>
#include <imgui/imgui_internal.h>
#include "Gfx.h"
#include "DX11.h"
#include "BlackBox.h"
#include "utils_imgui.h"
#include <bblib/codecvt.h>
#include <logging.h>
#include <bblib/ScopeGuard.h>
#include <functional>

namespace bb {
namespace imgui {

	void Gui::OnResize (unsigned w, unsigned h)
	{
		if (m_gfxWindow->IsReady())
		{
			if (m_gfxWindow->m_view)
			{
				m_gfxWindow->m_view->Release();
				m_gfxWindow->m_view = nullptr;
			}
			m_gfx->m_dx11->m_pd3dDeviceContext->OMSetRenderTargets(0, nullptr, nullptr);
			if (!SUCCEEDED(m_gfxWindow->m_chain->ResizeBuffers(0, w, h, DXGI_FORMAT_UNKNOWN, 0)))
			{
			}

			m_gfxWindow->m_view = m_gfx->m_dx11->CreateRenderTarget(m_gfxWindow->m_chain);

			if (!m_hasDeviceObjects)
				CreateDeviceObjects();
		}
	}

	GuiWidget * Gui::FindWidget (wchar_t const * widgetId)
	{
		for (GuiWidgetPtr & w : m_widgets)
			if (widgetId == w->GetId())
				return w.get();
		return nullptr;
	}

	bool Gui::RmWidget (GuiWidget * widget)
	{
		// TODO
		return 123;
	}

{'fraction_non_alphanumeric': 0.15356820234869015, 'fraction_numerical': 0.011743450767841012, 'mean_word_length': 4.224056603773585, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 45, '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': '3070321', 'n_tokens_mistral': 1000, 'n_tokens_neox': 913, 'n_words': 160}