Kiwano Engine v1.3.x
Module.h
1// Copyright (c) 2016-2018 Kiwano - Nomango
2//
3// Permission is hereby granted, free of charge, to any person obtaining a copy
4// of this software and associated documentation files (the "Software"), to deal
5// in the Software without restriction, including without limitation the rights
6// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7// copies of the Software, and to permit persons to whom the Software is
8// furnished to do so, subject to the following conditions:
9//
10// The above copyright notice and this permission notice shall be included in
11// all copies or substantial portions of the Software.
12//
13// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19// THE SOFTWARE.
20
21#pragma once
22#include <kiwano/core/Common.h>
23#include <kiwano/base/Module.h>
24#include <kiwano/platform/Window.h>
25
26namespace kiwano
27{
28namespace imgui
29{
30
35class Module
36 : public Singleton<Module>
37 , public kiwano::Module
38{
39 friend Singleton<Module>;
40
41public:
42 Module();
43
44 void SetupModule() override;
45
46 void DestroyModule() override;
47
48 void OnUpdate(UpdateModuleContext& ctx) override;
49
50 void BeforeRender(RenderModuleContext& ctx) override;
51
52 void AfterRender(RenderModuleContext& ctx) override;
53
54 void HandleEvent(EventModuleContext& ctx) override;
55
56private:
57 void InitPlatform();
58
59 void ShutdownPlatform();
60
61 void UpdateMouseCursor();
62
63private:
64 RefPtr<Window> window_;
65};
66
67} // namespace imgui
68} // namespace kiwano
时间模块上下文
Definition: Module.h:96
基础模块
Definition: Module.h:111
引用计数智能指针
Definition: RefBasePtr.hpp:35
渲染模块上下文
Definition: Module.h:58
Definition: Singleton.h:28
更新模块上下文
Definition: Module.h:83
ImGui模块
Definition: Module.h:38
void OnUpdate(UpdateModuleContext &ctx) override
更新时
Definition: Module.cpp:160
void AfterRender(RenderModuleContext &ctx) override
渲染后
Definition: Module.cpp:198
void HandleEvent(EventModuleContext &ctx) override
事件处理
Definition: Module.cpp:205
void BeforeRender(RenderModuleContext &ctx) override
渲染前
Definition: Module.cpp:185
void SetupModule() override
启动模块
Definition: Module.cpp:109
void DestroyModule() override
销毁模块
Definition: Module.cpp:146