<commit_before>#include <core/video/window.h>
#include <core/video/context.h>
#include <core/log/log.h>
#include <core/event/eventdispatcher.h>

namespace fd {
namespace core {
namespace video {

using namespace log;
using namespace event;
using namespace math;

std::unordered_map<HWND, WINWindow*> WINWindow::windowHandles;

LRESULT WINWindow::WndProc(HWND hwnd, UINT msg, WPARAM w, LPARAM l) {
	WINWindow* window = windowHandles[hwnd];

	if (!window) goto end;

	switch (msg) {
		case WM_CLOSE:
			window->open = false;
			break;
		case WM_MOVE: {
			WindowEvent e(EventAction::Move, vec2i(window->GetWidth(), window->GetHeight()), vec2i(LOWORD(l), HIWORD(l)), false, false);
			EventDispatcher::DispatchEvent(&e);
			}
			break;
		case WM_SIZE: {
			WindowEvent e(EventAction::Resize, vec2i(LOWORD(l), HIWORD(l)), vec2i(), false, false);
			EventDispatcher::DispatchEvent(&e);
			}
			break;
	}

	end:

	return DefWindowProc(hwnd, msg, w, l);
}

WINWindow::WINWindow(WindowCreateInfo* info) : Window(info) {

	WNDCLASSEX wnd = { 0 };

	wnd.cbSize = sizeof(WNDCLASSEX);
	wnd.hCursor = LoadCursor(0, IDC_ARROW);
	wnd.hIcon = LoadIcon(0, IDI_WINLOGO);
	wnd.lpfnWndProc = (WNDPROC)WndProc;
	wnd.lpszClassName = L"DANK";
	wnd.style = CS_VREDRAW | CS_HREDRAW;
<commit_msg>Window size changed when resizing<commit_after>#include <core/video/window.h>
#include <core/video/context.h>
#include <core/log/log.h>
#include <core/event/eventdispatcher.h>

namespace fd {
namespace core {
namespace video {

using namespace log;
using namespace event;
using namespace math;

std::unordered_map<HWND, WINWindow*> WINWindow::windowHandles;

LRESULT WINWindow::WndProc(HWND hwnd, UINT msg, WPARAM w, LPARAM l) {
	WINWindow* window = windowHandles[hwnd];

	if (!window) goto end;

	switch (msg) {
		case WM_CLOSE:
			window->open = false;
			break;
		case WM_MOVE: {
			WindowEvent e(EventAction::Move, vec2i(window->GetWidth(), window->GetHeight()), vec2i(LOWORD(l), HIWORD(l)), false, false);
			EventDispatcher::DispatchEvent(&e);
			}
			break;
		case WM_SIZE: {
			WindowEvent e(EventAction::Resize, vec2i(LOWORD(l), HIWORD(l)), vec2i(), false, false);
			window->info.width = e.size.x;
			window->info.height = e.size.y;
			EventDispatcher::DispatchEvent(&e);
			}
			break;
	}

	end:

	return DefWindowProc(hwnd, msg, w, l);
}

WINWindow::WINWindow(WindowCreateInfo* info) : Window(info) {

	WNDCLASSEX wnd = { 0 };

	wnd.cbSize = sizeof(WNDCLASSEX);
	wnd.hCursor = LoadCursor(0, IDC_ARROW);
	wnd.hIcon = LoadIcon(0, IDI_WINLOGO);
	wnd.lpfnWndProc = (WNDPROC)WndProc;
	wnd.lpszClassName = L"DANK";
	wnd.style = CS_VREDRAW | CS_HREDRAW;

{'fraction_non_alphanumeric': 0.14682388740966146, 'fraction_numerical': 0.005325218714340053, 'mean_word_length': 5.045977011494253, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 21, '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': '817060', 'n_tokens_mistral': 1072, 'n_tokens_neox': 1007, 'n_words': 206}