OpenGl 2D Tiling problem
I am trying to make a basic tile scrolling program but am having problems implementing the culling of tiles which are not draw on the screen.
At the moment i have smooth movement to the right, but it seems to be jerky going to the left. Also i lose my very first and very last tile because i have overlapped the tiles to draw some offscreen. IE if 12 tiles fit across the screen i have 14 drawn for my scrolling.
I am unsure off where to go from here. If anyone can suggest methods or something i could do different to cull my tiles that are offscreen i would greatly appreciate it!
I have included my source code to show you how i am doing it, plus an executable to demonstrate the jerkiness when i move the tiles left with the left arrow key.
Well, I remembered answering somebody's question about tile scrolling collision a while back and here is what I found. The code is specifically for someone who is using Allegro, but you should still be able to get the information you need out of it. Hope that helps you out.:)
Btw, I didn't look at your source, so I have no idea exactly what you're doing (I don't have enough time, sorry)