Hi everyone,
I guess I have a problem with the texture memory management on my machine.
I make some textures using the code you can see attached at the end. On one machine, my Toshiba laptop, the application takes 14Mb, as it is supposed to be. On another desktop machine it takes 54Mb. It is like every single texture is in the main RAM.
Both machines are running XP, the laptop has a cheap shared-memory card (and it runs slow) and the desktop has a Nvidia GeForce FX5200 and it runs smooth at 5% cpu.
I need not having such a big memory consumption since I want to run many instances of the same program. Btw the textures could be shared between the different instances of the program ( is it possible?)
Thanks in advance for help.
Luca
glPixelStorei(GL_UNPACK_ALIGNMENT,4);
glGenTextures(1,&texName);
glBindTexture(GL_TEXTURE_2D, texName);
if(alphaExists)
{
glTexImage2D(GL_TEXTURE_2D, 0, 4, textureImage>width,textureImage->height, 0, GL_RGBA,GL_UNSIGNED_BYTE, textureImageAlpha->imageData);
}
else
glTexImage2D(GL_TEXTURE_2D, 0, 3, textureImage->width,textureImage->height, 0, GL_RGB,GL_UNSIGNED_BYTE, textureImage->imageData);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR);
if(alphaExists)
cvReleaseImage(&textureImageAlpha);
cvReleaseImage(&textureImage);