- fully synchronized the backend code with GZDoom.

The camera texture code couldn't be done earlier.
This commit is contained in:
Christoph Oelckers 2020-06-14 21:13:22 +02:00
parent 5effc95ae1
commit d4b32bf79f
3 changed files with 6 additions and 11 deletions

View file

@ -265,7 +265,6 @@ void OpenGLFrameBuffer::Swap()
FHardwareTexture::UnbindAll();
gl_RenderState.ClearLastMaterial();
mDebug->Update();
mVertexData->Reset();
}
//==========================================================================

View file

@ -160,16 +160,11 @@ void FGLRenderer::EndOffscreen()
void FGLRenderer::BindToFrameBuffer(FTexture *tex)
{
auto pBaseLayer = tex->SystemTextures.GetHardwareTexture(0, false);
auto BaseLayer = pBaseLayer ? (OpenGLRenderer::FHardwareTexture*)pBaseLayer : nullptr;
if (BaseLayer == nullptr)
{
auto BaseLayer = static_cast<FHardwareTexture*>(tex->GetHardwareTexture(0, 0));
// must create the hardware texture first
BaseLayer = new FHardwareTexture(4);
BaseLayer->CreateTexture(nullptr, tex->GetWidth(), tex->GetHeight(), 15, false, "Camtex");
tex->SystemTextures.AddHardwareTexture(0, false, BaseLayer);
}
BaseLayer->BindOrCreate(tex, 0, 0, 0, 0);
FHardwareTexture::Unbind(0);
gl_RenderState.ClearLastMaterial();
BaseLayer->BindToFrameBuffer(tex->GetWidth(), tex->GetHeight());
}

View file

@ -453,6 +453,7 @@ void videoShowFrame(int32_t w)
Draw2D(&twodpsp, *screen->RenderState()); // draws the weapon sprites
});
screen->Update();
screen->mVertexData->Reset();
// After finishing the frame, reset everything for the next frame. This needs to be done better.
screen->BeginFrame();
bool useSSAO = (gl_ssao != 0);