You.i Engine
YiPlatformViewProxy.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2017. All rights reserved.
2 #ifndef _YI_PLATFORM_VIEW_PROXY_H_
3 #define _YI_PLATFORM_VIEW_PROXY_H_
4 
5 #include "framework/YiPredef.h"
6 #include "signal/YiSignal.h"
7 
8 class CYIAssetTexture;
9 class CYIColor;
10 class CYIMaterial;
11 class CYIPlatformView;
13 
33 {
34 public:
40  class Delegate
41  {
42  public:
43  virtual ~Delegate() = default;
44 
48  virtual void OnTextureUpdated() = 0;
49 
53  virtual void OnProxyDestroyed() = 0;
54  };
55 
60  {
63  };
64 
70  static std::unique_ptr<CYIPlatformViewProxy> CreateIfSupported();
71 
72  virtual ~CYIPlatformViewProxy();
73 
79  virtual void OnPresentationModeChanged(PRESENTATION_MODE ePresentationMode) = 0;
80 
84  virtual void SetViewRectangle(const YI_RECT_REL &viewRectangle) = 0;
85 
89  virtual void SetVisibility(bool bVisible) = 0;
90 
94  virtual const std::shared_ptr<CYIMaterial> &GetViewMaterial() const = 0;
95 
101  virtual void SetPlatformViewHandle(const CYIPlatformViewHandle &handle) = 0;
102 
111  virtual const CYIPlatformViewHandle &GetPlatformViewHandle() const = 0;
112 
118  virtual void SetBackgroundColor(const CYIColor &color) = 0;
119 
125  void SetDelegate(Delegate *pDelegate);
126 
131 
132 protected:
136  void TextureUpdated();
137 
139 
140 private:
141  Delegate *m_pDelegate;
142 };
143 
149 #endif //_YI_PLATFORM_VIEW_PROXY_H_
Definition: YiPredef.h:234
virtual void SetVisibility(bool bVisible)=0
virtual void SetBackgroundColor(const CYIColor &color)=0
A texture asset representing an image which will be loaded into the GPU.
Definition: YiAssetTexture.h:23
CYIMaterial is a place holder for all the drawing parameters required by the renderer to draw a mesh/...
Definition: YiMaterial.h:27
virtual void OnPresentationModeChanged(PRESENTATION_MODE ePresentationMode)=0
CYIPlatformViewProxy delegates handling of texture updates to its Delegate.
Definition: YiPlatformViewProxy.h:40
Definition: YiPlatformViewProxy.h:62
virtual ~CYIPlatformViewProxy()
virtual void OnTextureUpdated()=0
Definition: YiPlatformViewProxy.h:61
virtual void OnProxyDestroyed()=0
CYISignal< const CYIPlatformViewHandle & > PlatformViewHandleSet
Definition: YiPlatformViewProxy.h:130
PRESENTATION_MODE
Definition: YiPlatformViewProxy.h:59
void SetDelegate(Delegate *pDelegate)
virtual const std::shared_ptr< CYIMaterial > & GetViewMaterial() const =0
A class used to represent a color value.
Definition: YiColor.h:31
A proxy representation for a platform-native view.
Definition: YiPlatformViewProxy.h:32
virtual void SetPlatformViewHandle(const CYIPlatformViewHandle &handle)=0
static std::unique_ptr< CYIPlatformViewProxy > CreateIfSupported()
The CYIPlatformViewHandle is a wrapper object that holds on to the native platform view...
Definition: YiPlatformViewHandle.h:17
CYIPlatformView is a specialized view which combines the uses of an engine view (created through view...
Definition: YiPlatformView.h:25
virtual void SetViewRectangle(const YI_RECT_REL &viewRectangle)=0
virtual const CYIPlatformViewHandle & GetPlatformViewHandle() const =0