mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-26 05:41:45 +00:00
Also clean up textures not created by SetPixels
This commit is contained in:
parent
9d5f8ec7c1
commit
e68da4331a
1 changed files with 15 additions and 4 deletions
|
@ -128,8 +128,11 @@ GLuint GLTexture::GetTexture(GLRenderDevice* device)
|
|||
{
|
||||
if (mTexture == 0)
|
||||
{
|
||||
Device = device;
|
||||
ItTexture = Device->mTextures.insert(Device->mTextures.end(), this);
|
||||
if (Device == nullptr)
|
||||
{
|
||||
Device = device;
|
||||
ItTexture = Device->mTextures.insert(Device->mTextures.end(), this);
|
||||
}
|
||||
|
||||
GLint oldActiveTex = GL_TEXTURE0;
|
||||
glGetIntegerv(GL_ACTIVE_TEXTURE, &oldActiveTex);
|
||||
|
@ -189,7 +192,11 @@ GLuint GLTexture::GetFramebuffer(GLRenderDevice* device, bool usedepthbuffer)
|
|||
{
|
||||
if (mDepthRenderbuffer == 0)
|
||||
{
|
||||
Device = device;
|
||||
if (Device == nullptr)
|
||||
{
|
||||
Device = device;
|
||||
ItTexture = Device->mTextures.insert(Device->mTextures.end(), this);
|
||||
}
|
||||
|
||||
glGenRenderbuffers(1, &mDepthRenderbuffer);
|
||||
glBindRenderbuffer(GL_RENDERBUFFER, mDepthRenderbuffer);
|
||||
|
@ -216,7 +223,11 @@ GLuint GLTexture::GetPBO(GLRenderDevice* device)
|
|||
{
|
||||
if (mPBO == 0)
|
||||
{
|
||||
Device = device;
|
||||
if (Device == nullptr)
|
||||
{
|
||||
Device = device;
|
||||
ItTexture = Device->mTextures.insert(Device->mTextures.end(), this);
|
||||
}
|
||||
|
||||
glGenBuffers(1, &mPBO);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, mPBO);
|
||||
|
|
Loading…
Reference in a new issue