Berserk
ResShader.hpp
Go to the documentation of this file.
1 /**********************************************************************************/
2 /* This file is part of Berserk Engine project */
3 /* https://github.com/EgorOrachyov/Berserk */
4 /**********************************************************************************/
5 /* MIT License */
6 /* */
7 /* Copyright (c) 2018 - 2021 Egor Orachyov */
8 /* */
9 /* Permission is hereby granted, free of charge, to any person obtaining a copy */
10 /* of this software and associated documentation files (the "Software"), to deal */
11 /* in the Software without restriction, including without limitation the rights */
12 /* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell */
13 /* copies of the Software, and to permit persons to whom the Software is */
14 /* furnished to do so, subject to the following conditions: */
15 /* */
16 /* The above copyright notice and this permission notice shall be included in all */
17 /* copies or substantial portions of the Software. */
18 /* */
19 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR */
20 /* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, */
21 /* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE */
22 /* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER */
23 /* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, */
24 /* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */
25 /* SOFTWARE. */
26 /**********************************************************************************/
27 
28 #ifndef BERSERK_RESSHADER_HPP
29 #define BERSERK_RESSHADER_HPP
30 
31 #include <resource/Resource.hpp>
33 
34 #include <render/shader/Shader.hpp>
35 
37 
48 public:
49  BRK_API ~ResShaderImportOptions() override = default;
50 
52 };
53 
58 class ResShader final : public Resource {
59 public:
60  BRK_API ResShader() = default;
61  BRK_API ~ResShader() override = default;
62 
63  BRK_API const StringName &GetResourceType() const override;
65 
67  BRK_API bool HasParam(const StringName &name) const;
68 
69  BRK_API const StringName &GetArchetype() const;
71  BRK_API const Ref<const Shader> &GetShader() const { return mShader; }
72 
73 private:
74  Ref<const Shader> mShader;
75 };
76 
82 
83 #endif//BERSERK_RESSHADER_HPP
#define BRK_NS_END
Definition: Config.hpp:48
#define BRK_API
Definition: Config.hpp:32
Options to import shader resource.
Definition: ResShader.hpp:47
BRK_API ~ResShaderImportOptions() override=default
Ref< ShaderCompileOptions > options
Definition: ResShader.hpp:51
Engine shader program for rendering.
Definition: ResShader.hpp:58
BRK_API ~ResShader() override=default
BRK_API bool HasParam(const StringName &name) const
Definition: ResShader.cpp:50
BRK_API const StringName & GetArchetype() const
Definition: ResShader.cpp:55
BRK_API const Ref< ShaderCompileOptions > & GetCompileOptions() const
Definition: ResShader.cpp:60
BRK_API void CreateFromShader(Ref< const Shader > shader)
Definition: ResShader.cpp:41
BRK_API const StringName & GetResourceType() const override
Definition: ResShader.cpp:32
BRK_API ResShader()=default
static BRK_API const StringName & GetResourceTypeStatic()
Definition: ResShader.cpp:36
BRK_API const Ref< const Shader > & GetShader() const
Definition: ResShader.hpp:71
Base class for import options to import specific resource.
Definition: ResourceImporter.hpp:48
Base class for any engine resource object.
Definition: Resource.hpp:48
Options passed to compile shader.
Definition: Shader.hpp:67
Cached shared utf-8 string id.
Definition: StringName.hpp:61
Definition: GLDevice.cpp:46