mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
Add X11 support for rendering to Qt windows via native handle
This commit is contained in:
@@ -3,6 +3,12 @@
|
||||
|
||||
#include "renderdoc_replay.h"
|
||||
|
||||
#if defined(__linux__)
|
||||
#include <QX11Info>
|
||||
#include <X11/Xlib.h>
|
||||
#include <GL/glx.h>
|
||||
#endif
|
||||
|
||||
extern ReplayRenderer *renderer;
|
||||
ReplayOutput *out = NULL;
|
||||
TextureDisplay d;
|
||||
@@ -43,9 +49,19 @@ TextureViewer::TextureViewer(QWidget *parent) :
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(WIN32)
|
||||
HWND wnd = (HWND)ui->framerender->winId();
|
||||
|
||||
out = ReplayRenderer_CreateOutput(renderer, wnd);
|
||||
#elif defined(__linux__)
|
||||
Display *display = QX11Info::display();
|
||||
GLXDrawable drawable = (GLXDrawable)ui->framerender->winId();
|
||||
|
||||
void *displayAndDrawable[2] = { (void *)display, (void *)drawable };
|
||||
|
||||
out = ReplayRenderer_CreateOutput(renderer, (void *)displayAndDrawable);
|
||||
#else
|
||||
#error "Unknown platform"
|
||||
#endif
|
||||
|
||||
OutputConfig c = { eOutputType_TexDisplay };
|
||||
|
||||
|
||||
@@ -45,6 +45,8 @@ win32 {
|
||||
LIBS += -L$$_PRO_FILE_PWD_/../renderdoc -lrenderdoc
|
||||
QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN\''
|
||||
|
||||
QT += x11extras
|
||||
|
||||
}
|
||||
|
||||
SOURCES += main.cpp\
|
||||
|
||||
Reference in New Issue
Block a user