cleanup FBO on shutdown + make some stuff static
This commit is contained in:
1 parent
d82886c517
commit
6059753e73
3 files changed
+29
-29
No files matched your search
@@ -27,6 +27,8 @@
|
||||
#include "hw_md2.h"
|
||||
#include "hw_clip.h"
|
||||
|
||||
#include "r_opengl/r_opengl.h"
|
||||
|
||||
#include "../i_video.h" // for rendermode == render_glide
|
||||
#include "../v_video.h"
|
||||
#include "../p_local.h"
|
||||
@@ -5850,6 +5852,7 @@ void HWR_Shutdown(void)
|
||||
HWR_FreeMipmapCache();
|
||||
HWR_FreeTextureCache();
|
||||
HWD.pfnFlushScreenTextures();
|
||||
GLFramebuffer_Disable();
|
||||
}
|
||||
|
||||
void HWR_RenderWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend, boolean fogwall, INT32 lightlevel, extracolormap_t *wallcolormap)
|
||||
|
||||
@@ -1009,32 +1009,7 @@ void SetStates(void)
|
||||
}
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
void GLFramebuffer_Generate(void)
|
||||
{
|
||||
if (!supportFBO)
|
||||
return;
|
||||
|
||||
// Generate the framebuffer
|
||||
if (FramebufferObject == 0)
|
||||
pglGenFramebuffers(1, &FramebufferObject);
|
||||
|
||||
if (pglCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE)
|
||||
GLFramebuffer_GenerateAttachments();
|
||||
}
|
||||
|
||||
static void GLFramebuffer_Delete(void)
|
||||
{
|
||||
if (!supportFBO)
|
||||
return;
|
||||
|
||||
if (FramebufferObject)
|
||||
pglDeleteFramebuffers(1, &FramebufferObject);
|
||||
|
||||
GLFramebuffer_DeleteAttachments();
|
||||
FramebufferObject = 0;
|
||||
}
|
||||
|
||||
void GLFramebuffer_GenerateAttachments(void)
|
||||
static void GLFramebuffer_GenerateAttachments(void)
|
||||
{
|
||||
if (!supportFBO)
|
||||
return;
|
||||
@@ -1094,6 +1069,31 @@ void GLFramebuffer_DeleteAttachments(void)
|
||||
RenderbufferObject = 0;
|
||||
}
|
||||
|
||||
static void GLFramebuffer_Generate(void)
|
||||
{
|
||||
if (!supportFBO)
|
||||
return;
|
||||
|
||||
// Generate the framebuffer
|
||||
if (FramebufferObject == 0)
|
||||
pglGenFramebuffers(1, &FramebufferObject);
|
||||
|
||||
if (pglCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE)
|
||||
GLFramebuffer_GenerateAttachments();
|
||||
}
|
||||
|
||||
static void GLFramebuffer_Delete(void)
|
||||
{
|
||||
if (!supportFBO)
|
||||
return;
|
||||
|
||||
if (FramebufferObject)
|
||||
pglDeleteFramebuffers(1, &FramebufferObject);
|
||||
|
||||
GLFramebuffer_DeleteAttachments();
|
||||
FramebufferObject = 0;
|
||||
}
|
||||
|
||||
inline void GLFramebuffer_Unbind(void)
|
||||
{
|
||||
if (!supportFBO)
|
||||
|
||||
@@ -105,9 +105,6 @@ static PFNglEnableClientState pglEnableClientState;
|
||||
#endif
|
||||
|
||||
#ifdef USE_FBO_OGL
|
||||
void GLFramebuffer_Generate(void);
|
||||
|
||||
void GLFramebuffer_GenerateAttachments(void);
|
||||
void GLFramebuffer_DeleteAttachments(void);
|
||||
|
||||
void GLFramebuffer_Unbind(void);
|
||||
|
||||
Reference in new issue
Block a user