[deploy] Add GetVersion function
This commit is contained in:
parent
a1e7e77c96
commit
a6961c0d20
|
|
@ -0,0 +1,5 @@
|
|||
// 提示文件帮助 Visual Studio IDE 解释 Visual C++ 标识符,
|
||||
// 如函数和宏的名称。
|
||||
// 有关详细信息,请参见 https://go.microsoft.com/fwlink/?linkid=865984
|
||||
|
||||
#define KGE_API
|
||||
|
|
@ -182,6 +182,9 @@
|
|||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="cpp.hint" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{FF7F943D-A89C-4E6C-97CF-84F7D8FF8EDF}</ProjectGuid>
|
||||
<RootNamespace>kiwano</RootNamespace>
|
||||
|
|
@ -260,4 +263,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
@ -534,4 +534,7 @@
|
|||
<Filter>core</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="cpp.hint" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -29,6 +29,11 @@
|
|||
namespace kiwano
|
||||
{
|
||||
|
||||
int GetVersion()
|
||||
{
|
||||
return KGE_VERSION;
|
||||
}
|
||||
|
||||
Application::Application()
|
||||
: quiting_(false)
|
||||
, time_scale_(1.f)
|
||||
|
|
@ -40,11 +45,6 @@ Application::Application()
|
|||
|
||||
Application::~Application() {}
|
||||
|
||||
int Application::GetVersion() const
|
||||
{
|
||||
return KGE_VERSION;
|
||||
}
|
||||
|
||||
void Application::Run(RunnerPtr runner, bool debug)
|
||||
{
|
||||
KGE_ASSERT(runner);
|
||||
|
|
@ -112,6 +112,22 @@ void Application::SetTimeScale(float scale_factor)
|
|||
time_scale_ = scale_factor;
|
||||
}
|
||||
|
||||
void Application::DispatchEvent(EventPtr evt)
|
||||
{
|
||||
this->DispatchEvent(evt.Get());
|
||||
}
|
||||
|
||||
void Application::DispatchEvent(Event* evt)
|
||||
{
|
||||
for (auto comp : modules_)
|
||||
{
|
||||
if (auto event_comp = comp->Cast<EventModule>())
|
||||
{
|
||||
event_comp->HandleEvent(evt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Application::Update(Duration dt)
|
||||
{
|
||||
// Before update
|
||||
|
|
@ -200,17 +216,6 @@ void Application::Render()
|
|||
renderer.Present();
|
||||
}
|
||||
|
||||
void Application::DispatchEvent(Event* evt)
|
||||
{
|
||||
for (auto comp : modules_)
|
||||
{
|
||||
if (auto event_comp = comp->Cast<EventModule>())
|
||||
{
|
||||
event_comp->HandleEvent(evt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Application::PreformInMainThread(Function<void()> func)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(perform_mutex_);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,13 @@
|
|||
|
||||
namespace kiwano
|
||||
{
|
||||
|
||||
/**
|
||||
* \~chinese
|
||||
* @brief 获取版本号
|
||||
*/
|
||||
extern KGE_API int GetVersion();
|
||||
|
||||
/**
|
||||
* \~chinese
|
||||
* @brief 应用程序,控制游戏的整个生命周期,包括初始化、启动、结束以及事件分发等
|
||||
|
|
@ -70,12 +77,6 @@ public:
|
|||
*/
|
||||
WindowPtr GetMainWindow() const;
|
||||
|
||||
/**
|
||||
* \~chinese
|
||||
* @brief 获取版本号
|
||||
*/
|
||||
int GetVersion() const;
|
||||
|
||||
/**
|
||||
* \~chinese
|
||||
* @brief 添加模块
|
||||
|
|
@ -92,6 +93,14 @@ public:
|
|||
*/
|
||||
void SetTimeScale(float scale_factor);
|
||||
|
||||
/**
|
||||
* \~chinese
|
||||
* @brief 分发事件
|
||||
* @details 将事件分发给所有事件功能模块
|
||||
* @param evt 事件
|
||||
*/
|
||||
void DispatchEvent(EventPtr evt);
|
||||
|
||||
/**
|
||||
* \~chinese
|
||||
* @brief 分发事件
|
||||
|
|
|
|||
Loading…
Reference in New Issue