mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-29 23:22:32 +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)
|
if (mTexture == 0)
|
||||||
{
|
{
|
||||||
Device = device;
|
if (Device == nullptr)
|
||||||
ItTexture = Device->mTextures.insert(Device->mTextures.end(), this);
|
{
|
||||||
|
Device = device;
|
||||||
|
ItTexture = Device->mTextures.insert(Device->mTextures.end(), this);
|
||||||
|
}
|
||||||
|
|
||||||
GLint oldActiveTex = GL_TEXTURE0;
|
GLint oldActiveTex = GL_TEXTURE0;
|
||||||
glGetIntegerv(GL_ACTIVE_TEXTURE, &oldActiveTex);
|
glGetIntegerv(GL_ACTIVE_TEXTURE, &oldActiveTex);
|
||||||
|
@ -189,7 +192,11 @@ GLuint GLTexture::GetFramebuffer(GLRenderDevice* device, bool usedepthbuffer)
|
||||||
{
|
{
|
||||||
if (mDepthRenderbuffer == 0)
|
if (mDepthRenderbuffer == 0)
|
||||||
{
|
{
|
||||||
Device = device;
|
if (Device == nullptr)
|
||||||
|
{
|
||||||
|
Device = device;
|
||||||
|
ItTexture = Device->mTextures.insert(Device->mTextures.end(), this);
|
||||||
|
}
|
||||||
|
|
||||||
glGenRenderbuffers(1, &mDepthRenderbuffer);
|
glGenRenderbuffers(1, &mDepthRenderbuffer);
|
||||||
glBindRenderbuffer(GL_RENDERBUFFER, mDepthRenderbuffer);
|
glBindRenderbuffer(GL_RENDERBUFFER, mDepthRenderbuffer);
|
||||||
|
@ -216,7 +223,11 @@ GLuint GLTexture::GetPBO(GLRenderDevice* device)
|
||||||
{
|
{
|
||||||
if (mPBO == 0)
|
if (mPBO == 0)
|
||||||
{
|
{
|
||||||
Device = device;
|
if (Device == nullptr)
|
||||||
|
{
|
||||||
|
Device = device;
|
||||||
|
ItTexture = Device->mTextures.insert(Device->mTextures.end(), this);
|
||||||
|
}
|
||||||
|
|
||||||
glGenBuffers(1, &mPBO);
|
glGenBuffers(1, &mPBO);
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, mPBO);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, mPBO);
|
||||||
|
|
Loading…
Reference in a new issue