From 35cc323ee4aa99ca0e34ec47a50631e080f6a338 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 18 Mar 2015 21:26:34 +0000 Subject: [PATCH] Add skeleton qrenderdoc (just a qt template) & include in linux build * Building qrenderdoc on windows will be supported just because that's likely where I will be developing it mostly, but for the foreseeable future it won't be built by default. If it ever gets good enough to replace the .NET UI, then we can look at it again. --- .gitignore | 1 + Makefile | 4 +- qrenderdoc/main.cpp | 15 ++++++++ qrenderdoc/mainwindow.cpp | 14 +++++++ qrenderdoc/mainwindow.h | 22 +++++++++++ qrenderdoc/mainwindow.ui | 24 ++++++++++++ qrenderdoc/qrenderdoc.pro | 51 ++++++++++++++++++++++++++ renderdoc/os/win32/sys_win32_hooks.cpp | 4 ++ renderdoc/os/win32/win32_libentry.cpp | 1 + 9 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 qrenderdoc/main.cpp create mode 100644 qrenderdoc/mainwindow.cpp create mode 100644 qrenderdoc/mainwindow.h create mode 100644 qrenderdoc/mainwindow.ui create mode 100644 qrenderdoc/qrenderdoc.pro diff --git a/.gitignore b/.gitignore index b84d75ed4..1c7162c48 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ Release32/ Release64/ dist/ Resources/*.png +qrenderdoc/Makefile *.exe *.aps *.ilk diff --git a/Makefile b/Makefile index 961a59307..e4458bfe6 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,13 @@ .PHONY: all all: + mkdir -p bin/ cd renderdoc && make librenderdoc.so cd renderdoccmd && make bin/renderdoccmd - mkdir -p bin/ + cd qrenderdoc && qmake "CONFIG+=debug" && make cp renderdoc/librenderdoc.so renderdoccmd/bin/renderdoccmd bin/ .PHONY: clean clean: cd renderdoc && make clean cd renderdoccmd && make clean + cd qrenderdoc && rm -rf .obj Makefile* diff --git a/qrenderdoc/main.cpp b/qrenderdoc/main.cpp new file mode 100644 index 000000000..2eb1b4851 --- /dev/null +++ b/qrenderdoc/main.cpp @@ -0,0 +1,15 @@ +#include "mainwindow.h" +#include + +#include "renderdoc_replay.h" + +int main(int argc, char *argv[]) +{ + RENDERDOC_LogText("QRenderDoc initialising."); + + QApplication a(argc, argv); + MainWindow w; + w.show(); + + return a.exec(); +} diff --git a/qrenderdoc/mainwindow.cpp b/qrenderdoc/mainwindow.cpp new file mode 100644 index 000000000..49d64fce7 --- /dev/null +++ b/qrenderdoc/mainwindow.cpp @@ -0,0 +1,14 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); +} + +MainWindow::~MainWindow() +{ + delete ui; +} diff --git a/qrenderdoc/mainwindow.h b/qrenderdoc/mainwindow.h new file mode 100644 index 000000000..a3948a917 --- /dev/null +++ b/qrenderdoc/mainwindow.h @@ -0,0 +1,22 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + +private: + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git a/qrenderdoc/mainwindow.ui b/qrenderdoc/mainwindow.ui new file mode 100644 index 000000000..6050363fa --- /dev/null +++ b/qrenderdoc/mainwindow.ui @@ -0,0 +1,24 @@ + + MainWindow + + + + 0 + 0 + 400 + 300 + + + + MainWindow + + + + + + + + + + + diff --git a/qrenderdoc/qrenderdoc.pro b/qrenderdoc/qrenderdoc.pro new file mode 100644 index 000000000..7d33da3e2 --- /dev/null +++ b/qrenderdoc/qrenderdoc.pro @@ -0,0 +1,51 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2015-03-18T20:10:50 +# +#------------------------------------------------- + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = qrenderdoc +TEMPLATE = app + +# Temp files into .obj +MOC_DIR = .obj +UI_DIR = .obj +OBJECTS_DIR = .obj + +# include path for core renderdoc API +INCLUDEPATH += $$_PRO_FILE_PWD_/../renderdoc/api/replay + +# Different output folders per platform +win32 { + + !contains(QMAKE_TARGET.arch, x86_64) { + Debug:DESTDIR = $$_PRO_FILE_PWD_/../Win32/Profile + Release:DESTDIR = $$_PRO_FILE_PWD_/../Win32/Release + + } else { + Debug:DESTDIR = $$_PRO_FILE_PWD_/../x64/Profile + Release:DESTDIR = $$_PRO_FILE_PWD_/../x64/Release + } + + # Link against the core library + LIBS += $$DESTDIR/renderdoc.lib + +} else { + + DESTDIR = $$_PRO_FILE_PWD_/../bin + + # Link against the core library + LIBS += -L$$_PRO_FILE_PWD_/../renderdoc -lrenderdoc + +} + +SOURCES += main.cpp\ + mainwindow.cpp + +HEADERS += mainwindow.h + +FORMS += mainwindow.ui diff --git a/renderdoc/os/win32/sys_win32_hooks.cpp b/renderdoc/os/win32/sys_win32_hooks.cpp index 8e6805311..cc416c1aa 100644 --- a/renderdoc/os/win32/sys_win32_hooks.cpp +++ b/renderdoc/os/win32/sys_win32_hooks.cpp @@ -140,6 +140,7 @@ class SysHook : LibraryHook if(app.find("renderdoccmd.exe") != string::npos || app.find("renderdocui.vshost.exe") != string::npos || + app.find("qrenderdoc.exe") != string::npos || app.find("renderdocui.exe") != string::npos) { inject = false; @@ -152,6 +153,7 @@ class SysHook : LibraryHook if(cmd.find("renderdoccmd.exe") != string::npos || cmd.find("renderdocui.vshost.exe") != string::npos || + cmd.find("qrenderdoc.exe") != string::npos || cmd.find("renderdocui.exe") != string::npos) { inject = false; @@ -227,6 +229,7 @@ class SysHook : LibraryHook if(app.find(L"renderdoccmd.exe") != wstring::npos || app.find(L"renderdocui.vshost.exe") != wstring::npos || + app.find(L"qrenderdoc.exe") != string::npos || app.find(L"renderdocui.exe") != wstring::npos) { inject = false; @@ -239,6 +242,7 @@ class SysHook : LibraryHook if(cmd.find(L"renderdoccmd.exe") != wstring::npos || cmd.find(L"renderdocui.vshost.exe") != wstring::npos || + cmd.find(L"qrenderdoc.exe") != wstring::npos || cmd.find(L"renderdocui.exe") != wstring::npos) { inject = false; diff --git a/renderdoc/os/win32/win32_libentry.cpp b/renderdoc/os/win32/win32_libentry.cpp index a9cbefebe..e749e22aa 100644 --- a/renderdoc/os/win32/win32_libentry.cpp +++ b/renderdoc/os/win32/win32_libentry.cpp @@ -53,6 +53,7 @@ static BOOL add_hooks() if(f.find(L"renderdoccmd.exe") != wstring::npos || f.find(L"renderdocui.vshost.exe") != wstring::npos || + f.find(L"qrenderdoc.exe") != wstring::npos || f.find(L"renderdocui.exe") != wstring::npos) { RDCDEBUG("Not creating hooks - in replay app");