1. Create a FBO of a certain width and
height in Game::Initialise()
2. Set the viewport and perspective
projection matrix based on the FBO size
3. Bind the FBO and render the scene a
first time
m_pFBO->Bind(); // Render to texture RenderScene(0); // pass 0 – don’t render TV screen4. Reset the viewport and perspective
projection matrix based on the window size
5. Go back to rendering to the default
framebuffer, and render the scene again.
glBindFramebuffer(GL_FRAMEBUFFER,
0); // Render to window RenderScene(1); // pass 1 – render scene including TV screen6. Bind the texture in the FBO and
render an object not present in first pass (e.g., TV screen)
m_pFBO->BindTexture(0); //
draw TV
screen using the framebuffer texture7. Swap buffers