| 1865 | } |
| 1866 | |
| 1867 | void Viewer::drawFull( bool dirtyScene ) |
| 1868 | { |
| 1869 | MR_TIMER; |
| 1870 | // unbind to clean main framebuffer |
| 1871 | if ( sceneTexture_ ) |
| 1872 | sceneTexture_->unbind(); |
| 1873 | // clean main framebuffer |
| 1874 | clearFramebuffers(); |
| 1875 | |
| 1876 | if ( menuPlugin_ ) |
| 1877 | menuPlugin_->startFrame(); |
| 1878 | |
| 1879 | if ( sceneTexture_ ) |
| 1880 | { |
| 1881 | sceneTexture_->bind( true ); |
| 1882 | // need to clean it in texture too |
| 1883 | clearFramebuffers(); |
| 1884 | } |
| 1885 | signals_->preDrawSignal(); |
| 1886 | // check dirty scene and need swap |
| 1887 | // important to check after preDrawSignal |
| 1888 | bool renderScene = forceRedrawFramesWithoutSwap_ <= 1; |
| 1889 | if ( sceneTexture_ ) |
| 1890 | renderScene = renderScene && dirtyScene; |
| 1891 | if ( renderScene ) |
| 1892 | drawScene( sceneTexture_ ? &sceneTexture_->getFramebuffer() : nullptr ); |
| 1893 | signals_->postDrawSignal(); |
| 1894 | if ( sceneTexture_ ) |
| 1895 | { |
| 1896 | Timer t( "sceneTexture" ); |
| 1897 | sceneTexture_->unbind(); |
| 1898 | if ( renderScene ) |
| 1899 | sceneTexture_->copyTexture(); // copy scene texture only if scene was rendered |
| 1900 | |
| 1901 | sceneTexture_->draw(); // always draw scene texture |
| 1902 | } |
| 1903 | if ( menuPlugin_ ) |
| 1904 | { |
| 1905 | drawUiRenderObjects(); |
| 1906 | menuPlugin_->finishFrame(); |
| 1907 | } |
| 1908 | } |
| 1909 | |
| 1910 | void Viewer::drawScene( FramebufferData* framebuffer ) |
| 1911 | { |
nothing calls this directly
no test coverage detected