예제 #1
0
/// Swap buffers (render frame)
void RendererOpenGL::SwapBuffers() {
    render_window->MakeCurrent();

    // EFB->XFB copy
    // TODO(bunnei): This is a hack and does not belong here. The copy should be triggered by some
    // register write.
    //
    // TODO(princesspeachum): (related to above^) this should only be called when there's new data, not every frame.
    // Currently this uploads data that shouldn't have changed.
    common::Rect framebuffer_size(0, 0, resolution_width, resolution_height);
    RenderXFB(framebuffer_size, framebuffer_size);

    // XFB->Window copy
    RenderFramebuffer();

    // Swap buffers
    render_window->PollEvents();
    render_window->SwapBuffers();
}
예제 #2
0
/// Swap buffers (render frame)
void RendererOpenGL::SwapBuffers() {
    m_render_window->MakeCurrent();

    // EFB->XFB copy
    // TODO(bunnei): This is a hack and does not belong here. The copy should be triggered by some 
    // register write We're also treating both framebuffers as a single one in OpenGL.
    Rect framebuffer_size(0, 0, m_resolution_width, m_resolution_height);
    RenderXFB(framebuffer_size, framebuffer_size);

    // XFB->Window copy
    RenderFramebuffer();

    // Swap buffers
    m_render_window->PollEvents();
    m_render_window->SwapBuffers();

    // Switch back to EFB and clear
    glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_fbo[kFramebuffer_EFB]);
}