Hello,
I am displaying lines, text and a series of images (BMP) in a Glut window. I have loaded another static BMP at the bottom of the page which I am able to click on some of its sections to fast forward, zoom etc. Loading this image really slows down the program. Is there a way to speed up the execution while Preferably i can have mouse events on it? for example not loading the image every time (in Display() ) or not rendering the bottom of window? or any other ideas?
I am using the following subroutine to load the BMP files:
[b]
bool loadbmp(UINT textureArray[], LPSTR strFileName, int ID)//(NEW) the name of our function
{
if(!strFileName) return false;//If no file name was given then return a false value
AUX_RGBImageRec *pBitMap = auxDIBImageLoad(strFileName); //Load the file into a new variable where we can then manipulate it into our texture array
if(pBitMap == NULL) exit(0);// If no data was loaded then exit the program.
glGenTextures(1, &textureArray[ID]);// Generate one texture into our texture array in the slot defined
glBindTexture(GL_TEXTURE_2D, textureArray[0]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0,3,pBitMap->sizeX, pBitMap->sizeY, 0,
GL_RGB, GL_UNSIGNED_BYTE, pBitMap->data);
if (pBitMap) //If pBitMap still has a value then we want to clear it.
{
if (pBitMap->data)
{
free(pBitMap->data);
}
free(pBitMap);
}
return true;
}
[/b]
Thanks in advance