- place weapon sprites in a separate render list.

They need to be drawn in a different pass than the 2D overlay HUD so the backend must have them separately.
This commit is contained in:
Christoph Oelckers 2019-12-30 19:29:32 +01:00
parent 7ea053bd90
commit ad24a1ce31
24 changed files with 204 additions and 163 deletions

View file

@ -64,6 +64,8 @@ void gl_PrintStartupLog();
extern bool vid_hdr_active;
void DrawFullscreenBlends();
namespace OpenGLRenderer
{
FGLRenderer *GLRenderer;
@ -405,7 +407,8 @@ void OpenGLFrameBuffer::Draw2D()
if (GLRenderer != nullptr)
{
GLRenderer->mBuffers->BindCurrentFB();
GLInterface.Draw2D(&twod);
::DrawFullscreenBlends();
GLInterface.Draw2D(&twodgen);
}
}
@ -416,3 +419,18 @@ void OpenGLFrameBuffer::PostProcessScene(int fixedcm, const std::function<void()
}
void videoShowFrame(int32_t w)
{
OpenGLRenderer::GLRenderer->mBuffers->BlitSceneToTexture(); // Copy the resulting scene to the current post process texture
screen->PostProcessScene(0, []() {
GLInterface.Draw2D(&twodpsp); // draws the weapon sprites
});
screen->Update();
// After finishing the frame, reset everything for the next frame. This needs to be done better.
screen->BeginFrame();
OpenGLRenderer::GLRenderer->mBuffers->BindSceneFB(false);
twodpsp.Clear();
twodgen.Clear();
}