bakwc / libqtscreen Goto Github PK
View Code? Open in Web Editor NEWQt library for making directx and opengl screenshots.
License: MIT License
Qt library for making directx and opengl screenshots.
License: MIT License
What is LibQtScreen? LibQtScreen is a Qt 5 library for taking screenshots of fullscreen DirectX and OpenGL applications. It supports DirectX from 8 to 11, OpenGL, win32 and win64 applications. It can be compiled with MSVC and MinGW gcc. How does it works? LibQtScreen injects dll into fullscreen applications. Injected dll intercepts DirectX and OpenGL draw functions, copy rendered frame and returns it back. How can I use it? * copy libqtscreen to your project * add include(libqtscreen/libqtscreen.pri) to your .pro file * use NQtScreen::TScreenShotMaker to make screenshot (see screener example) * you also need helper32.exe, helper64.exe, libqtscreen32.dll and libqtscreen64.dll. You can build it yourself (injected_dll) or take pre-built dlls (build directory). Put them near your applications executable. Why do I need helper32.exe, helper64.exe, libqtscreen32.dll and libqtscreen64.dll? Dll is required to inject code into directx and opengl applications. You need one for 32bit and one for 64bit process. Helper64.exe is required to be able to inject 64bit dll into 64bit process from your 32bit compiled program, and helper32.exe is required to inject 32bit dll into 32bit process from your 64bit compiled program.
Отличная работа, очень интересные решения, много узнал нового.
Столкнулся с проблемой. Если screener скомпилирован в конфигурации “Release”, то Q_ASSERT не работает, и если не найдены helper и libqtscreen, то screener падает. Если не ошибаюсь, причина тому тут:
QList lines = data.split('\n');
offsets.DX8PresentOffset = lines[0].trimmed().toInt();
offsets.DX9PresentOffset = lines[1].trimmed().toInt();
offsets.DX9PresentExOffset = lines[2].trimmed().toInt();
offsets.DXGIPresentOffset = lines[3].trimmed().toInt();
Для libqtscreen не хватает файла лога, без которого долго не мог понять, почему не устанавливается соединение с сервером. Оказалось, что игра должна быть запущена с правами администратора, иначе QLocalSocket возвращает ошибку “Access denied ”.
Ещё заметил libqtscreen инжектится каждые 500 мс, в результате происходит утечка памяти в игровом приложении. Тут я не совсем разобрался в коде, возможно так и должно быть.
Кстати, если сделать скриншот и завершить приложение screener, затем заново его запустить скриншот уже не сделается, даже не появится сообщение "screenshot failed", причину пока не нашёл.
Сейчас dll-ка пытается заинъектится в приложение каждые 500мс, надо останавливать попытки, если не удаётся заинъектится.
В либу и в dll, чтоб упростить поиск проблем.
Потенциально может быть проблема с созданием скриншотов со включенным multisampling, подробности тут:
http://forum.sources.ru/index.php?showtopic=374481
"Кстати, если сделать скриншот и завершить приложение screener, затем заново его запустить скриншот уже не сделается, даже не появится сообщение "screenshot failed", причину пока не нашёл."
В данной строке выскакивает ошибка, описанная в топике.
Send(CMD_Info, QByteArray::fromStdString(out.str()));
QTCreator 3.50 на базе QT 5.5.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.