Improve ability to run a replay output with no backing window

* This is useful for scripts where we want access to the contextual output
  operations like overlays, pixel picking, etc.
This commit is contained in:
baldurk
2018-10-04 16:53:39 +01:00
parent b7855d371f
commit d281e9674b
3 changed files with 55 additions and 2 deletions
+26
View File
@@ -311,6 +311,7 @@ DOCUMENT(R"(Specifies a windowing system to use for creating an output window.
.. data:: Unknown
No windowing data is passed and no native window is described.
See :func:`CreateHeadlessWindowingData`.
.. data:: Win32
@@ -411,6 +412,20 @@ DECLARE_REFLECTION_ENUM(WindowingData);
#endif
DOCUMENT(R"(Create a :class:`WindowingData` for no backing window, it will be headless.
:return: A :class:`WindowingData` corresponding to an 'empty' backing window.
:rtype: WindowingData
)");
inline const WindowingData CreateHeadlessWindowingData()
{
WindowingData ret = {};
ret.system = WindowingSystem::Unknown;
return ret;
}
DOCUMENT(R"(Create a :class:`WindowingData` for a Win32 ``HWND`` handle.
:param HWND window: The native ``HWND`` handle for this window.
@@ -603,6 +618,17 @@ outputs.
DOCUMENT("Sets the :class:`MeshDisplay` configuration for a mesh output.");
virtual void SetMeshDisplay(const MeshDisplay &o) = 0;
DOCUMENT(R"(Sets the dimensions of the output, useful only for headless outputs that don't have a
backing window which don't have any implicit dimensions. This allows configuring a virtual viewport
which is useful for operations like picking vertices that depends on the output dimensions.
.. note:: For outputs with backing windows, this will be ignored.
:param int width: The width to use.
:param int height: The height to use.
)");
virtual void SetDimensions(int32_t width, int32_t height) = 0;
DOCUMENT(
"Clear and release all thumbnails associated with this output. See :meth:`AddThumbnail`.");
virtual void ClearThumbnails() = 0;