mirror of
https://github.com/NoelFB/blah.git
synced 2025-02-18 12:48:27 +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
|
// Runs the application
|
||||||
bool run(const Config* config);
|
bool run(const Config* config);
|
||||||
|
|
||||||
|
// Checks if the Application is running yet
|
||||||
|
bool is_running();
|
||||||
|
|
||||||
// Exits the application.
|
// Exits the application.
|
||||||
// This only signals for the application to close, it will not stop
|
// This only signals for the application to close, it will not stop
|
||||||
// until the current update and render calls are finished.
|
// until the current update and render calls are finished.
|
||||||
|
@ -147,6 +147,11 @@ bool App::run(const Config* c)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool App::is_running()
|
||||||
|
{
|
||||||
|
return app_is_running;
|
||||||
|
}
|
||||||
|
|
||||||
void App::Internal::iterate()
|
void App::Internal::iterate()
|
||||||
{
|
{
|
||||||
// update at a fixed timerate
|
// update at a fixed timerate
|
||||||
|
@ -13,7 +13,7 @@ void Log::info(const char* format, ...)
|
|||||||
vsnprintf(msg, sizeof(char) * max_length, format, ap);
|
vsnprintf(msg, sizeof(char) * max_length, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
if (App::config().on_log)
|
if (App::is_running() && App::config().on_log)
|
||||||
{
|
{
|
||||||
App::config().on_log(msg, Category::Info);
|
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);
|
vsnprintf(msg, sizeof(char) * max_length, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
if (App::config().on_log)
|
if (App::is_running() && App::config().on_log)
|
||||||
{
|
{
|
||||||
App::config().on_log(msg, Category::Warning);
|
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);
|
vsnprintf(msg, sizeof(char) * max_length, format, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
if (App::config().on_log)
|
if (App::is_running() && App::config().on_log)
|
||||||
{
|
{
|
||||||
App::config().on_log(msg, Category::Error);
|
App::config().on_log(msg, Category::Error);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user