Skip to main content
GameDev.net gamedev.net
🔒 Locked

another texture problem

Started by enigmamwu03 Oct 27, 2002 at 11:43 AM 0 replies 200+ views
Original Post
enigmamwu03
enigmamwu03
When I call to load my textures I originaly use the mipmap building instead of the glTexImage2D, but when I use glTexImage2D it loads all of the textures but will only show me the first one loaded. this is the glTexImage2d part of my code: int LoadGLTextures() // Load Bitmaps And Convert To Textures { int Status=FALSE; // Status Indicator // Load The Bitmap, Check For Errors. if (LoadTGA(&texture[0], "cursortexture.tga") && LoadTGA(&texture[1], "player.tga")) { Status=TRUE; // Set The Status To TRUE for (int loop=0; loop<2; loop++) // Loop Through Both Textures { // Typical Texture Generation Using Data From The TGA ( CHANGE ) glGenTextures(1, &texture[loop].texID); // Create The Texture ( CHANGE ) glBindTexture(GL_TEXTURE_2D, texture[loop].texID); glTexImage2D(GL_TEXTURE_2D, 0, 3, texture[loop].width, texture[loop].height, 0, GL_RGB, GL_UNSIGNED_BYTE, texture[loop].imageData); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); if (texture[loop].imageData) // If Texture Image Exists ( CHANGE ) { free(texture[loop].imageData); // Free The Texture Image Memory ( CHANGE ) } } } return Status; // Return The Status }
TheSyan
TheSyan
Are u using the glBindText inside or outside the glBegin() block when drawing... try changing whichever, thats how I solved my similar texture problem...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.