| 1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
| 2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
| 3 | #pragma once |
| 4 | |
| 5 | #include "BsPrerequisites.h" |
| 6 | #include "Material/BsShaderManager.h" |
| 7 | |
| 8 | namespace bs |
| 9 | { |
| 10 | /** @addtogroup Resources-Engine-Internal |
| 11 | * @{ |
| 12 | */ |
| 13 | |
| 14 | /** |
| 15 | * Shader include handler for the engine. It loads includes relative to the application working directory and supports |
| 16 | * special $ENGINE$ folder for built-in includes. |
| 17 | */ |
| 18 | class BS_EXPORT EngineShaderIncludeHandler : public IShaderIncludeHandler |
| 19 | { |
| 20 | public: |
| 21 | /** @copydoc IShaderIncludeHandler::findInclude */ |
| 22 | HShaderInclude findInclude(const String& name) const override; |
| 23 | |
| 24 | /** @copydoc IShaderIncludeHandler::addSearchPath */ |
| 25 | void addSearchPath(const Path& path) override { mSearchPaths.push_back(path); } |
| 26 | |
| 27 | /** Converts a shader include name or path to a path of the resource containing include data. */ |
| 28 | static Path toResourcePath(const String& name); |
| 29 | |
| 30 | private: |
| 31 | Vector<Path> mSearchPaths; |
| 32 | }; |
| 33 | |
| 34 | /** @} */ |
| 35 | } |