-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathConfig.h
More file actions
96 lines (78 loc) · 1.62 KB
/
Config.h
File metadata and controls
96 lines (78 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#pragma once
///
/// 構成データクラスの定義
///
/// @file
/// @author Kohe Tokoi
/// @date November 15, 2022
///
// 補助プログラム
#include "gg.h"
using namespace gg;
// 構成ファイルの読み取り補助
#include "parseconfig.h"
///
/// 構成データ
///
class Config
{
// メニュークラスから参照する
friend class Menu;
// ウィンドウサイズ
std::array<GLsizei, 2> winSize;
// メニューフォント名
std::string menuFont;
// メニューフォントサイズ
float menuFontSize;
// 光源
GgSimpleShader::Light light;
// 形状ファイル名
std::string model;
// シェーダのソースファイル名
std::array<std::string, 3> shader;
public:
///
/// コンストラクタ
///
Config();
///
/// ファイルから構成データを読み込むコンストラクタ
///
/// @param filename 読み込む構成ファイル名
///
Config(const std::string& filename);
///
/// デストラクタ
///
virtual ~Config();
///
/// ウィンドウの横幅を得る
///
/// @return ウィンドウの横幅
///
auto getWidth() const
{
return winSize[0];
}
///
/// ウィンドウの高さを得る
///
/// @return ウィンドウの高さ
///
auto getHeight() const
{
return winSize[1];
}
///
/// 構成ファイルを読み込む
///
/// @param filename 読み込む構成ファイル名
///
bool load(const std::string& filename);
///
/// 構成ファイルを書き出す
///
/// @param 書き出す構成ファイル名
///
bool save(const std::string& filename) const;
};