You.i Engine
YiAssetShaderProgram.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2017. All rights reserved.
2 #ifndef _YI_ASSET_SHADER_PROGRAM_H_
3 #define _YI_ASSET_SHADER_PROGRAM_H_
4 
11 #include "asset/YiAssetHardware.h"
12 #include "utility/YiRtti.h"
13 #include "utility/YiString.h"
15 #include <vector>
16 
17 
23 {
24 public:
26  CYIAssetShaderProgram(const CYIString &path, PATH_TYPE ePathType = PATH_RELATIVE);
27 
28  virtual ~CYIAssetShaderProgram();
29 
33  void AddShaderObject(const std::shared_ptr<CYIAssetShaderObject> &pShaderObjectAsset);
34 
38  const std::vector<std::shared_ptr<CYIAssetShaderObject>> &GetShaderObjects();
39 
43  void RemoveShaderObject(const std::shared_ptr<CYIAssetShaderObject> &pShaderObjectAsset);
44 
62  void SetAttributeLocation(CYIString name, uint32_t location);
63 
68 
72  const std::vector<std::pair<uint32_t, CYIString>> &GetAttributeLocations();
73 
74  bool Load();
75 
76 protected:
77  virtual std::shared_ptr<IYIGPUObject> CreateGPUObject() const override;
78  void UpdateApproximateSize();
79 
80 private:
81  std::vector<std::shared_ptr<CYIAssetShaderObject>> m_pShaderObjects;
82  std::vector<std::pair<uint32_t, CYIString>> m_AttributeLocations;
84 };
85 
89 #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:35
#define YI_TYPE_BASES(...)
Definition: YiRtti.h:350
virtual ~CYIAssetShaderProgram()
PATH_TYPE
Definition: YiAsset.h:44
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:21
Shader program asset. Contains a vector of CYIAssetShaderObject types.
Definition: YiAssetShaderProgram.h:22
Definition: YiAsset.h:47
This file contains the classes and macros used to implement RTTI in You.i Engine. ...
void SetAttributeLocation(CYIString name, uint32_t location)