mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Change overlay message for platforms without keyboard input
This commit is contained in:
@@ -434,6 +434,12 @@ bool RenderDoc::IsRemoteAccessConnected()
|
||||
return !RenderDoc::Inst().m_SingleClientName.empty();
|
||||
}
|
||||
|
||||
string RenderDoc::GetRemoteAccessUsername()
|
||||
{
|
||||
SCOPED_LOCK(RenderDoc::Inst().m_SingleClientLock);
|
||||
return RenderDoc::Inst().m_SingleClientName;
|
||||
}
|
||||
|
||||
void RenderDoc::Tick()
|
||||
{
|
||||
static bool prev_focus = false;
|
||||
|
||||
@@ -247,6 +247,7 @@ class RenderDoc
|
||||
|
||||
uint32_t GetRemoteAccessIdent() const { return m_RemoteIdent; }
|
||||
bool IsRemoteAccessConnected();
|
||||
string GetRemoteAccessUsername();
|
||||
|
||||
void Tick();
|
||||
|
||||
|
||||
@@ -3082,17 +3082,27 @@ HRESULT WrappedID3D11Device::Present(IDXGISwapChain *swap, UINT SyncInterval, UI
|
||||
vector<RENDERDOC_InputButton> keys = RenderDoc::Inst().GetCaptureKeys();
|
||||
|
||||
string overlayText = "D3D11. ";
|
||||
|
||||
for(size_t i=0; i < keys.size(); i++)
|
||||
|
||||
if(Keyboard::PlatformHasKeyInput())
|
||||
{
|
||||
if(i > 0)
|
||||
overlayText += ", ";
|
||||
for(size_t i=0; i < keys.size(); i++)
|
||||
{
|
||||
if(i > 0)
|
||||
overlayText += ", ";
|
||||
|
||||
overlayText += ToStr::Get(keys[i]);
|
||||
overlayText += ToStr::Get(keys[i]);
|
||||
}
|
||||
|
||||
if(!keys.empty())
|
||||
overlayText += " to capture.";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(RenderDoc::Inst().IsRemoteAccessConnected())
|
||||
overlayText += "Connected by " + RenderDoc::Inst().GetRemoteAccessUsername() + ".";
|
||||
else
|
||||
overlayText += "No remote access connection.";
|
||||
}
|
||||
|
||||
if(!keys.empty())
|
||||
overlayText += " to capture.";
|
||||
|
||||
if(overlay & eRENDERDOC_Overlay_FrameNumber)
|
||||
{
|
||||
|
||||
@@ -2142,18 +2142,28 @@ void WrappedOpenGL::SwapBuffers(void *windowHandle)
|
||||
|
||||
if(ctxdata.Modern())
|
||||
{
|
||||
overlayText += " ";
|
||||
|
||||
for(size_t i=0; i < keys.size(); i++)
|
||||
if(Keyboard::PlatformHasKeyInput())
|
||||
{
|
||||
if(i > 0)
|
||||
overlayText += ", ";
|
||||
overlayText += " ";
|
||||
|
||||
overlayText += ToStr::Get(keys[i]);
|
||||
for(size_t i=0; i < keys.size(); i++)
|
||||
{
|
||||
if(i > 0)
|
||||
overlayText += ", ";
|
||||
|
||||
overlayText += ToStr::Get(keys[i]);
|
||||
}
|
||||
|
||||
if(!keys.empty())
|
||||
overlayText += " to capture.";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(RenderDoc::Inst().IsRemoteAccessConnected())
|
||||
overlayText += "Connected by " + RenderDoc::Inst().GetRemoteAccessUsername() + ".";
|
||||
else
|
||||
overlayText += "No remote access connection.";
|
||||
}
|
||||
|
||||
if(!keys.empty())
|
||||
overlayText += " to capture.";
|
||||
}
|
||||
|
||||
if(overlay & eRENDERDOC_Overlay_FrameNumber)
|
||||
|
||||
@@ -570,16 +570,26 @@ VkResult WrappedVulkan::vkQueuePresentKHR(
|
||||
|
||||
string overlayText = "Vulkan. ";
|
||||
|
||||
for(size_t i=0; i < keys.size(); i++)
|
||||
if(Keyboard::PlatformHasKeyInput())
|
||||
{
|
||||
if(i > 0)
|
||||
overlayText += ", ";
|
||||
for(size_t i=0; i < keys.size(); i++)
|
||||
{
|
||||
if(i > 0)
|
||||
overlayText += ", ";
|
||||
|
||||
overlayText += ToStr::Get(keys[i]);
|
||||
overlayText += ToStr::Get(keys[i]);
|
||||
}
|
||||
|
||||
if(!keys.empty())
|
||||
overlayText += " to capture.";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(RenderDoc::Inst().IsRemoteAccessConnected())
|
||||
overlayText += "Connected by " + RenderDoc::Inst().GetRemoteAccessUsername() + ".";
|
||||
else
|
||||
overlayText += "No remote access connection.";
|
||||
}
|
||||
|
||||
if(!keys.empty())
|
||||
overlayText += " to capture.";
|
||||
|
||||
if(overlay & eRENDERDOC_Overlay_FrameNumber)
|
||||
{
|
||||
|
||||
@@ -283,6 +283,7 @@ namespace Keyboard
|
||||
void AddInputWindow(void *wnd);
|
||||
void RemoveInputWindow(void *wnd);
|
||||
bool GetKeyState(int key);
|
||||
bool PlatformHasKeyInput();
|
||||
};
|
||||
|
||||
// implemented per-platform
|
||||
|
||||
@@ -31,6 +31,11 @@ namespace Keyboard
|
||||
void Init()
|
||||
{
|
||||
}
|
||||
|
||||
bool PlatformHasKeyInput()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void CloneDisplay(Display *dpy) {}
|
||||
|
||||
|
||||
@@ -52,6 +52,11 @@ namespace Keyboard
|
||||
{
|
||||
}
|
||||
|
||||
bool PlatformHasKeyInput()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
xcb_connection_t *connection;
|
||||
xcb_key_symbols_t *symbols;
|
||||
|
||||
|
||||
@@ -73,6 +73,11 @@ namespace Keyboard
|
||||
void Init()
|
||||
{
|
||||
}
|
||||
|
||||
bool PlatformHasKeyInput()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
set<HWND> inputWindows;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user