You.i Engine
YiGPUObject.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. All rights reserved.
2 #ifndef _YI_GPU_OBJECT_H_
3 #define _YI_GPU_OBJECT_H_
4 
6 #include "framework/YiPredef.h"
7 #include "signal/YiSignal.h"
9 
19 {
20 public:
21  enum class Status
22  {
23  Invalid,
24  Unloaded,
25  LoadedFresh,
26  LoadedStale,
27  };
28 
29  inline IYIGPUObject();
30 
31  inline virtual ~IYIGPUObject();
32 
40  virtual void Load(const std::shared_ptr<CYIAssetHardware> &pHWAsset) = 0;
41 
45  virtual void Unload() = 0;
46 
50  inline Status GetStatus() const;
51 
55  virtual void Use() const = 0;
56 
60  virtual void Generate() = 0;
61 
65  virtual void Free() = 0;
66 
78  virtual void InvalidateHandle() = 0;
79 
80 protected:
82 };
83 
88 {
89 }
90 
92 {
93 }
94 
96 {
97  return m_status;
98 }
99 
100 #endif // _YI_GPU_OBJECT_H_
virtual void InvalidateHandle()=0
virtual void Load(const std::shared_ptr< CYIAssetHardware > &pHWAsset)=0
Handle is not valid, Generate() has not been successfully executed.
Status m_status
Definition: YiGPUObject.h:81
virtual void Generate()=0
Status GetStatus() const
Definition: YiGPUObject.h:95
Handle is valid, but no data has been loaded.
Status
Definition: YiGPUObject.h:21
The data that is loaded does not match the information in the last Load() call, but data is loaded in...
An interface for managing GPU-bound objects such as shaders and textures.
Definition: YiGPUObject.h:18
The data from the associated asset is successfully loaded.
virtual void Use() const =0
IYIGPUObject()
Definition: YiGPUObject.h:86
virtual void Free()=0
virtual ~IYIGPUObject()
Definition: YiGPUObject.h:91
virtual void Unload()=0