add renderdoc api
This commit is contained in:
33
src/main.cpp
33
src/main.cpp
@@ -12,12 +12,15 @@
|
||||
|
||||
#include <shellscalingapi.h>
|
||||
#include <WbemCli.h>
|
||||
#include "wacom.h"
|
||||
#include <deque>
|
||||
#include <chrono>
|
||||
|
||||
#include "wacom.h"
|
||||
#include "abr.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include <renderdoc_app.h>
|
||||
|
||||
#include <iomanip>
|
||||
#include <ctime>
|
||||
#include <sstream>
|
||||
@@ -51,6 +54,31 @@ float timer_ink_touch = 0;
|
||||
float timer_ink_pen = 0;
|
||||
bool sandboxed = false;
|
||||
|
||||
RENDERDOC_API_1_4_0* rdoc_api = NULL;
|
||||
bool win32_renderdoc_init()
|
||||
{
|
||||
// At init, on windows
|
||||
if (HMODULE mod = GetModuleHandleA("renderdoc.dll"))
|
||||
{
|
||||
pRENDERDOC_GetAPI RENDERDOC_GetAPI =
|
||||
(pRENDERDOC_GetAPI)GetProcAddress(mod, "RENDERDOC_GetAPI");
|
||||
return RENDERDOC_GetAPI(eRENDERDOC_API_Version_1_1_2, (void**)&rdoc_api);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void win32_renderdoc_frame_start()
|
||||
{
|
||||
if (rdoc_api)
|
||||
rdoc_api->StartFrameCapture(NULL, NULL);
|
||||
}
|
||||
|
||||
void win32_renderdoc_frame_end()
|
||||
{
|
||||
if (rdoc_api)
|
||||
rdoc_api->EndFrameCapture(NULL, NULL);
|
||||
}
|
||||
|
||||
HRESULT(*GetDpiForMonitor_fn)(HMONITOR hmonitor, MONITOR_DPI_TYPE dpiType, UINT* dpiX, UINT* dpiY);
|
||||
HRESULT(*SetProcessDpiAwareness_fn)(PROCESS_DPI_AWARENESS value);
|
||||
void init_shcore_API()
|
||||
@@ -925,6 +953,9 @@ int main(int argc, char** argv)
|
||||
LOG("GL vendor: %s", glGetString(GL_VENDOR));
|
||||
LOG("GL renderer: %s", glGetString(GL_RENDERER));
|
||||
|
||||
if (!win32_renderdoc_init())
|
||||
LOG("Renderdoc not started");
|
||||
|
||||
swprintf_s(window_title, L"PanoPainter %s (%s)", g_version_number_w,
|
||||
str2wstr((char*)glGetString(GL_RENDERER)).c_str());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user