mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
Fixed restoration of previously bound FBO
This commit is contained in:
parent
32412c7f75
commit
4400d0cfcc
2 changed files with 4 additions and 1 deletions
|
@ -122,6 +122,7 @@ void FGLRenderer::Initialize()
|
|||
else mLights = NULL;
|
||||
gl_RenderState.SetVertexBuffer(mVBO);
|
||||
mFBID = 0;
|
||||
mOldFBID = 0;
|
||||
|
||||
SetupLevel();
|
||||
mShaderManager = new FShaderManager;
|
||||
|
@ -237,6 +238,7 @@ void FGLRenderer::FlushTextures()
|
|||
bool FGLRenderer::StartOffscreen()
|
||||
{
|
||||
if (mFBID == 0) glGenFramebuffers(1, &mFBID);
|
||||
glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &mOldFBID);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, mFBID);
|
||||
return true;
|
||||
}
|
||||
|
@ -249,7 +251,7 @@ bool FGLRenderer::StartOffscreen()
|
|||
|
||||
void FGLRenderer::EndOffscreen()
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, mOldFBID);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
|
@ -71,6 +71,7 @@ public:
|
|||
int gl_spriteindex;
|
||||
unsigned int mFBID;
|
||||
unsigned int mVAOID;
|
||||
int mOldFBID;
|
||||
|
||||
FTexture *gllight;
|
||||
FTexture *glpart2;
|
||||
|
|
Loading…
Reference in a new issue