Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


lesson 10 : using 3 bitmaps

This topic is 5780 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello , I '' m new to GL programming and I read all tuts from 1 to 10, Now i''m trying to use the lesson10 codes and extands it for using 3 differents bitmaps for floor, walls and ceilling My idea was to store data for floor, walls etc in three differents files floor.txt walls.txt .. etc .. and create 3 sectors for each one for each text file I m filling the sector data and create three textures ***************** AUX_RGBImageRec *TextureImage[3]; memset(TextureImage,0,sizeof(void *)*3); if ((TextureImage[0]=LoadBMP("Data/floor.bmp")) && (TextureImage[1]=LoadBMP("Data/sky.bmp")) && (TextureImage[2]=LoadBMP("Data/murs.bmp")) ) { Status=TRUE; glGenTextures(3, &texture[0]); for (int loop=0;loop<3;loop++) { glBindTexture(GL_TEXTURE_2D, texture[loop]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); gluBuild2DMipmaps(GL_TEXTURE_2D, 3, TextureImage[loop]->sizeX, TextureImage[loop]->sizeY, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[loop]->data); } for ( loop=0;loop<3;loop++) { if (TextureImage[loop]) { if (TextureImage[loop]->data) { free(TextureImage[loop]->data); } free(TextureImage[loop]); } ******** I compiled the project and everything went ok but when i switch to full screen the render become very slow , instead I use 48K bitmaps Is it normal or i make a mistake or bad coding ??

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!