Custom Display Host (XSISDK)
|Table of contents|
Custom Display plug-ins allow you to add your own custom view into XSI, where the user interface is implemented using C/C++. This API type is for advanced programmers who know how to write their own user interface, using APIs such as DirectX, OpenGL, Win32 or Motif.
A Custom Display plug-in gets very detailed event notification from XSI, for example information about parameter and geometry changes on objects. So this type of plug-in is also a powerful way to hook into XSI when creating a tool.
An example usage is in the context of Game development, where the game engine could be hosted inside a custom display window to provide fast feedback on how the content will look in the real game environment.
Please refer to the chapter "Custom Display Host" in the SDK Customization Guide. And there are several examples available as part of the XSI installation.
Be sure to read: Custom Display Host (http://softimage.wiki.avid.com/sdkdocs/cus_displayhost.htm)
Using DirectX in a Custom Display Host
DirectX resets the floating-point processor to single precision. XSI needs it in double precision. So, if you look at the DX9 example we ship with the SDK, you can see that we create the DX9 using the FPU_PRESERVE flag. Otherwise XSI will perform in a slow and unexpected manner.
So the recommended flags for the behavior flags when calling IDirect3D9::CreateDevice are:
D3DCREATE_FPU_PRESERVE | D3DCREATE_MIXED_VERTEXPROCESSING | D3DCREATE_MULTITHREADED
Getting the Top Level XSI Window
Windows: If you need to get the handle to the top level window of the current session of XSI use the new Desktop::GetApplicationWindowHandle().
XSI::Application app; HWND l_XSIWindow = (HWND)app.GetDesktop().GetApplicationWindowHandle();
Linux: The same API is available, but it returns a XWindow handle.
Direct Input in a Custom Display Host
There should be no problems using DirectInput to connect joysticks or other devices to a Custom Display Host.
Cross Platform CDH
Custom Display Hosts are normally written in the native UI API of each platform. However using a product like qt (http://www.trolltech.com/products/qt/windows.html) can reduce the amount of platform specific code to a bare minimum.