-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (31 loc) · 930 Bytes
/
Copy pathmain.cpp
File metadata and controls
36 lines (31 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "encoder.hpp"
#include "logger.hpp"
#include "renderer.hpp"
#include "window.hpp"
/**
* @brief Entry point for the VulkanTest application
*
* This function initialises the renderer and window,
* enters the main event loop, and handles basic error reporting
*/
int main() {
// Print the current build mode to the console
#ifdef NDEBUG
LOG_INFO("Mode: release");
#else
LOG_INFO("Mode: debug");
#endif
try {
// Create the Vulkan renderer and window
VulkanWindow window = VulkanWindow();
VulkanRenderer renderer = VulkanRenderer(&window);
// Show the window and start the event loop
window.pollEvents([&]() { renderer.drawFrame(); });
renderer.waitForLogicalDevices();
} catch (std::exception &e) {
// Print any exception message and exit with failure
LOG_ERROR(e.what());
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}