TerraForge3D  2.3.1
3D Terrain And Landscape Generator
TextureStore.h
1#pragma once
2
3#include <string>
4#include <vector>
5
6#include "Base/Texture2D.h"
7
8#include "json/json.hpp"
9
11
13{
14 std::string name = "";
15 int download_count = 0;
16
17 std::string thumbnailPath = "";
18 Texture2D *texThumbnail = nullptr;
19
20 std::string baseDir = "";
21
22 std::string abledo = "";
23 std::string normal = "";
24 std::string roughness = "";
25 std::string metallic = "";
26 std::string ao = "";
27 std::string arm = "";
28
29 bool downloaded = false;
30
31 std::vector<std::string> authours = {};
32};
33
35{
36public:
39
40 void ShowSettings(bool *pOpen);
41
42 void DownloadTexture(int id, int res);
43 void DeleteTexture(int id);
44
45 void SaveDownloadsDatabase();
46
47 inline static TextureStore *Get() { return sInstance; }
48
49private:
50 void LoadTextureThumbs();
51 void VerifyTextureThumbs();
52 void LoadTextureDatabase();
53 nlohmann::json LoadDownloadedTextureDatabaseJ();
54 nlohmann::json LoadTextureDatabaseJ();
55
56 void ShowAllTexturesSettings();
57 void ShowDownloadedTexturesSettings();
58
59
60private:
61 static TextureStore* sInstance;
62 nlohmann::json textureDatabaseJ;
63 nlohmann::json downloadedTextureDatabaseJ;
64 std::string uid;
65
66 char searchStr[4096];
67
68
69public:
70 std::vector<TextureStoreItem> textureStoreItems;
71 std::vector<int> downloadedTextureStoreItems;
72 ApplicationState *appState;
73};
a class to store JSON values
Definition: json.hpp:17860