RAMSES Documentation  27.0.130
Information for RAMSES users and developers
Effect.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // Copyright (C) 2014 BMW Car IT GmbH
3 // -------------------------------------------------------------------------
4 // This Source Code Form is subject to the terms of the Mozilla Public
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
6 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 // -------------------------------------------------------------------------
8 
9 #ifndef RAMSES_EFFECT_H
10 #define RAMSES_EFFECT_H
11 
16 
17 namespace ramses
18 {
19  class UniformInput;
20  class AttributeInput;
21 
25  class RAMSES_API Effect : public Resource
26  {
27  public:
28 
34  uint32_t getUniformInputCount() const;
35 
41  uint32_t getAttributeInputCount() const;
42 
51  status_t getUniformInput(uint32_t index, UniformInput& uniformInput) const;
52 
61  status_t getAttributeInput(uint32_t index, AttributeInput& attributeInput) const;
62 
71  status_t findUniformInput(const char* inputName, UniformInput& uniformInput) const;
72 
81  status_t findAttributeInput(const char* inputName, AttributeInput& attributeInput) const;
82 
91  status_t findUniformInput(EEffectUniformSemantic uniformSemantic, UniformInput& uniformInput) const;
92 
101  status_t findAttributeInput(EEffectAttributeSemantic attributeSemantic, AttributeInput& attributeInput) const;
102 
109  static bool hasGeometryShader(const Effect& effect);
110 
123  static status_t getGeometryShaderInputType(const Effect& effect, EDrawMode& expectedGeometryInputType);
124 
128  class EffectImpl& impl;
129 
130  protected:
134  friend class SceneImpl;
135 
141  explicit Effect(EffectImpl& pimpl);
142 
148  Effect(const Effect& other);
149 
156  Effect& operator=(const Effect& other);
157 
161  virtual ~Effect();
162  };
163 }
164 
165 #endif
#define RAMSES_API
Definition: APIExport.h:35
The AttributeInput is a description of an attribute effect input.
Definition: AttributeInput.h:22
An effect describes how an object will be rendered to the screen.
Definition: Effect.h:26
status_t findAttributeInput(EEffectAttributeSemantic attributeSemantic, AttributeInput &attributeInput) const
Finds attribute input that represents a semantic input (if existing).
Effect(EffectImpl &pimpl)
Constructor of Effect.
Effect & operator=(const Effect &other)
Assignment operator of Effect.
Effect(const Effect &other)
Copy constructor of Effect.
uint32_t getAttributeInputCount() const
Gets number of attribute inputs.
class EffectImpl & impl
Stores internal data for implementation specifics of Effect.
Definition: Effect.h:128
virtual ~Effect()
Destructor of the Effect.
static status_t getGeometryShaderInputType(const Effect &effect, EDrawMode &expectedGeometryInputType)
If the effect has a geometry shader attached to it (see hasGeometryShader) this method can be used to...
status_t findUniformInput(const char *inputName, UniformInput &uniformInput) const
Finds uniform input by input name.
status_t findUniformInput(EEffectUniformSemantic uniformSemantic, UniformInput &uniformInput) const
Finds uniform input that represents a semantic input (if existing).
status_t getUniformInput(uint32_t index, UniformInput &uniformInput) const
Gets uniform input at given index.
status_t getAttributeInput(uint32_t index, AttributeInput &attributeInput) const
Gets attribute input at given index.
uint32_t getUniformInputCount() const
Gets number of uniform inputs.
static bool hasGeometryShader(const Effect &effect)
Returns whether the effect has a geometry shader attached to it.
status_t findAttributeInput(const char *inputName, AttributeInput &attributeInput) const
Finds attribute input by input name.
The Resource is the base class of all resources, such as arrays and textures.
Definition: Resource.h:20
The UniformInput is a description of an uniform effect input.
Definition: UniformInput.h:22
The RAMSES namespace contains all client side objects and functions used to implement RAMSES applicat...
Definition: AnimatedProperty.h:15
uint32_t status_t
Status is a handle to the result of an API call.
Definition: RamsesFrameworkTypes.h:26
EEffectUniformSemantic
Effect uniform semantic type.
Definition: EffectInputSemantic.h:18
EDrawMode
Definition: AppearanceEnums.h:175
EEffectAttributeSemantic
Effect attribute semantic type.
Definition: EffectInputSemantic.h:42