GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
graphic_system.h
[詳解]
1
3
4// Copyright(c) 2023-2025 Design Engineering Laboratory, Saitama University
5// Released under the MIT license
6// https://opensource.org/licenses/mit-license.php
7
8#ifndef DESIGNLAB_GRAPHIC_SYSTEM_H_
9#define DESIGNLAB_GRAPHIC_SYSTEM_H_
10
11#include <memory>
12
13#include <boost/thread.hpp>
14
16#include "fps_controller.h"
17#include "graphic_data_broker.h"
19
20
21namespace designlab {
22
78class GraphicSystem final {
79public:
81 explicit GraphicSystem(const std::shared_ptr<const ApplicationSettingRecord> setting_ptr);
82
83
87 void Main();
88
91 void ChangeGraphicMain(std::unique_ptr<IGraphicMain>&& graphic_main_ptr);
92
95 inline bool IsInitialized() const {
96 return is_initialized_;
97 }
98
99private:
103 bool MyDxlibInit();
104
108 bool Loop();
109
111 void MyDxlibFinalize() const;
112
114 std::unique_ptr<IGraphicMain> graphic_main_ptr_;
115
117 const std::shared_ptr<const ApplicationSettingRecord> setting_ptr_;
118
120 FpsController fps_controller_;
121
123 bool is_initialized_{ false };
124
127 boost::mutex mutex_;
128};
129
130} // namespace designlab
131
132
133#endif // DESIGNLAB_GRAPHIC_SYSTEM_H_
FPSを一定にキープするためのクラス.
Dxlibの処理を行うクラス.
bool IsInitialized() const
初期化が終わっているか.
void ChangeGraphicMain(std::unique_ptr< IGraphicMain > &&graphic_main_ptr)
グラフィックの表示を行うクラスを変更する.
void Main()
ウィンドウの表示を行う関数. boost::thread にこの関数を渡して並列処理を行う. メンバ関数の MyDxlibInit 関数に失敗した場合,終了する.