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 "BsSLPrerequisites.h"
6#include "Importer/BsSpecificImporter.h"
7
8namespace bs
9{
10 /** @addtogroup bsfSL
11 * @{
12 */
13
14 /**
15 * Importer using for importing a shader written using the BSL syntax. Shader files are plain text files ending with
16 * ".bsl" extension.
17 */
18 class SLImporter : public SpecificImporter
19 {
20 public:
21 SLImporter() = default;
22 virtual ~SLImporter() = default;
23
24 /** @copydoc SpecificImporter::isExtensionSupported */
25 bool isExtensionSupported(const String& ext) const override;
26
27 /** @copydoc SpecificImporter::isMagicNumberSupported */
28 bool isMagicNumberSupported(const UINT8* magicNumPtr, UINT32 numBytes) const override;
29
30 /** @copydoc SpecificImporter::getAsyncMode */
31 ImporterAsyncMode getAsyncMode() const override { return ImporterAsyncMode::Single; }
32
33 /** @copydoc SpecificImporter::import */
34 SPtr<Resource> import(const Path& filePath, SPtr<const ImportOptions> importOptions) override;
35
36 /** @copydoc SpecificImporter::createImportOptions */
37 SPtr<ImportOptions> createImportOptions() const override;
38 };
39
40 /** @} */
41}