You.i Engine
YiPlatformView.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2017. All rights reserved.
2 #ifndef _YI_PLATFORM_VIEW_H_
3 #define _YI_PLATFORM_VIEW_H_
4 
5 #include "utility/YiTimer.h"
7 #include "view/YiSceneView.h"
8 
26 {
27 public:
32  {
36  };
37 
39  virtual ~CYIPlatformView();
40 
41  virtual bool Init() override;
42 
47  void SetViewProxy(CYIPlatformViewProxy *pViewProxy);
48 
52  void SetPresentationRule(PRESENTATION_RULE ePresentationRule);
53 
58 
59 protected:
60  virtual void UpdateBegin() override;
61 
66  virtual void UpdateEnd() override;
67 
69  std::unique_ptr<CYISceneNode> m_pOwnedPlatformSurfaceNode;
71 
72 private:
73  enum PRESENTATION_STATE
74  {
75  TEXTURE,
76  LIVE
77  };
78 
79  void PresentLive();
80  void PresentAsTexture();
81 
82  void SynchronizePlatformView();
83 
84  virtual void OnTextureUpdated() override;
85  virtual void OnProxyDestroyed() override;
86 
87  void OnViewStoppedMoving();
88 
89  PRESENTATION_RULE m_ePresentationRule;
90  PRESENTATION_STATE m_eCurrentPresentation;
91 
92  YI_RECT_REL m_cachedViewRectangle;
93  std::shared_ptr<CYIMaterial> m_pLiveViewCutoutMaterial;
94  CYITimer m_switchToLiveTimer;
95  CYITimer m_viewMovingTimer;
96 
98 };
99 
100 #endif
void SetViewProxy(CYIPlatformViewProxy *pViewProxy)
virtual ~CYIPlatformView()
void SetPresentationRule(PRESENTATION_RULE ePresentationRule)
PRESENTATION_RULE
These values represent the display modes of the platform view.
Definition: YiPlatformView.h:31
Definition: YiPredef.h:234
Definition: YiPlatformView.h:35
The base class for all view types. Views are containers of renderable elements that often define inte...
Definition: YiSceneView.h:47
CYIPlatformViewProxy * m_pViewProxy
Definition: YiPlatformView.h:68
#define YI_TYPE_BASES(...)
Definition: YiRtti.h:350
virtual void UpdateBegin() override
CYIPlatformViewProxy delegates handling of texture updates to its Delegate.
Definition: YiPlatformViewProxy.h:40
virtual bool Init() override
Definition: YiPlatformView.h:33
A low-precision timer driven by the update loop.
Definition: YiTimer.h:29
A scene node is the base type for all nodes which are used by the scene manager; it is an integral pa...
Definition: YiSceneNode.h:114
Definition: YiPlatformView.h:34
std::unique_ptr< CYISceneNode > m_pOwnedPlatformSurfaceNode
Definition: YiPlatformView.h:69
CYISceneNode * m_pPlatformSurfaceNode
Definition: YiPlatformView.h:70
PRESENTATION_RULE GetPresentationRule() const
A proxy representation for a platform-native view.
Definition: YiPlatformViewProxy.h:32
CYIPlatformView is a specialized view which combines the uses of an engine view (created through view...
Definition: YiPlatformView.h:25
virtual void UpdateEnd() override