A proxy representation for a platform-native view.
CYIPlatformViewProxy provides a platform agnostic proxy to an instance of a platform-specific view. The class may be used to position, resize, and grab a renderable copy of the platform view. When offered to a CYIPlatformView via CYIPlatformView::SetViewProxy, CYIPlatformViewProxy is used to synchronize the position of the native view with the CYIPlatformView. CYIPlatformView also uses the CYIPlatformViewProxy to grab a renderable representation of the native view for display on screen.
#include <platform/YiPlatformViewProxy.h>
Classes | |
| class | Delegate |
| CYIPlatformViewProxy delegates handling of texture updates to its Delegate. More... | |
Public Types | |
| enum | PRESENTATION_MODE { TEXTURE, LIVE } |
Public Member Functions | |
| virtual | ~CYIPlatformViewProxy () |
| virtual void | OnPresentationModeChanged (PRESENTATION_MODE ePresentationMode)=0 |
| virtual void | SetViewRectangle (const YI_RECT_REL &viewRectangle)=0 |
| virtual void | SetVisibility (bool bVisible)=0 |
| virtual const std::shared_ptr< CYIMaterial > & | GetViewMaterial () const =0 |
| virtual void | SetPlatformViewHandle (const CYIPlatformViewHandle &handle)=0 |
| virtual const CYIPlatformViewHandle & | GetPlatformViewHandle () const =0 |
| virtual void | SetBackgroundColor (const CYIColor &color)=0 |
| void | SetDelegate (Delegate *pDelegate) |
Static Public Member Functions | |
| static std::unique_ptr< CYIPlatformViewProxy > | CreateIfSupported () |
Public Attributes | |
| CYISignal< const CYIPlatformViewHandle & > | PlatformViewHandleSet |
Protected Member Functions | |
| void | TextureUpdated () |
| CYIPlatformViewProxy () | |
Represents how the platform view proxy is being represented.
| Enumerator | |
|---|---|
| TEXTURE |
The platform view proxy is being presented as a texture.
|
| LIVE |
The platform view proxy is being represented live. Normally, this view is layered beneath the You.i Engine rendering surface. In this mode, the view is being revealed. |
|
virtual |
|
protected |
|
static |
Returns a new instance of CYIPlatformViewProxy, or nullptr if unsupported on the platform. The caller obtains ownership of the returned instance.
|
pure virtual |
Returns the platform-specific handle, stored within a CYIPlatformViewHandle, that is associated with this CYIPlatformViewProxy.
|
pure virtual |
Returns a CYIMaterial that may be applied to a CYISceneNode, which has a CYIMesh, in order to display the contents of the platform native view. The returned material will be kept updated and may be cached.
|
pure virtual |
Notifies the platform view proxy that its presentation mode has been changed.
|
pure virtual |
Sets the CYIPlatformViewProxy's background color.
| void CYIPlatformViewProxy::SetDelegate | ( | Delegate * | pDelegate | ) |
Sets the CYIPlatformViewProxy's delegate to pDelegate. This delegate will be notified when the platform view proxy's texture data has been updated.
|
pure virtual |
Associates this CYIPlatformViewProxy with a native platform view, whose platform-specific handle, has been stored in a CYIPlatformViewHandle.
|
pure virtual |
Specifies the screen-space region into which the platform view should be placed. This placement is used to reveal the view when using live rendering, and also for the transmission of user events.
|
pure virtual |
Specifies visibility which can be applied to the underlying platform view if desired.
|
protected |
Notifies the associated Delegate that the texture data has been updated. Subclasses must call this function when the texture data is modified.
| CYISignal<const CYIPlatformViewHandle &> CYIPlatformViewProxy::PlatformViewHandleSet |
Emitted when the platform view handle has been set on the view proxy.