46 lines
836 B
C++
46 lines
836 B
C++
#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();
|
|
|
|
while (!this->sdl->IsExiting()) {
|
|
uint64_t start = SDL_GetPerformanceCounter();
|
|
this->sdl->PollEvent();
|
|
this->sdl->NewFrame();
|
|
|
|
dumpDvdMenu->RenderUI();
|
|
|
|
this->sdl->Render();
|
|
uint64_t end = SDL_GetPerformanceCounter();
|
|
float elapsedMS = (end - start) / (float)SDL_GetPerformanceFrequency() * 1000.0f;
|
|
// Cap to 60 FPS
|
|
SDL_Delay(floor(16.666f - elapsedMS));
|
|
}
|
|
|
|
delete dumpDvdMenu;
|
|
}
|
|
|
|
MainWindow::~MainWindow() {
|
|
|
|
}
|
|
|
|
} |