| 28 | } |
| 29 | |
| 30 | IDataStream* OpenGLESDataManager::getData(const std::string& _name) const |
| 31 | { |
| 32 | std::string filepath = getDataPath(_name); |
| 33 | if (filepath.empty()) |
| 34 | return nullptr; |
| 35 | |
| 36 | auto stream = std::make_unique<std::ifstream>(); |
| 37 | stream->open(filepath.c_str(), std::ios_base::binary); |
| 38 | |
| 39 | if (!stream->is_open()) |
| 40 | return nullptr; |
| 41 | |
| 42 | DataFileStream* data = new DataFileStream(std::move(stream)); |
| 43 | |
| 44 | return data; |
| 45 | } |
| 46 | |
| 47 | void OpenGLESDataManager::freeData(IDataStream* _data) |
| 48 | { |