MGL(Win32)
読み取り中…
検索中…
一致する文字列を見つけられません
mgl_initializer_delegate.h
[詳解]
1// SPDX-License-Identifier: Zlib
2/* ------------------------------------------------------------------------- */
9/* ------------------------------------------------------------------------- */
10
11#ifndef INCGUARD_MGL_INITIALIZER_DELEGATE_H_1616047024
12#define INCGUARD_MGL_INITIALIZER_DELEGATE_H_1616047024
13
16#include <mgl/mgl_environment.h>
21
22namespace MGL
23{
24// レンダラ関連の前方宣言
25namespace Render
26{
27class Renderer2DDelegate;
28class TextureGenerator;
29class TextureStorage;
30} // namespace Render
31
32// オーディオ関連の前方宣言
33namespace Audio
34{
35class Renderer;
36}
37
38// システム関連の前方宣言
39namespace System
40{
41class ApplicationModuleInterface;
42class ChronoModuleInterface;
43class DebugModuleInterface;
44class LocaleModuleInterface;
45class WindowModuleInterface;
46} // namespace System
47
48// 入力関連の前方宣言
49namespace Input
50{
51class KeyboardDelegate;
52class MouseDelegate;
53class TouchDelegate;
54class GamepadDelegate;
55class GamepadServer;
56} // namespace Input
57
60{
61public:
62 /* ------------------------------------------------------------------------- */
66 /* ------------------------------------------------------------------------- */
67 virtual ~InitializerDelegate() noexcept = default;
68
69 /* ------------------------------------------------------------------------- */
74 /* ------------------------------------------------------------------------- */
75 [[nodiscard]] constexpr Audio::InitializeMode GetAudioInitializeMode() const noexcept
76 {
77 return _audioInitMode;
78 }
79
80 /* ------------------------------------------------------------------------- */
85 /* ------------------------------------------------------------------------- */
86 constexpr void SetAudioInitializeMode(Audio::InitializeMode mode) noexcept
87 {
88 _audioInitMode = mode;
89 }
90
91 /* ------------------------------------------------------------------------- */
96 /* ------------------------------------------------------------------------- */
97 [[nodiscard]] constexpr System::LogLevel GetLogLevel() const noexcept
98 {
99 return _logLevel;
100 }
101
102 /* ------------------------------------------------------------------------- */
107 /* ------------------------------------------------------------------------- */
108 constexpr void SetLogLevel(System::LogLevel logLevel) noexcept
109 {
110 _logLevel = logLevel;
111 }
112
113 /* ------------------------------------------------------------------------- */
118 /* ------------------------------------------------------------------------- */
119 [[nodiscard]] constexpr System::Language GetLanguage() const noexcept
120 {
121 return _language;
122 }
123
124 /* ------------------------------------------------------------------------- */
129 /* ------------------------------------------------------------------------- */
130 constexpr void SetLanguage(System::Language language) noexcept
131 {
132 _language = language;
133 }
134
135 /* ------------------------------------------------------------------------- */
140 /* ------------------------------------------------------------------------- */
141 [[nodiscard]] virtual STL::unique_ptr<Render::Renderer2DDelegate> MakeRenderer2D() const noexcept;
142
143 /* ------------------------------------------------------------------------- */
148 /* ------------------------------------------------------------------------- */
149 [[nodiscard]] virtual STL::unique_ptr<Render::TextureGenerator> MakeTextureGenerator() const noexcept;
150
151 /* ------------------------------------------------------------------------- */
155 /* ------------------------------------------------------------------------- */
156 virtual void MakeTextureLoader(Render::TextureStorage &textureStorage) const noexcept
157 {
158 (void)textureStorage;
159 }
160
161 /* ------------------------------------------------------------------------- */
166 /* ------------------------------------------------------------------------- */
167 [[nodiscard]] virtual STL::unique_ptr<Audio::Renderer> MakeAudioRenderer() const noexcept;
168
169 /* ------------------------------------------------------------------------- */
175 /* ------------------------------------------------------------------------- */
176 virtual File::Result DidInitializeFileSystem() noexcept
177 {
178 return File::Error::NoOperation;
179 }
180
181 /* ------------------------------------------------------------------------- */
186 /* ------------------------------------------------------------------------- */
188
189 /* ------------------------------------------------------------------------- */
194 /* ------------------------------------------------------------------------- */
195 [[nodiscard]] virtual STL::unique_ptr<System::ChronoModuleInterface> MakeChronoModule() const noexcept;
196
197 /* ------------------------------------------------------------------------- */
202 /* ------------------------------------------------------------------------- */
203 [[nodiscard]] virtual STL::unique_ptr<System::DebugModuleInterface> MakeDebugModule() const noexcept;
204
205 /* ------------------------------------------------------------------------- */
210 /* ------------------------------------------------------------------------- */
211 [[nodiscard]] virtual STL::unique_ptr<System::LocaleModuleInterface> MakeLocaleModule() const noexcept;
212
213 /* ------------------------------------------------------------------------- */
218 /* ------------------------------------------------------------------------- */
219 [[nodiscard]] virtual STL::unique_ptr<System::WindowModuleInterface> MakeWindowModule() const noexcept;
220
221 /* ------------------------------------------------------------------------- */
226 /* ------------------------------------------------------------------------- */
227 [[nodiscard]] virtual STL::unique_ptr<Input::KeyboardDelegate> MakeKeyboardDelegate() const noexcept;
228
229 /* ------------------------------------------------------------------------- */
234 /* ------------------------------------------------------------------------- */
235 [[nodiscard]] virtual STL::unique_ptr<Input::MouseDelegate> MakeMouseDelegate() const noexcept;
236
237 /* ------------------------------------------------------------------------- */
242 /* ------------------------------------------------------------------------- */
243 [[nodiscard]] virtual STL::unique_ptr<Input::TouchDelegate> MakeTouchDelegate() const noexcept;
244
245 /* ------------------------------------------------------------------------- */
252 /* ------------------------------------------------------------------------- */
253 virtual bool DidInitializeGamepadServer(Input::GamepadServer &server) const noexcept
254 {
255 (void)server;
256 return true;
257 }
258
259private:
260 Audio::InitializeMode _audioInitMode{Audio::InitializeMode::None};
261 System::LogLevel _logLevel{System::LogLevel::AppTrace};
262
263 System::Language _language{System::Language::Unknown};
264};
265} // namespace MGL
266
267#endif // INCGUARD_MGL_INITIALIZER_DELEGATE_H_1616047024
268
269// vim: et ts=4 sw=4 sts=4
イニシャライザデリゲート
Definition mgl_initializer_delegate.h:60
constexpr System::Language GetLanguage() const noexcept
使用する言語の取得
Definition mgl_initializer_delegate.h:119
virtual STL::unique_ptr< System::ApplicationModuleInterface > MakeApplicationModule() const noexcept
アプリケーションモジュールの生成
Definition mgl_initializer_delegate.cc:68
constexpr void SetLanguage(System::Language language) noexcept
使用する言語の設定
Definition mgl_initializer_delegate.h:130
virtual void MakeTextureLoader(Render::TextureStorage &textureStorage) const noexcept
テクスチャローダーを生成
Definition mgl_initializer_delegate.h:156
virtual STL::unique_ptr< System::LocaleModuleInterface > MakeLocaleModule() const noexcept
ロケール情報モジュールを生成
Definition mgl_initializer_delegate.cc:101
constexpr void SetLogLevel(System::LogLevel logLevel) noexcept
デフォルトのログレベルを設定
Definition mgl_initializer_delegate.h:108
constexpr void SetAudioInitializeMode(Audio::InitializeMode mode) noexcept
オーディオの初期化タイプを設定
Definition mgl_initializer_delegate.h:86
virtual bool DidInitializeGamepadServer(Input::GamepadServer &server) const noexcept
ゲームパッドサーバ初期化後の処理
Definition mgl_initializer_delegate.h:253
virtual STL::unique_ptr< System::DebugModuleInterface > MakeDebugModule() const noexcept
デバッグモジュールを生成
Definition mgl_initializer_delegate.cc:90
virtual STL::unique_ptr< System::ChronoModuleInterface > MakeChronoModule() const noexcept
日付と時刻のモジュールを生成
Definition mgl_initializer_delegate.cc:79
virtual STL::unique_ptr< Audio::Renderer > MakeAudioRenderer() const noexcept
オーディオレンダラの生成
Definition mgl_initializer_delegate.cc:57
virtual STL::unique_ptr< Input::KeyboardDelegate > MakeKeyboardDelegate() const noexcept
キーボード入力デリゲートの生成
Definition mgl_initializer_delegate.cc:124
virtual File::Result DidInitializeFileSystem() noexcept
ファイルシステム初期化後の処理
Definition mgl_initializer_delegate.h:176
virtual STL::unique_ptr< System::WindowModuleInterface > MakeWindowModule() const noexcept
ウィンドウモジュールを生成
Definition mgl_initializer_delegate.cc:112
virtual STL::unique_ptr< Render::TextureGenerator > MakeTextureGenerator() const noexcept
テクスチャジェネレータを生成
Definition mgl_initializer_delegate.cc:45
constexpr Audio::InitializeMode GetAudioInitializeMode() const noexcept
オーディオの初期化モードを取得
Definition mgl_initializer_delegate.h:75
virtual STL::unique_ptr< Render::Renderer2DDelegate > MakeRenderer2D() const noexcept
2Dレンダラを生成
Definition mgl_initializer_delegate.cc:33
constexpr System::LogLevel GetLogLevel() const noexcept
デフォルトのログレベルを取得
Definition mgl_initializer_delegate.h:97
virtual ~InitializerDelegate() noexcept=default
デストラクタ
virtual STL::unique_ptr< Input::MouseDelegate > MakeMouseDelegate() const noexcept
マウス入力デリゲートの生成
Definition mgl_initializer_delegate.cc:136
virtual STL::unique_ptr< Input::TouchDelegate > MakeTouchDelegate() const noexcept
タッチ入力デリゲートの生成
Definition mgl_initializer_delegate.cc:148
MGL オーディオ関連定義
InitializeMode
初期化モード
Definition mgl_audio_defs.h:42
MGL デバッグ用ログレベル定義
LogLevel
ログレベル
Definition mgl_debug_log_level.h:20
MGL 環境定義
MGL ファイル用各種定義
MGL ロケール情報の定義
Language
言語
Definition mgl_locale_info.h:22
MGL 描画関連の定義
MGL STLのメモリ関連の代替
std::unique_ptr< T, Deleter > unique_ptr
MGLのアロケータを利用するユニークポインタ
Definition mgl_stl_memory.h:247