Closed SonicGDX closed 3 months ago
I've considered this before, and it could easily be time to change. If creating a project with a much older libGDX version (I think somewhere earlier in the 1.9.x version series), then ScreenUtils.clear() doesn't exist. That said, I don't think there's much reason to make such an old project; breaking changes have been few. Using ScreenUtils does seem much cleaner, so I think I'll update the templates.
This might be in other templates too, but I noticed in the classic template of liftoff that to clear the screen, this code is used:
gdx-setup on the other hand, uses
ScreenUtils.clear()
instead and I think that is a much better way to do it. It's easier to understand (abstracts away gl stuff), uses one less line of code and is consistent with the libgdx.com tutorial.I'm unaware of any advantages with using the gl methods directly as ScreenUtils.clear appears to call those anyway.