mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 07:11:54 +00:00
- fixed OpenGL texture objects weren't deleted when a texture was destroyed.
This commit is contained in:
parent
f351df5c22
commit
017b3f9dc7
1 changed files with 6 additions and 2 deletions
|
@ -97,7 +97,10 @@ unsigned int FHardwareTexture::CreateTexture(unsigned char * buffer, int w, int
|
|||
}
|
||||
*/
|
||||
bool firstCall = glTexID == 0;
|
||||
if (firstCall) glGenTextures(1,&glTexID);
|
||||
if (firstCall)
|
||||
{
|
||||
glGenTextures(1, &glTexID);
|
||||
}
|
||||
|
||||
int textureBinding = UINT_MAX;
|
||||
if (texunit == -1) glGetIntegerv(GL_TEXTURE_BINDING_2D, &textureBinding);
|
||||
|
@ -211,7 +214,8 @@ uint8_t *FHardwareTexture::MapBuffer()
|
|||
//===========================================================================
|
||||
FHardwareTexture::~FHardwareTexture()
|
||||
{
|
||||
glDeleteBuffers(1, &glBufferID);
|
||||
if (glTexID != 0) glDeleteTextures(1, &glTexID);
|
||||
if (glBufferID != 0) glDeleteBuffers(1, &glBufferID);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue