mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 09:04:38 +00:00
Merge pull request #1504 from Lopuska/patch-16
ResourceLeakFix for OpenGL
This commit is contained in:
commit
74c189681c
4 changed files with 21 additions and 3 deletions
|
|
@ -143,6 +143,11 @@ public:
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~GLCircularVolatileBuffer()
|
||||||
|
{
|
||||||
|
glDeleteBuffers(1, &mBufferName);
|
||||||
|
}
|
||||||
|
|
||||||
void init()
|
void init()
|
||||||
{
|
{
|
||||||
glGenBuffers(1, &mBufferName);
|
glGenBuffers(1, &mBufferName);
|
||||||
|
|
@ -290,4 +295,4 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,10 @@ GFXGLTextureTarget::GFXGLTextureTarget() : mCopyFboSrc(0), mCopyFboDst(0)
|
||||||
|
|
||||||
GFXGLTextureTarget::~GFXGLTextureTarget()
|
GFXGLTextureTarget::~GFXGLTextureTarget()
|
||||||
{
|
{
|
||||||
GFXTextureManager::removeEventDelegate( this, &GFXGLTextureTarget::_onTextureEvent );
|
GFXTextureManager::removeEventDelegate(this, &GFXGLTextureTarget::_onTextureEvent);
|
||||||
|
|
||||||
|
glDeleteFramebuffers(1, &mCopyFboSrc);
|
||||||
|
glDeleteFramebuffers(1, &mCopyFboDst);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Point2I GFXGLTextureTarget::getSize()
|
const Point2I GFXGLTextureTarget::getSize()
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,14 @@ GFXGLWindowTarget::GFXGLWindowTarget(PlatformWindow *win, GFXDevice *d)
|
||||||
win->appEvent.notify(this, &GFXGLWindowTarget::_onAppSignal);
|
win->appEvent.notify(this, &GFXGLWindowTarget::_onAppSignal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GFXGLWindowTarget::~GFXGLWindowTarget()
|
||||||
|
{
|
||||||
|
if(glIsFramebuffer(mCopyFBO))
|
||||||
|
{
|
||||||
|
glDeleteFramebuffers(1, &mCopyFBO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GFXGLWindowTarget::resetMode()
|
void GFXGLWindowTarget::resetMode()
|
||||||
{
|
{
|
||||||
if(mWindow->getVideoMode().fullScreen != mWindow->isFullscreen())
|
if(mWindow->getVideoMode().fullScreen != mWindow->isFullscreen())
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,8 @@ class GFXGLWindowTarget : public GFXWindowTarget
|
||||||
public:
|
public:
|
||||||
|
|
||||||
GFXGLWindowTarget(PlatformWindow *win, GFXDevice *d);
|
GFXGLWindowTarget(PlatformWindow *win, GFXDevice *d);
|
||||||
|
~GFXGLWindowTarget();
|
||||||
|
|
||||||
const Point2I getSize()
|
const Point2I getSize()
|
||||||
{
|
{
|
||||||
return mWindow->getClientExtent();
|
return mWindow->getClientExtent();
|
||||||
|
|
@ -64,4 +66,4 @@ private:
|
||||||
void _WindowPresent();
|
void _WindowPresent();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue