I am trying to write a class to create chains of fragment shaders using a frame buffer object to render into a texture with a frame shader, then render this texture to another texture using a fragment shader, etc. etc.
I am trying to deal with a memory leak right now when when resizing the window and deleting / redistributing the textures that I use, the textures are not deleted properly.
Here is the code snippet:
glGenTextures( 1, &texIds[0] );
glBindTexture( GL_TEXTURE_2D, texIds[0] );
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, screenX, screenY, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL );
glGenTextures( 1, &texIds[1] );
glBindTexture( GL_TEXTURE_2D, texIds[1] );
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, screenX, screenY, 0, GL_BGRA, GL_UNSIGNED_BYTE, NULL );
glDeleteTextures( 1, &texIds[0] );
glDeleteTextures( 1, &texIds[1] );
gDEBugger, : ": , . : 1", [0]. (, , , , , 2 , ).
texIds [1], texIds [0], , , . ?