| 54 | } |
| 55 | |
| 56 | void QtRenderOGLContext::Resize(uint32_t w, uint32_t h) |
| 57 | { |
| 58 | CHECK(m_isContextAvailable, ()); |
| 59 | |
| 60 | // This function can't be called inside BeginRendering - EndRendering. |
| 61 | std::lock_guard lock(m_frameMutex); |
| 62 | |
| 63 | auto const nw = static_cast<int>(math::NextPowOf2(w)); |
| 64 | auto const nh = static_cast<int>(math::NextPowOf2(h)); |
| 65 | |
| 66 | if (nw <= m_width && nh <= m_height && m_backFrame != nullptr) |
| 67 | { |
| 68 | m_frameRect = QRectF(0.0, 0.0, w / static_cast<float>(m_width), h / static_cast<float>(m_height)); |
| 69 | return; |
| 70 | } |
| 71 | |
| 72 | m_width = nw; |
| 73 | m_height = nh; |
| 74 | m_frameRect = QRectF(0.0, 0.0, w / static_cast<float>(m_width), h / static_cast<float>(m_height)); |
| 75 | |
| 76 | m_backFrame = std::make_unique<QOpenGLFramebufferObject>(QSize(m_width, m_height), QOpenGLFramebufferObject::Depth); |
| 77 | m_frontFrame = std::make_unique<QOpenGLFramebufferObject>(QSize(m_width, m_height), QOpenGLFramebufferObject::Depth); |
| 78 | m_acquiredFrame = |
| 79 | std::make_unique<QOpenGLFramebufferObject>(QSize(m_width, m_height), QOpenGLFramebufferObject::Depth); |
| 80 | } |
| 81 | |
| 82 | bool QtRenderOGLContext::AcquireFrame() |
| 83 | { |
no test coverage detected