-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdrawer.cpp
More file actions
47 lines (34 loc) · 945 Bytes
/
Copy pathdrawer.cpp
File metadata and controls
47 lines (34 loc) · 945 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
37
38
39
40
41
42
43
44
45
46
47
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#include <cstdlib>
#define WINDOW_HEIGHT 500
#define WINDOW_WIDTH 800
GLFWwindow *window = NULL;
void GLFW_KeyCallback(GLFWwindow *window, int key, int scancode, int action,
int mods) {
if ((key == GLFW_KEY_ESCAPE) && (action == GLFW_PRESS)) {
glfwSetWindowShouldClose(window, GLFW_TRUE);
}
}
int main(int argc, char *argv[]) {
if (!glfwInit()) {
return EXIT_FAILURE;
}
if (!glfwVulkanSupported()) {
return EXIT_FAILURE;
}
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
window =
glfwCreateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, "First Window", NULL, NULL);
if (!window) {
glfwTerminate();
exit(EXIT_FAILURE);
}
glfwSetKeyCallback(window, GLFW_KeyCallback);
while (!glfwWindowShouldClose(window)) {
glfwPollEvents();
}
glfwTerminate();
return EXIT_SUCCESS;
}