You.i Engine
YiAssetShaderObject.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2017. All rights reserved.
2 #ifndef _YI_ASSET_SHADER_OBJECT_H_
3 #define _YI_ASSET_SHADER_OBJECT_H_
4 
10 #include "asset/YiAsset.h"
11 #include "utility/YiRtti.h"
12 #include "utility/YiString.h"
13 
19 {
20 public:
21 
25  enum SHADER_TYPE {
29  };
30 
31  enum CODE_TYPE {
34  };
35 
36 public:
38  CYIAssetShaderObject(const CYIString &path, PATH_TYPE ePathType = PATH_RELATIVE);
39 
40  virtual ~CYIAssetShaderObject();
41 
49  void GetCode(uint8_t **ppCode, uint32_t *pCodeSize) const;
50 
54  CODE_TYPE GetCodeType() const;
55 
59  SHADER_TYPE GetType() const;
60 
64  bool IsFromDisk() const;
65 
69  void SetFromDisk(bool bFromDisk);
70 
77  void SetCode(const uint8_t *pCode, uint32_t uCodeSize, CODE_TYPE eType);
78 
82  void SetType(SHADER_TYPE eType);
83 
84 protected:
85  virtual void OnUnload() override;
86 
87 private:
88  bool m_bFromDisk;
89  std::vector<uint8_t> m_code;
90  CODE_TYPE m_eCodeType;
91  SHADER_TYPE m_eType;
92 
94 };
95 
99 #endif // _YI_ASSET_SHADER_OBJECT_H_
virtual void OnUnload() override
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
Binary data that is compiled off-line prior to program execution. This data can come from disk or fro...
Definition: YiAssetShaderObject.h:32
CODE_TYPE
Definition: YiAssetShaderObject.h:31
PATH_TYPE
Definition: YiAsset.h:44
void SetCode(const uint8_t *pCode, uint32_t uCodeSize, CODE_TYPE eType)
String data that is compiled at run-time. This data can come from disk or from memory. See IsFromDisk.
Definition: YiAssetShaderObject.h:33
SHADER_TYPE
Definition: YiAssetShaderObject.h:25
CODE_TYPE GetCodeType() const
void SetFromDisk(bool bFromDisk)
SHADER_TYPE GetType() const
bool IsFromDisk() const
Describes code that will be executed per-vertex.
Definition: YiAssetShaderObject.h:26
Describes code that will be executed per-fragment.
Definition: YiAssetShaderObject.h:27
Base class for any asset. An asset provides functions for dynamically loading and unloading itself an...
Definition: YiAsset.h:33
virtual ~CYIAssetShaderObject()
Definition: YiAsset.h:47
This file contains the classes and macros used to implement RTTI in You.i Engine. ...
Describes code that will be executed as groups of threads.
Definition: YiAssetShaderObject.h:28
void GetCode(uint8_t **ppCode, uint32_t *pCodeSize) const
void SetType(SHADER_TYPE eType)
Shader object asset. Can either be loaded from a precompiled binary, or loaded as source and compiled...
Definition: YiAssetShaderObject.h:18