Clean up Scene3D namespace and header definition
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / loader / shader-definition-factory.h
1 #ifndef DALI_SCENE3D_LOADER_SHADER_DEFINITION_FACTORY_H_
2 #define DALI_SCENE3D_LOADER_SHADER_DEFINITION_FACTORY_H_
3 /*
4  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 // EXTERNAL INCLUDER
21 #include <memory>
22
23 // INTERNAL INCLUDES
24 #include <dali-scene3d/public-api/api.h>
25 #include <dali-scene3d/public-api/loader/index.h>
26 #include <dali-scene3d/public-api/loader/node-definition.h>
27
28 namespace Dali::Scene3D::Loader
29 {
30 struct NodeDefinition;
31 class ResourceBundle;
32
33 class DALI_SCENE3D_API ShaderDefinitionFactory
34 {
35 public:
36   ShaderDefinitionFactory();
37   ~ShaderDefinitionFactory();
38
39   /*
40    * @brief Input for meshes and materials, output for shaders.
41    */
42   void SetResources(ResourceBundle& resources);
43
44   /*
45    * @brief Produces the index of a shader, which should be used to index into the shaders
46    *  vector of the ResourceBundle which was provided for the factory. This shader will be
47    *  created if one with the given settings hasn't been created by the factory yet (shaders
48    *  already existing in the ResourceBundle are ignored), otherwise the index of the previously
49    *  created shader will be returned.
50    */
51   Index ProduceShader(NodeDefinition::Renderable& renderable);
52
53 private:
54   struct Impl;
55   const std::unique_ptr<Impl> mImpl;
56 };
57
58 } // namespace Dali::Scene3D::Loader
59
60 #endif //DALI_SCENE3D_LOADER_SHADER_DEFINITION_FACTORY_H_