Add quit command
This commit is contained in:
parent
219751a05d
commit
8a40f3e5f8
2 changed files with 8 additions and 1 deletions
|
@ -25,10 +25,14 @@
|
|||
Engine::Engine(const int argc, char* argv[]) {
|
||||
console::info(System::Core, "Prism Engine loading...");
|
||||
|
||||
console::register_command("test_cmd", console::ArgumentFormat(0), [](const console::Arguments arguments) {
|
||||
console::register_command("test_cmd", console::ArgumentFormat(0), [](const console::Arguments) {
|
||||
console::info(System::Core, "Test cmd!");
|
||||
});
|
||||
|
||||
console::register_command("quit", console::ArgumentFormat(0), [this](const console::Arguments) {
|
||||
quit();
|
||||
});
|
||||
|
||||
console::invoke_command("test_cmd", console::Arguments());
|
||||
|
||||
for(int i = 0; i < argc; i++)
|
||||
|
|
|
@ -599,6 +599,9 @@ int main(int argc, char* argv[]) {
|
|||
const uint64_t current = clock_gettime_nsec_np(CLOCK_UPTIME_RAW);
|
||||
const uint64_t elapsed = current - last_time;
|
||||
|
||||
if(engine->is_quitting())
|
||||
is_qutting = true;
|
||||
|
||||
for(auto& window : windows) {
|
||||
if(window != nullptr)
|
||||
[window->delegate update];
|
||||
|
|
Reference in a new issue