Ignition Rendering

API Reference

4.1.0
ShaderParam.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef IGNITION_RENDERING_SHADERPARAM_HH_
19 #define IGNITION_RENDERING_SHADERPARAM_HH_
20 
21 #include <cstdint>
22 #include <memory>
23 
24 #include "ignition/rendering/config.hh"
25 #include "ignition/rendering/Export.hh"
26 
27 namespace ignition
28 {
29  namespace rendering
30  {
31  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
32  //
34  class ShaderParamPrivate;
35 
37  class IGNITION_RENDERING_VISIBLE ShaderParam
38  {
39  public: enum ParamType : uint16_t
40  {
42  PARAM_NONE = 0,
43 
45  PARAM_FLOAT = 1,
46 
48  PARAM_INT = 2,
49  };
50 
52  public: ShaderParam();
53 
56  public: ShaderParam(const ShaderParam &_other);
57 
59  public: ~ShaderParam();
60 
63  public: ParamType Type() const;
64 
68  public: ShaderParam &operator=(const ShaderParam &_other);
69 
72  public: void operator=(const float _value);
73 
76  public: void operator=(const int _value);
77 
81  public: bool Value(float *_value) const;
82 
86  public: bool Value(int *_value) const;
87 
89  private: std::unique_ptr<ShaderParamPrivate> dataPtr;
90  };
91  }
92  }
93 }
94 
95 #endif
a variant type that holds params that can be passed to a shader
Definition: ShaderParam.hh:37
ParamType
Definition: ShaderParam.hh:39