PDA

View Full Version : Problem with a slow program and textures



anton1212
04-19-2012, 05:07 PM
I have a big problem, my program, which is only a simple planar surface, it's suposed to rotate (by y edge for example) and when it's back face comes right in front of the camera, I want to see it with a different texture as the front face.
The only way I can do this is with these commands, but after 6 or 7 seconds it begins to become slower so finally I have to close my program. Any idea of how to increase the performance?



glCullFace(GL_FRONT);
generateTexturizedSurface(Texture1,x0,x1,x2,x3,nor mal); //x0,x1,x2,x3 have the points data (the 4 are arrays) and normal has the normal of the face (also an array)
glCullFace(GL_BACK);
generateTexturizedSurface(Texture2,x0,x1,x2,x3,nor mal);


Thanks


Edited: I have resolved the problem, mainly I had 2 problems, the most important was that I wasn't deleting the textures in each charge so I always charged the texture and more memory was used. The second problem was that I was using a 3mB bmp texture file so the render was too slow.