diff --git a/src/gl/renderer/gl_renderer.h b/src/gl/renderer/gl_renderer.h index 92ce242786..63168ff245 100644 --- a/src/gl/renderer/gl_renderer.h +++ b/src/gl/renderer/gl_renderer.h @@ -167,6 +167,8 @@ public: unsigned char *GetTextureBuffer(FTexture *tex, int &w, int &h); void SetupLevel(); + void RenderView(player_t* player); + void RenderScreenQuad(); void PostProcessScene(int fixedcm); void AmbientOccludeScene(); diff --git a/src/gl/scene/gl_scene.cpp b/src/gl/scene/gl_scene.cpp index 6538da9cb2..19c605a5c0 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -871,13 +871,12 @@ sector_t * GLSceneDrawer::RenderViewpoint (AActor * camera, GL_IRECT * bounds, f // //----------------------------------------------------------------------------- -void GLSceneDrawer::RenderView (player_t* player) +void FGLRenderer::RenderView (player_t* player) { - checkBenchActive(); - gl_RenderState.SetVertexBuffer(GLRenderer->mVBO); - GLRenderer->mVBO->Reset(); + gl_RenderState.SetVertexBuffer(mVBO); + mVBO->Reset(); // reset statistics counters ResetProfilingData(); @@ -889,7 +888,7 @@ void GLSceneDrawer::RenderView (player_t* player) P_FindParticleSubsectors (); - if (!gl.legacyMode) GLRenderer->mLights->Clear(); + if (!gl.legacyMode) mLights->Clear(); // NoInterpolateView should have no bearing on camera textures, but needs to be preserved for the main view below. bool saved_niv = NoInterpolateView; @@ -910,15 +909,16 @@ void GLSceneDrawer::RenderView (player_t* player) { fovratio = ratio; } + GLSceneDrawer drawer; - SetFixedColormap (player); + drawer.SetFixedColormap (player); // Check if there's some lights. If not some code can be skipped. TThinkerIterator it(STAT_DLIGHT); - GLRenderer->mLightCount = ((it.Next()) != NULL); + mLightCount = ((it.Next()) != NULL); - GLRenderer->mShadowMap.Update(); - sector_t * viewsector = RenderViewpoint(player->camera, NULL, r_viewpoint.FieldOfView.Degrees, ratio, fovratio, true, true); + mShadowMap.Update(); + sector_t * viewsector = drawer.RenderViewpoint(player->camera, NULL, r_viewpoint.FieldOfView.Degrees, ratio, fovratio, true, true); All.Unclock(); } @@ -1068,8 +1068,7 @@ void FGLInterface::WriteSavePic (player_t *player, FileWriter *file, int width, void FGLInterface::RenderView(player_t *player) { - GLSceneDrawer drawer; - drawer.RenderView(player); + GLRenderer->RenderView(player); } //===========================================================================