mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-29 15:11:56 +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
|
@ -127,9 +127,12 @@ void GLTexture::Invalidate()
|
||||||
GLuint GLTexture::GetTexture(GLRenderDevice* device)
|
GLuint GLTexture::GetTexture(GLRenderDevice* device)
|
||||||
{
|
{
|
||||||
if (mTexture == 0)
|
if (mTexture == 0)
|
||||||
|
{
|
||||||
|
if (Device == nullptr)
|
||||||
{
|
{
|
||||||
Device = device;
|
Device = device;
|
||||||
ItTexture = Device->mTextures.insert(Device->mTextures.end(), this);
|
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);
|
||||||
|
@ -188,8 +191,12 @@ GLuint GLTexture::GetFramebuffer(GLRenderDevice* device, bool usedepthbuffer)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (mDepthRenderbuffer == 0)
|
if (mDepthRenderbuffer == 0)
|
||||||
|
{
|
||||||
|
if (Device == nullptr)
|
||||||
{
|
{
|
||||||
Device = device;
|
Device = device;
|
||||||
|
ItTexture = Device->mTextures.insert(Device->mTextures.end(), this);
|
||||||
|
}
|
||||||
|
|
||||||
glGenRenderbuffers(1, &mDepthRenderbuffer);
|
glGenRenderbuffers(1, &mDepthRenderbuffer);
|
||||||
glBindRenderbuffer(GL_RENDERBUFFER, mDepthRenderbuffer);
|
glBindRenderbuffer(GL_RENDERBUFFER, mDepthRenderbuffer);
|
||||||
|
@ -215,8 +222,12 @@ GLuint GLTexture::GetFramebuffer(GLRenderDevice* device, bool usedepthbuffer)
|
||||||
GLuint GLTexture::GetPBO(GLRenderDevice* device)
|
GLuint GLTexture::GetPBO(GLRenderDevice* device)
|
||||||
{
|
{
|
||||||
if (mPBO == 0)
|
if (mPBO == 0)
|
||||||
|
{
|
||||||
|
if (Device == nullptr)
|
||||||
{
|
{
|
||||||
Device = device;
|
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