I’m wondering if I should be careful about not creating too many textures in an openGL program. (I’m doing some premature optimization here)
I’ve created an editor that lets users add images to a HUD. A lot of these will be small, independent images for a user interface. The most straight forward way to do this is to allocate a new texture for each image - however, I could end up with hundreds of tiny textures this way. I could also combine them all into a single image and use texture coordinates to map the right subregion of the image.
If I go the many images route, do I have to worry about exceeding some ‘maximum number of textures’ limit? Is this generally considered good practice? If I do combine everything into a single image, is there a way I could get texture effects like GL_CLAMP_TO_EDGE or GL_REPEAT even if I’m only reading from a small area in the middle of the texture?