Hi,
I’m currently working on a project where I have to render the same texture a lot of times in the same render cycle and I don’t know what is the best way to do it in terms of efficiency.
I don’t know if I should keep the texture in a variable in the Object that I have to render or if I should get it from the AssetManager every render cycle for every Object ?
Here is how my system works:
Textures:
The textures are loaded in a static AssetManager where I can access them by using an “id” that is then used to get the texture’s path from a Hashmap to finally get the texture from the AssetManager.
Rendering:
Every render cycle I call a render function in a Map object which goes trough every Tile objects in a 2 dimensional Array and calls the render function each time.
I’m a bit lost here and I would love if any of you can help me on this one.
If you need to see the code, it is available on Github.