Merge pull request #98 from SHADE-DP/SP3-6-c-scripting
Added Time class for C#
This commit is contained in:
commit
2dcf367bc5
|
@ -14,7 +14,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include "Tools/SHLogger.h"
|
|
||||||
#include "SH_API.h"
|
#include "SH_API.h"
|
||||||
|
|
||||||
namespace SHADE
|
namespace SHADE
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
/************************************************************************************//*!
|
||||||
|
\file Time.cxx
|
||||||
|
\author Tng Kah Wei, kahwei.tng, 390009620
|
||||||
|
\par email: kahwei.tng\@digipen.edu
|
||||||
|
\date Oct 19, 2022
|
||||||
|
\brief This file is present so that the properties in Time.hxx would be compiled
|
||||||
|
into the DLL.
|
||||||
|
|
||||||
|
Note: This file is written in C++17/CLI.
|
||||||
|
|
||||||
|
Copyright (C) 2022 DigiPen Institute of Technology.
|
||||||
|
Reproduction or disclosure of this file or its contents without the prior written consent
|
||||||
|
of DigiPen Institute of Technology is prohibited.
|
||||||
|
*//*************************************************************************************/
|
||||||
|
// Precompiled Headers
|
||||||
|
#include "SHpch.h"
|
||||||
|
// Primary Header
|
||||||
|
#include "Time.hxx"
|
||||||
|
|
||||||
|
namespace SHADE
|
||||||
|
{
|
||||||
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
/* Properties */
|
||||||
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
double Time::DeltaTime::get()
|
||||||
|
{
|
||||||
|
return SHFrameRateController::GetRawDeltaTime();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
/************************************************************************************//*!
|
||||||
|
\file Time.hxx
|
||||||
|
\author Tng Kah Wei, kahwei.tng, 390009620
|
||||||
|
\par email: kahwei.tng\@digipen.edu
|
||||||
|
\date Oct 19, 2022
|
||||||
|
\brief Contains the definition of the Time static class and the definition of
|
||||||
|
its properties.
|
||||||
|
|
||||||
|
Note: This file is written in C++17/CLI.
|
||||||
|
|
||||||
|
Copyright (C) 2022 DigiPen Institute of Technology.
|
||||||
|
Reproduction or disclosure of this file or its contents without the prior written consent
|
||||||
|
of DigiPen Institute of Technology is prohibited.
|
||||||
|
*//*************************************************************************************/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "FRC/SHFramerateController.h"
|
||||||
|
|
||||||
|
namespace SHADE
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Static class that contains the functions for working with time.
|
||||||
|
/// </summary>
|
||||||
|
public ref class Time abstract sealed
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/*-----------------------------------------------------------------------------*/
|
||||||
|
/* Properties */
|
||||||
|
/*-----------------------------------------------------------------------------*/
|
||||||
|
/// <summary>
|
||||||
|
/// Time taken to process the previous frame.
|
||||||
|
/// Note, is affected by TimeScale. Use UnscaledDeltaTime if you wish to retrieve
|
||||||
|
/// real world time. This is also affected by MaxDeltaTime clamping that
|
||||||
|
/// UnscaledDeltaTime is subject to.
|
||||||
|
/// </summary>
|
||||||
|
static property double DeltaTime
|
||||||
|
{
|
||||||
|
double get();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue