mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01: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 {
|
||||
#if 0
|
||||
using namespace oglplus;
|
||||
QImage screenshot(_compositeFramebuffer->size.x, _compositeFramebuffer->size.y, QImage::Format_RGBA8888);
|
||||
auto size = _compositeFramebuffer->getSize();
|
||||
auto glBackend = const_cast<OpenGLDisplayPlugin&>(*this).getGLBackend();
|
||||
QImage screenshot(size.x, size.y, QImage::Format_ARGB32);
|
||||
withMainThreadContext([&] {
|
||||
Framebuffer::Bind(Framebuffer::Target::Read, _compositeFramebuffer->fbo);
|
||||
Context::ReadPixels(0, 0, _compositeFramebuffer->size.x, _compositeFramebuffer->size.y, enums::PixelDataFormat::RGBA, enums::PixelDataType::UnsignedByte, screenshot.bits());
|
||||
glBackend->downloadFramebuffer(_compositeFramebuffer, ivec4(uvec2(0), size), screenshot);
|
||||
});
|
||||
return screenshot.mirrored(false, true);
|
||||
#else
|
||||
return QImage();
|
||||
#endif
|
||||
}
|
||||
|
||||
glm::uvec2 OpenGLDisplayPlugin::getSurfacePixels() const {
|
||||
|
|
Loading…
Reference in a new issue