Converted rendering code to use LibGDX