You.i Engine
YiAssetShaderProgram.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. All rights reserved.
2 #ifndef _YI_ASSET_SHADER_PROGRAM_H_
3 #define _YI_ASSET_SHADER_PROGRAM_H_
4 
10 #include "asset/YiAssetHardware.h"
12 #include "utility/YiRtti.h"
13 #include "utility/YiString.h"
14 #include <vector>
15 
21 {
22 public:
25 
26  virtual ~CYIAssetShaderProgram();
27 
31  void AddShaderObject(const std::shared_ptr<CYIAssetShaderObject> &pShaderObjectAsset);
32 
36  const std::vector<std::shared_ptr<CYIAssetShaderObject>> &GetShaderObjects();
37 
41  void RemoveShaderObject(const std::shared_ptr<CYIAssetShaderObject> &pShaderObjectAsset);
42 
60  void SetAttributeLocation(CYIString name, uint32_t location);
61 
66 
70  const std::vector<std::pair<uint32_t, CYIString>> &GetAttributeLocations();
71 
72  bool Load();
73 
74 protected:
75  virtual std::shared_ptr<IYIGPUObject> CreateGPUObject() const override;
76  void UpdateApproximateSize();
77 
78 private:
79  std::vector<std::shared_ptr<CYIAssetShaderObject>> m_pShaderObjects;
80  std::vector<std::pair<uint32_t, CYIString>> m_AttributeLocations;
82 };
83 
86 #endif // _YI_ASSET_SHADER_PROGRAM_H_
const std::vector< std::shared_ptr< CYIAssetShaderObject > > & GetShaderObjects()
const std::vector< std::pair< uint32_t, CYIString > > & GetAttributeLocations()
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:36
PathType
Definition: YiAsset.h:42
virtual ~CYIAssetShaderProgram()
virtual std::shared_ptr< IYIGPUObject > CreateGPUObject() const override
void AddShaderObject(const std::shared_ptr< CYIAssetShaderObject > &pShaderObjectAsset)
void UnsetAttributeLocation(CYIString name)
void RemoveShaderObject(const std::shared_ptr< CYIAssetShaderObject > &pShaderObjectAsset)
Hardware-mirrored asset. These assets contain IYIGPUObject counterparts.
Definition: YiAssetHardware.h:20
#define YI_TYPE_BASES(CLASS, BASES...)
Definition: YiRtti.h:257
Shader program asset. Contains a vector of CYIAssetShaderObject types.
Definition: YiAssetShaderProgram.h:20
This file contains the classes and macros used to implement RTTI in You.i Engine. ...
void SetAttributeLocation(CYIString name, uint32_t location)