Search code examples
javarendergame-engine

Why do you need to count the renders?


I'm following this tutorial for game development using Java and LibGDX.

Why, in all of the classes, is there a private variable called rendCount which increases every time the screen is rendered?

Does this have any use at all? I can't see any use of this variable in any of the code, besides where it's incremented and where it's initialised.


Solution

  • In the context of the tutorial, it appears the author is just using it for curiosity's sake to see how many times that particular screen was rendered. If you wish to remove it, you should be able to safely do so without very much change to the program.