- 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(); FHardwareTexture::UnbindAll();
gl_RenderState.ClearLastMaterial(); gl_RenderState.ClearLastMaterial();
mDebug->Update(); mDebug->Update();
mVertexData->Reset();
} }
//========================================================================== //==========================================================================

View file

@ -160,16 +160,11 @@ void FGLRenderer::EndOffscreen()
void FGLRenderer::BindToFrameBuffer(FTexture *tex) void FGLRenderer::BindToFrameBuffer(FTexture *tex)
{ {
auto pBaseLayer = tex->SystemTextures.GetHardwareTexture(0, false); auto BaseLayer = static_cast<FHardwareTexture*>(tex->GetHardwareTexture(0, 0));
auto BaseLayer = pBaseLayer ? (OpenGLRenderer::FHardwareTexture*)pBaseLayer : nullptr; // must create the hardware texture first
BaseLayer->BindOrCreate(tex, 0, 0, 0, 0);
if (BaseLayer == nullptr) FHardwareTexture::Unbind(0);
{ gl_RenderState.ClearLastMaterial();
// 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->BindToFrameBuffer(tex->GetWidth(), tex->GetHeight()); 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 Draw2D(&twodpsp, *screen->RenderState()); // draws the weapon sprites
}); });
screen->Update(); screen->Update();
screen->mVertexData->Reset();
// After finishing the frame, reset everything for the next frame. This needs to be done better. // After finishing the frame, reset everything for the next frame. This needs to be done better.
screen->BeginFrame(); screen->BeginFrame();
bool useSSAO = (gl_ssao != 0); bool useSSAO = (gl_ssao != 0);