-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
38 lines (28 loc) · 878 Bytes
/
main.cpp
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
37
38
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#define VMA_IMPLEMENTATION
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
#include "src/vulkanapp.h"
Window window(1600, 900);
int main()
{
// if on macOS you will need to set MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS=1 in environment variables
VulkanApp app;
app.create(window);
UserInterface ui;
auto param = app.getImGuiCreateParameters();
param.window = &window;
ui.create(param, app.getGraphicsCommandPool());
app.ui = &ui;
app.setUpCallbacks();
while (!window.shouldClose()) {
glfwPollEvents();
if (glfwGetKey(window.getWindow(), GLFW_KEY_ESCAPE) == GLFW_PRESS)
break;
ui.begin();
ui.render(app.getPartialMenuPayload());
app.render(); // ui.end() called in here since command buffer is needed
}
ui.destroy();
return 0;
}