Professional Documents
Culture Documents
03.venus Plug-In Interface (VPI) Development Guide
03.venus Plug-In Interface (VPI) Development Guide
▪ What’s UI engine
– A software system which provides the mechanisms and interfaces
to applications to organize and display user interface (UI)
▪ Venus UI engine
– An UI engine which provide easy way to display Fancy UI
▪ Fancy UI
– 2D and 3D rendering
• 2D: draw text, image, linear transform, alpha blending…
• 3D: mesh, texture, lighting, shader rendering…
– Animation system
▪ Summary
– Native functionalities can be exported to MRE App by function
pointer or pure interface class (C++), means the interfaces are
dynamically linked with MRE code
– All interfaces exported to MRE App must be backward-compatible,
including its proto type and behaviors
Query Service
VFX VCP VRT
Venus Wrapper
Platform interfaces
Override onInit() to
do initialization
Set frame
properties
Almost same as
what you do in
native Venus
Override onPenInput()
to get pen event and
do action
Provide signal
Create an instance of
VpiAppLauncher with
the vpp file path
MRE
Native
MRE would like to
use native VFX,
but…
X VFX
MRE APP
A function pointer to
getMyService() of native,
Together, We make the difference. not static linked
http://msdn.microsoft.com/en-us/library/ms810016.aspx
Exporting native interface to MRE
▪ Folder structure (native and MRE)
▪ Native ▪ MRE
Have the same
vpi_xxx_interface.h files
Venus wrapper
(vpi_xxx.cpp/h)
Helper in MRE
(vm_xxx.cpp/h)
Fix template
Native
VfxTextFrame
Object
Fix template
Implement the
methods of IVpiTextFrame
Declare VMTextFrame
Smart pointer to
IVpiTextFrame *
MRE Code
Proxy Object IVpiFrame
(VpiFrameProxy) IVpiFrame* ptr = ObjFactory->createObject(
(Implement IVpiFrame) “VpiFrame”, delegator);
Native
VfxFrame
Together, We makeObject
the difference.
Export a class can be inherited (cont.)
▪ Step 1 : Design the interface to export
▪ Create vpi_frame_interface.h
▪ Declare IVpiFrame here
▪ Add the exported APIs into IVpiFrame
▪ Generally, the public functions of VfxFrame
▪ Declare IVpiFrameDelegator
▪ Add the exported delegator APIs into IVpiFrameDelegator
▪ Generally, the protected virtual functions of VfxFrame
All IVpiXxxDelegatorSuper in
Apply this macro the inheritance
Include vpi_xxx_delegator.h
Callback to MRE
Fix template
Declare VMFrame
Smart pointer to
IVpiFrame *
Fix template
Register signal