Rendering a good chunk of 2D tiles at a time?

Heyo!

I’ve got quite a decent grasp of Java itself, but relatively minimal knowledge of OpenGL. I’ve been mucking around with a 2D side-scroller project with LWJGL 3 with (some) success.

Right now, I’m simply filling up my array of chunks with very basic tiles and drawing them in immediate mode, to get a result like this:

(the tiles are the white ones, black is background)

I have an map of all the chunks in the “world”, where each chunk contains a 32x32 array of tiles (integers for now). To draw them, I simply find which chunks can be seen at the camera’s position, and draw each one of them. Any source code that would be helpful has been dumped in this Gist (https://gist.github.com/Collin1971/87787976afa83d1382e1).

While this works fine at small resolutions, it very quickly becomes incredibly slow at higher resolutions where more chunks are drawn at a time (it even has difficulties maintaining 60FPS at 1024x600). I’ve looked into finding better ways to render these tiles, but choosing one and finding a decent tutorial that I can understand has been quite difficult, sadly. These chunk’s tiles are most likely going to be updated VERY often (as they can be placed or removed), and will have MANY various textures for different states.

I’ve looked at the following ways of rendering the tiles:

  • Immediate Mode - Hardly works, slow as hell.
  • Display lists - Old, deprecated, have to be recreated every time a change is made.
  • VBOs - The newer (and supposedly better) version of display lists. Can be edited on the fly(?). Couldn’t find much helpful documentation on drawing MULTIPLE tiles in one, my best luck was a few tutorials where people drew a single 3D cube in one. Doesn’t make much sense to me. (and they seem to require more modern specifications of GL.)

So, tl;dr: my question is, how do I render these tiles efficiently, without setting everyone’s CPU aflame?