mirror of
https://github.com/NoelFB/blah.git
synced 2024-11-28 16:58:57 +08:00
added App::is_running() getter
This commit is contained in:
parent
9beb7eff58
commit
8add71003c
|
@ -66,6 +66,9 @@ namespace Blah
|
|||
// Runs the application
|
||||
bool run(const Config* config);
|
||||
|
||||
// Checks if the Application is running yet
|
||||
bool is_running();
|
||||
|
||||
// Exits the application.
|
||||
// This only signals for the application to close, it will not stop
|
||||
// until the current update and render calls are finished.
|
||||
|
|
|
@ -147,6 +147,11 @@ bool App::run(const Config* c)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool App::is_running()
|
||||
{
|
||||
return app_is_running;
|
||||
}
|
||||
|
||||
void App::Internal::iterate()
|
||||
{
|
||||
// update at a fixed timerate
|
||||
|
|
|
@ -13,7 +13,7 @@ void Log::info(const char* format, ...)
|
|||
vsnprintf(msg, sizeof(char) * max_length, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (App::config().on_log)
|
||||
if (App::is_running() && App::config().on_log)
|
||||
{
|
||||
App::config().on_log(msg, Category::Info);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ void Log::warn(const char* format, ...)
|
|||
vsnprintf(msg, sizeof(char) * max_length, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (App::config().on_log)
|
||||
if (App::is_running() && App::config().on_log)
|
||||
{
|
||||
App::config().on_log(msg, Category::Warning);
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ void Log::error(const char* format, ...)
|
|||
vsnprintf(msg, sizeof(char) * max_length, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (App::config().on_log)
|
||||
if (App::is_running() && App::config().on_log)
|
||||
{
|
||||
App::config().on_log(msg, Category::Error);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user