35 {
36
38 FILE* fp = fopen(appConfigFilePath.c_str(), "r");
39 char readBuffer[65536];
40 rapidjson::FileReadStream is(fp, readBuffer,
41 sizeof(readBuffer));
42 rapidjson::Document doc;
43 doc.ParseStream(is);
44 fclose(fp);
45
46
47 if (doc.HasParseError())
48 {
49 EE_CORE_TRACE("ERROR PARSING The WindowProps JSON");
50 }
52
53 if (doc.HasMember("title") && doc["title"].IsString())
54 {
55 this->
Title = doc[
"title"].GetString();
56 }
57
58 if (doc.HasMember("size"))
59 {
60 const rapidjson::Value& size = doc["size"];
61 if (size.HasMember("x") && size["x"].IsInt())
62 {
63 this->
Width = size[
"x"].GetInt();
64 }
65 if (size.HasMember("y") && size["y"].IsInt())
66 {
67 this->
Height = size[
"y"].GetInt();
68 }
69 }
70
71 if (doc.HasMember("vsync") && doc["vsync"].IsBool())
72 {
73 this->
VSync = doc[
"vsync"].GetBool();
74 }
75 }