You.i Engine
YiAssetShaderObject.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. 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:
24  enum class ShaderType
25  {
26  VertexShader,
29  };
30 
31  enum class CodeType
32  {
33  PrecompiledBinary,
34  UncompiledSource
35  };
36 
37 public:
40 
41  virtual ~CYIAssetShaderObject();
42 
50  void GetCode(uint8_t **ppCode, size_t *pCodeSize) const;
51 
55  CodeType GetCodeType() const;
56 
60  ShaderType GetType() const;
61 
65  bool IsFromDisk() const;
66 
70  void SetFromDisk(bool fromDisk);
71 
78  void SetCode(const uint8_t *pCode, size_t codeSize, CodeType type);
79 
83  void SetType(ShaderType type);
84 
85 protected:
86  virtual void OnUnload() override;
87 
88 private:
89  bool m_fromDisk;
90  std::vector<uint8_t> m_code;
91  CodeType m_codeType;
92  ShaderType m_type;
93 
95 };
96 
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:36
bool IsFromDisk() const
PathType
Definition: YiAsset.h:42
void SetFromDisk(bool fromDisk)
void GetCode(uint8_t **ppCode, size_t *pCodeSize) const
CodeType GetCodeType() const
void SetCode(const uint8_t *pCode, size_t codeSize, CodeType type)
void SetType(ShaderType type)
CodeType
Definition: YiAssetShaderObject.h:31
Describes code that will be executed as groups of threads.
ShaderType
Definition: YiAssetShaderObject.h:24
Base class for any asset. An asset provides functions for dynamically loading and unloading itself an...
Definition: YiAsset.h:32
#define YI_TYPE_BASES(CLASS, BASES...)
Definition: YiRtti.h:257
virtual ~CYIAssetShaderObject()
ShaderType GetType() const
This file contains the classes and macros used to implement RTTI in You.i Engine. ...
Describes code that will be executed per-fragment.
Shader object asset. Can either be loaded from a precompiled binary, or loaded as source and compiled...
Definition: YiAssetShaderObject.h:18
Describes code that will be executed per-vertex.