#include "MainWindow.hpp"
#ifdef _WIN32
#include "D3D.hpp"
#include <imgui_impl_dx11.cpp>
#endif

#include <imgui_impl_sdl2.h>
#include <imgui.h>
#include <iostream>
#include <string>
#include <vector>

#include "SDL.hpp"
#include "DumpDVD.hpp"

namespace Li::Gui {
	MainWindow::MainWindow() {
		this->sdl = new SDL("DumpDVD", 800, 400);

		DumpDVD* dumpDvdMenu = new DumpDVD();
		uint32_t lastRenderTime = SDL_GetTicks();
		while (!this->sdl->IsExiting()) {
			uint32_t curRenderTime = SDL_GetTicks();
			uint32_t delta = curRenderTime - lastRenderTime;
			if (delta > 1000 / 60.0)
			{
				this->sdl->PollEvent();
				this->sdl->NewFrame();

				dumpDvdMenu->RenderUI();

				this->sdl->Render();

				lastRenderTime = curRenderTime;
			}
		}

		delete dumpDvdMenu;
	}

	MainWindow::~MainWindow() {

	}

}