If for example I create an array of pixels, like so:
int *getPixels()
{
int *pixels = new int[10];
pixels[0] = 1;
pixels[1] = 0;
pixels[1] = 1;
// etc...
}
glTexImage2D(..., getPixels());
Does glTexImage2D use that reference or copy the pixels into it's own memory?
If the answer is the former, then should I do the following?
int *p = getPixels();
glTexImage2D(..., p);
/* Just changed to delete[], because delete
* would only delete the first element! */
delete[] p;