Quote:Original post by _DarkWIng_~something() { if ( dynamic_one != NULL ) delete[] dynamic_one;}
No need to test for nullness. The C++ standard guarantees that deleting a null pointer is safe, so the test is redundant.
Enigma
Quote:Original post by _DarkWIng_~something() { if ( dynamic_one != NULL ) delete[] dynamic_one;}
GLubyte * imageData; //store the raw dataGLuint texID; //texture nametexID = loadAnyImageFormat(imageData, file_name); //returns the name and fills the image dataglGenTextures(1,texID);glBindTexture(GL_TEXTURE_2D,texID);gluBuild2DMipmaps(GL_TEXTURE_2D,GL_RGB8,width,height,type,GL_UNSIGNED_BYTE,imageData); //build the texture
Quote:Original post by Enigma
No need to test for nullness. The C++ standard guarantees that deleting a null pointer is safe, so the test is redundant.
Quote:Original post by Marco H
If I call "glDeleteTextures(1,&texID);", is the "imageData" automatically deleted or do I have to do this myself?