-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
49 lines (39 loc) · 1.07 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
#include <iostream>
#include <arqanore/window.h>
#include <arqanore/keyboard.h>
bool closed;
void on_open(arqanore::Window *window) {
arqanore::Image icon("assets/icon.png");
window->set_icon(icon);
closed = false;
}
void on_close(arqanore::Window *window) {
if (!closed) {
window->set_closed(false);
}
}
void on_update(arqanore::Window *window, double at) {
if (arqanore::Keyboard::key_pressed(arqanore::Keys::ESCAPE)) {
window->set_closed(true);
closed = true;
}
if (arqanore::Keyboard::key_pressed(arqanore::Keys::M)) {
if (arqanore::Keyboard::key_down(arqanore::Keys::LEFT_ALT)) {
window->maximize();
} else {
window->minimize();
}
}
}
void on_render(arqanore::Window *window) {
}
int main() {
std::cout << "Start program" << std::endl;
auto window = arqanore::Window(1440, 768, "Arqanore");
window.on_open(on_open);
window.on_close(on_close);
window.on_update(on_update);
window.on_render(on_render);
window.open(false, false, true);
return 0;
}