mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-23 06:05:45 +00:00
Tidy up handling of windowing data, make it a bit more type safe
This commit is contained in:
@@ -1144,33 +1144,23 @@ int CaptureContext::ResourceNameCacheID()
|
||||
return m_CustomNameCachedID;
|
||||
}
|
||||
|
||||
void *CaptureContext::FillWindowingData(uintptr_t widget)
|
||||
WindowingData CaptureContext::CreateWindowingData(uintptr_t widget)
|
||||
{
|
||||
#if defined(WIN32)
|
||||
|
||||
return (void *)widget;
|
||||
return CreateWin32WindowingData((HWND)widget);
|
||||
|
||||
#elif defined(RENDERDOC_PLATFORM_LINUX)
|
||||
|
||||
static XCBWindowData xcb;
|
||||
static XlibWindowData xlib;
|
||||
|
||||
if(m_CurWinSystem == WindowingSystem::XCB)
|
||||
{
|
||||
xcb.connection = m_XCBConnection;
|
||||
xcb.window = (xcb_window_t)widget;
|
||||
return &xcb;
|
||||
}
|
||||
return CreateXCBWindowingData(m_XCBConnection, (xcb_window_t)widget);
|
||||
else
|
||||
{
|
||||
xlib.display = m_X11Display;
|
||||
xlib.window = (Drawable)widget;
|
||||
return &xlib;
|
||||
}
|
||||
return CreateXlibWindowingData(m_X11Display, (Drawable)widget);
|
||||
|
||||
#elif defined(RENDERDOC_PLATFORM_APPLE)
|
||||
|
||||
return (void *)widget;
|
||||
WindowingData ret = {WindowingSystem::Unknown};
|
||||
return ret;
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
}
|
||||
const SDFile &GetStructuredFile() override { return *m_StructuredFile; }
|
||||
WindowingSystem CurWindowingSystem() override { return m_CurWinSystem; }
|
||||
void *FillWindowingData(uintptr_t winId) override;
|
||||
WindowingData CreateWindowingData(uintptr_t winId) override;
|
||||
|
||||
const rdcarray<DebugMessage> &DebugMessages() override { return m_DebugMessages; }
|
||||
int UnreadMessageCount() override { return m_UnreadMessageCount; }
|
||||
|
||||
@@ -1296,16 +1296,11 @@ considered out of date
|
||||
DOCUMENT(R"(Create an opaque pointer suitable for passing to
|
||||
:meth:`~renderdoc.ReplayController.CreateOutput` or other functions that expect windowing data.
|
||||
|
||||
.. note::
|
||||
|
||||
This data only stays valid until the next call to FillWindowingData. You should pass it to the
|
||||
consuming function immediately.
|
||||
|
||||
:param int winId: The window ID as returned from ``QWidget.winId()``.
|
||||
:return: The windowing data.
|
||||
:rtype: opaque void * pointer.
|
||||
:rtype: ~renderdoc.WindowingData
|
||||
)");
|
||||
virtual void *FillWindowingData(uintptr_t winId) = 0;
|
||||
virtual WindowingData CreateWindowingData(uintptr_t winId) = 0;
|
||||
|
||||
DOCUMENT(R"(Retrieve the current list of debug messages. This includes messages from the capture
|
||||
as well as messages generated during replay and analysis.
|
||||
|
||||
Reference in New Issue
Block a user