mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Restore screenshot
This commit is contained in:
parent
f65b636a09
commit
029721fd45
1 changed files with 4 additions and 8 deletions
|
@ -665,17 +665,13 @@ void OpenGLDisplayPlugin::withMainThreadContext(std::function<void()> f) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage OpenGLDisplayPlugin::getScreenshot() const {
|
QImage OpenGLDisplayPlugin::getScreenshot() const {
|
||||||
#if 0
|
auto size = _compositeFramebuffer->getSize();
|
||||||
using namespace oglplus;
|
auto glBackend = const_cast<OpenGLDisplayPlugin&>(*this).getGLBackend();
|
||||||
QImage screenshot(_compositeFramebuffer->size.x, _compositeFramebuffer->size.y, QImage::Format_RGBA8888);
|
QImage screenshot(size.x, size.y, QImage::Format_ARGB32);
|
||||||
withMainThreadContext([&] {
|
withMainThreadContext([&] {
|
||||||
Framebuffer::Bind(Framebuffer::Target::Read, _compositeFramebuffer->fbo);
|
glBackend->downloadFramebuffer(_compositeFramebuffer, ivec4(uvec2(0), size), screenshot);
|
||||||
Context::ReadPixels(0, 0, _compositeFramebuffer->size.x, _compositeFramebuffer->size.y, enums::PixelDataFormat::RGBA, enums::PixelDataType::UnsignedByte, screenshot.bits());
|
|
||||||
});
|
});
|
||||||
return screenshot.mirrored(false, true);
|
return screenshot.mirrored(false, true);
|
||||||
#else
|
|
||||||
return QImage();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::uvec2 OpenGLDisplayPlugin::getSurfacePixels() const {
|
glm::uvec2 OpenGLDisplayPlugin::getSurfacePixels() const {
|
||||||
|
|
Loading…
Reference in a new issue