I was wondering… what happens when you have more textures in memory than your videocard memory permits… ok I know that OpenGL then loads the texture whenever it is used from system mem… but where does that data then come from… what I really want to know is this: you have the function call
void glTexImage2D(
GLenum target,
GLint level,
GLint components,
GLsizei width,
GLsizei height,
GLint border,
GLenum format,
GLenum type,
const GLvoid *pixels
);
once you loaded the data with the “pixels” pointer… is it safe to discard the data in that pointer? Does OpenGL need that pointer (because it internally stored it) when it needs to reload the texture to texture memory on the video card… because for now I just discarded that memory… but I really do not know if that is entirely safe… I could test it… but I really do not know wheter it also uses AGP sharable system memory… since I have 640MB main mem and 64MB on my videocard… I really wouldn’t want to test it by creating something like 704+ MB for textures to test it… and I might even be wrong then…
So if you can give me an answer the the question: “is it safe to discard the pointer to the pixel memory you fed to the glTexImage2D function” I would be very gratefull…
(ps: I think it is safe because there is a gluBuild2DMipmaps function and you don’t have to call another function before releasing the OpenGL context stuff etc… and if you had to leave to pointer intact for OpenGL you surely would have to free the memory of that pointer before program termination… But what concerns me then… WHY DOES ALMOST EVERY PROGRAMMER OF WHOM I HAVE SEEN THE CODE LEAVE THAT POINTER INTACT TILL THE END OF THE PROGRAM???)
Thank you in advance