Added scripting quality of life features #299
|
@ -44,6 +44,10 @@ namespace SHADE
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
bool Application::IsEditor::get()
|
||||||
|
{
|
||||||
|
return SHSystemManager::GetSystem<SHEditor>() != nullptr;
|
||||||
|
}
|
||||||
int Application::WindowWidth::get()
|
int Application::WindowWidth::get()
|
||||||
{
|
{
|
||||||
return SHGraphicsSystemInterface::GetWindowWidth();
|
return SHGraphicsSystemInterface::GetWindowWidth();
|
||||||
|
@ -66,6 +70,9 @@ namespace SHADE
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
void Application::Quit()
|
void Application::Quit()
|
||||||
{
|
{
|
||||||
SHGraphicsSystemInterface::CloseWindow();
|
if (!IsEditor)
|
||||||
|
{
|
||||||
|
SHGraphicsSystemInterface::CloseWindow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,13 @@ namespace SHADE
|
||||||
bool get();
|
bool get();
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// True if the engine is running in the editor.
|
||||||
|
/// </summary>
|
||||||
|
static property bool IsEditor
|
||||||
|
{
|
||||||
|
bool get();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
/// Retrieves the designated width of the current window.
|
/// Retrieves the designated width of the current window.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static property int WindowWidth
|
static property int WindowWidth
|
||||||
|
@ -71,6 +78,7 @@ namespace SHADE
|
||||||
/*-----------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------*/
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Marks the application to stop at the end of the current frame.
|
/// Marks the application to stop at the end of the current frame.
|
||||||
|
/// If running in the editor, this function does nothing.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static void Quit();
|
static void Quit();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue