mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 09:00:44 +00:00
Add a preview window ability to remote servers. Always on for android
* On android in particular this shows some sense of what's happening on the device and gives user feedback that it's not completely dead.
This commit is contained in:
@@ -57,31 +57,6 @@ void Daemonise()
|
||||
{
|
||||
}
|
||||
|
||||
void DisplayRendererPreview(IReplayController *renderer, TextureDisplay &displayCfg, uint32_t width,
|
||||
uint32_t height)
|
||||
{
|
||||
ANativeWindow *connectionScreenWindow = android_state->window;
|
||||
|
||||
pthread_mutex_lock(&m_DrawLock.lock);
|
||||
|
||||
IReplayOutput *out = renderer->CreateOutput(CreateAndroidWindowingData(connectionScreenWindow),
|
||||
ReplayOutputType::Texture);
|
||||
|
||||
out->SetTextureDisplay(displayCfg);
|
||||
|
||||
for(int i = 0; i < 100; i++)
|
||||
{
|
||||
renderer->SetFrameEvent(10000000, true);
|
||||
|
||||
ANDROID_LOG("Frame %i", i);
|
||||
out->Display();
|
||||
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&m_DrawLock.lock);
|
||||
}
|
||||
|
||||
void DisplayGenericSplash()
|
||||
{
|
||||
// if something else is drawing and holding the lock, then bail
|
||||
@@ -269,6 +244,57 @@ void main()
|
||||
pthread_mutex_unlock(&m_DrawLock.lock);
|
||||
}
|
||||
|
||||
WindowingData DisplayRemoteServerPreview(bool active, const rdcarray<WindowingSystem> &systems)
|
||||
{
|
||||
static bool wasActive = false;
|
||||
|
||||
// detect when the preview starts or stops
|
||||
if(wasActive != active)
|
||||
{
|
||||
wasActive = active;
|
||||
|
||||
// if we're opening it, aquire the draw lock, otherwise release it.
|
||||
if(active)
|
||||
{
|
||||
pthread_mutex_lock(&m_DrawLock.lock);
|
||||
}
|
||||
else
|
||||
{
|
||||
pthread_mutex_unlock(&m_DrawLock.lock);
|
||||
|
||||
// when we release it, re-draw the splash
|
||||
DisplayGenericSplash();
|
||||
}
|
||||
}
|
||||
|
||||
return CreateAndroidWindowingData(android_state->window);
|
||||
}
|
||||
|
||||
void DisplayRendererPreview(IReplayController *renderer, TextureDisplay &displayCfg, uint32_t width,
|
||||
uint32_t height)
|
||||
{
|
||||
ANativeWindow *connectionScreenWindow = android_state->window;
|
||||
|
||||
pthread_mutex_lock(&m_DrawLock.lock);
|
||||
|
||||
IReplayOutput *out = renderer->CreateOutput(CreateAndroidWindowingData(connectionScreenWindow),
|
||||
ReplayOutputType::Texture);
|
||||
|
||||
out->SetTextureDisplay(displayCfg);
|
||||
|
||||
for(int i = 0; i < 100; i++)
|
||||
{
|
||||
renderer->SetFrameEvent(10000000, true);
|
||||
|
||||
ANDROID_LOG("Frame %i", i);
|
||||
out->Display();
|
||||
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&m_DrawLock.lock);
|
||||
}
|
||||
|
||||
// Returns the renderdoccmd arguments passed via am start
|
||||
// Examples: am start ... -e renderdoccmd "remoteserver"
|
||||
// -e renderdoccmd "replay /sdcard/capture.rdc"
|
||||
|
||||
Reference in New Issue
Block a user