Confirmed users
138
edits
No edit summary |
No edit summary |
||
Line 25: | Line 25: | ||
== Using Hardware Surfaces == | == Using Hardware Surfaces == | ||
In order to allow fast drawing to any hardware surfaces the plugins will receive a HANDLE that was acquired by the host from IDXGISurface::GetSharedHandle (http://msdn.microsoft.com/en-us/library/bb174562%28v=VS.85%29.aspx). This shared handle will represent a texture which is usable as a render target and is valid as a shader resource. The plugin can open this shared handle as a texture and then use it as a render target for any drawing operations. | |||
While the plugin has the surface set as current it is not allowed to bind it to the graphics pipeline or update it in any way. | |||
The plugin is allowed to create multiple surfaces and make them current in an alternating way, making it possible to for example double or triple buffer. | |||
== Surface usage API == | |||
The following new variable types are added: | |||
NPNVCreateSurface (NPNVariable = 557) | |||
NPPVDestroySurface (NPNVariable = 558) | |||
NPPVCurrentSurface (NPNVariable = 559) | |||
typedef enum { | |||
NPSurfaceTypeSharedHandle = 1 | |||
} NPSurfaceType; | |||
typedef struct _NPAsyncSurface | |||
{ | |||
NPSurfaceType type; | |||
uint32_t version; | |||
struct { | |||
void *handle; | |||
} | |||
} | |||
The NPN_GetValueProcPtr is called with |