You know, it’s often occured to me that maybe I should do some kind of batching with my texture generation, but then I wonder, is there really anything gained by glGenTextures(10, TextureNames); over ten calls to glGenTextures(1, &TextureName); ten times?
Just makes life easier in loading images and uploading textures.
I believe that you don’t like to waste your time and write many glGenTextures while you can use from one call to this function. and you don’t like to add the lines of your source code.Isn’t it?
-Ehsan-
The functions behind both processes share a parameter, and that is a structure containing, among other things, the texture name as retrieved from glGenTextures. Normally in the UploadTexture() function there’s just a call:
glGenTextures(1, &UImage.TextureName);
Now I suppose instead of uploading them immediately I could load all images, add them to a queue of sorts, and then upload them all at once, and call glGenTextures((length of queue), (some temporary array)) and then assign the values manually, but ultimately, is there a point? One at a time is working just fine for now.