| 142 | //----------------------------------------------------------------------------- |
| 143 | |
| 144 | void FGLRenderer::CopyToBackbuffer(const IntRect *bounds, bool applyGamma) |
| 145 | { |
| 146 | screen->Draw2D(); // draw all pending 2D stuff before copying the buffer |
| 147 | twod->Clear(); |
| 148 | |
| 149 | GLPPRenderState renderstate(mBuffers); |
| 150 | hw_postprocess.customShaders.Run(&renderstate, "screen"); |
| 151 | |
| 152 | FGLDebug::PushGroup("CopyToBackbuffer"); |
| 153 | FGLPostProcessState savedState; |
| 154 | savedState.SaveTextureBindings(2); |
| 155 | mBuffers->BindOutputFB(); |
| 156 | |
| 157 | IntRect box; |
| 158 | if (bounds) |
| 159 | { |
| 160 | box = *bounds; |
| 161 | } |
| 162 | else |
| 163 | { |
| 164 | ClearBorders(); |
| 165 | box = screen->mOutputLetterbox; |
| 166 | } |
| 167 | |
| 168 | mBuffers->BindCurrentTexture(0); |
| 169 | DrawPresentTexture(box, applyGamma); |
| 170 | FGLDebug::PopGroup(); |
| 171 | } |
| 172 | |
| 173 | void FGLRenderer::DrawPresentTexture(const IntRect &box, bool applyGamma) |
| 174 | { |
no test coverage detected