Files
ouros/src/app/App.cpp
2026-04-12 14:18:55 -05:00

50 lines
1.1 KiB
C++

#include "App.hpp"
#include "utils/utils.hpp"
App::App() {
utils::debugPrint(__FUNCTION__, __LINE__, "App constructor.", utils::DebugLevel::Trace);
init();
}
void App::init() {
utils::debugPrint(__FUNCTION__, __LINE__, "Init app.", utils::DebugLevel::Trace);
window_ = new Window();
engine_ = new Engine(window_);
}
int App::run() {
utils::debugPrint(__FUNCTION__, __LINE__, "Run app.", utils::DebugLevel::Trace);
bool quit = false;
while (!quit) {
// app loop for as long as the window is open
// other threads might be able to change quit to true to auto close in the future
SDL_Event event;
while(SDL_PollEvent(&event)) { // TODO: pass event handling to window
if(event.type == SDL_EVENT_QUIT ) {
quit = true;
}
}
// pass vulkan handling to engine
// call engine.render() or something
// engine has a pointer to window so can handle pushing to the screen
}
// SDL teardown handled in window destructor
return 0;
}