You.i Engine
YiAssetFramebuffer.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2017. All rights reserved.
2 #ifndef _YI_ASSET_FRAMEBUFFER_H_
3 #define _YI_ASSET_FRAMEBUFFER_H_
4 
10 #include "asset/YiAssetHardware.h"
12 
22 {
23 public:
25  {
28  };
29 
31  virtual ~CYIAssetFramebuffer();
32 
36  void EnableAttachment(YI_ATTACHMENT eAttachment);
37 
41  void DisableAttachment(YI_ATTACHMENT eAttachment);
42 
46  bool HasAttachment(YI_ATTACHMENT eAttachment) const;
47 
51  void SetDimensions(uint32_t uWidth, uint32_t uHeight);
52 
56  void GetDimensions(uint32_t &rWidth, uint32_t &rHeight) const;
57 
61  std::shared_ptr<CYIAssetTextureFramebuffer> GetAttachedTexture(YI_ATTACHMENT eAttachment) const;
62 
63  virtual bool RequestInvalidate() override;
64  virtual bool RequestRestore() override;
65  virtual bool RequestHardwareLoad() override;
66  virtual bool RequestHardwareUnload() override;
67 
68  virtual std::pair<uint32_t, uint32_t> GetApproximateSize() const override;
69 
70 protected:
71  virtual std::shared_ptr<IYIGPUObject> CreateGPUObject() const override;
72 
73  static const uint32_t s_uAttachmentTypes = 2;
74  std::shared_ptr<CYIAssetTextureFramebuffer> m_pAttachedTextures[s_uAttachmentTypes]; //Corresponds to the attachments
76  uint32_t m_uWidth;
77  uint32_t m_uHeight;
78 
79 private:
81 };
82 
86 #endif // _YI_ASSET_FRAMEBUFFER_H_
bool m_bufferEnabled[s_uAttachmentTypes]
Definition: YiAssetFramebuffer.h:75
virtual std::shared_ptr< IYIGPUObject > CreateGPUObject() const override
void EnableAttachment(YI_ATTACHMENT eAttachment)
#define YI_TYPE_BASES(...)
Definition: YiRtti.h:350
Definition: YiAssetFramebuffer.h:27
virtual bool RequestInvalidate() override
std::shared_ptr< CYIAssetTextureFramebuffer > GetAttachedTexture(YI_ATTACHMENT eAttachment) const
YI_ATTACHMENT
Definition: YiAssetFramebuffer.h:24
bool HasAttachment(YI_ATTACHMENT eAttachment) const
static const uint32_t s_uAttachmentTypes
Definition: YiAssetFramebuffer.h:73
Definition: YiAssetFramebuffer.h:26
virtual bool RequestRestore() override
Hardware-mirrored asset. These assets contain IYIGPUObject counterparts.
Definition: YiAssetHardware.h:21
virtual bool RequestHardwareLoad() override
void SetDimensions(uint32_t uWidth, uint32_t uHeight)
uint32_t m_uWidth
Definition: YiAssetFramebuffer.h:76
virtual std::pair< uint32_t, uint32_t > GetApproximateSize() const override
virtual ~CYIAssetFramebuffer()
Wraps CYIAssetBuffers and their hardware counterparts, and an internally managed FBO.
Definition: YiAssetFramebuffer.h:21
uint32_t m_uHeight
Definition: YiAssetFramebuffer.h:77
std::shared_ptr< CYIAssetTextureFramebuffer > m_pAttachedTextures[s_uAttachmentTypes]
Definition: YiAssetFramebuffer.h:74
void GetDimensions(uint32_t &rWidth, uint32_t &rHeight) const
void DisableAttachment(YI_ATTACHMENT eAttachment)
virtual bool RequestHardwareUnload() override