mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-31 05:40:44 +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;
|
else mLights = NULL;
|
||||||
gl_RenderState.SetVertexBuffer(mVBO);
|
gl_RenderState.SetVertexBuffer(mVBO);
|
||||||
mFBID = 0;
|
mFBID = 0;
|
||||||
|
mOldFBID = 0;
|
||||||
|
|
||||||
SetupLevel();
|
SetupLevel();
|
||||||
mShaderManager = new FShaderManager;
|
mShaderManager = new FShaderManager;
|
||||||
|
@ -237,6 +238,7 @@ void FGLRenderer::FlushTextures()
|
||||||
bool FGLRenderer::StartOffscreen()
|
bool FGLRenderer::StartOffscreen()
|
||||||
{
|
{
|
||||||
if (mFBID == 0) glGenFramebuffers(1, &mFBID);
|
if (mFBID == 0) glGenFramebuffers(1, &mFBID);
|
||||||
|
glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &mOldFBID);
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, mFBID);
|
glBindFramebuffer(GL_FRAMEBUFFER, mFBID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -249,7 +251,7 @@ bool FGLRenderer::StartOffscreen()
|
||||||
|
|
||||||
void FGLRenderer::EndOffscreen()
|
void FGLRenderer::EndOffscreen()
|
||||||
{
|
{
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
glBindFramebuffer(GL_FRAMEBUFFER, mOldFBID);
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
|
@ -71,6 +71,7 @@ public:
|
||||||
int gl_spriteindex;
|
int gl_spriteindex;
|
||||||
unsigned int mFBID;
|
unsigned int mFBID;
|
||||||
unsigned int mVAOID;
|
unsigned int mVAOID;
|
||||||
|
int mOldFBID;
|
||||||
|
|
||||||
FTexture *gllight;
|
FTexture *gllight;
|
||||||
FTexture *glpart2;
|
FTexture *glpart2;
|
||||||
|
|
Loading…
Reference in a new issue