Graphics Example Stable

This commit is contained in:
IlyaShurupov 2024-03-19 11:37:55 +03:00
parent bb5cbfdfe2
commit b342f4fd8c
10 changed files with 28 additions and 12 deletions

View file

@ -1,5 +1,7 @@
#include "Window.hpp"
#include "Graphics.hpp"
#include "Timing.hpp"
#include "imgui.h"
@ -16,15 +18,19 @@ int main() {
int fps = 0;
tp::Timer timer(1000);
auto window = tp::Window::createWindow();
{
auto window = tp::Window::createWindow(800, 600, "Window 1");
tp::Graphics graphics(window);
if (window) {
while (!window->shouldClose()) {
window->processEvents();
graphics.proc();
ImGui::Text("fps: %i", fps);
graphics.draw();
window->draw();
if (timer.isTimeout()) {
@ -37,8 +43,9 @@ int main() {
}
}
tp::Window::destroyWindow(window);
}
tp::Window::destroyWindow(window);
testModule.deinitialize();
}