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 "BsCorePrerequisites.h" |
6 | #include "Resources/BsResource.h" |
7 | |
8 | namespace bs |
9 | { |
10 | /** @addtogroup Resources |
11 | * @{ |
12 | */ |
13 | |
14 | /** Raw text resource that serves as an include file for shaders. */ |
15 | class BS_CORE_EXPORT ShaderInclude : public Resource |
16 | { |
17 | public: |
18 | /** Text of the include file. */ |
19 | const String& getString() const { return mString; } |
20 | |
21 | /** Creates a new include file resource with the specified include string. */ |
22 | static HShaderInclude create(const String& includeString); |
23 | |
24 | public: // ***** INTERNAL ****** |
25 | /** @name Internal |
26 | * @{ |
27 | */ |
28 | |
29 | /** |
30 | * Creates an include file resource with the specified include string. |
31 | * |
32 | * @note Internal method. Use create() for normal use. |
33 | */ |
34 | static SPtr<ShaderInclude> _createPtr(const String& includeString); |
35 | |
36 | /** @} */ |
37 | private: |
38 | ShaderInclude(const String& includeString); |
39 | |
40 | String mString; |
41 | |
42 | /************************************************************************/ |
43 | /* SERIALIZATION */ |
44 | /************************************************************************/ |
45 | public: |
46 | friend class ShaderIncludeRTTI; |
47 | static RTTITypeBase* getRTTIStatic(); |
48 | RTTITypeBase* getRTTI() const override; |
49 | }; |
50 | |
51 | /** @} */ |
52 | } |