I'm creating a Top-Down Racing Game in C++ using GLUT/OPENGL and SOIL first of all I just wanted some opinions on how the track should be done. I was thinking about using a tile-map and so far I've implemented one but it draws a polygon for each value in the tile-map then uses the assigned texture. This is obviously a really in efficient way of drawing the background.

So how to go about concatenating the appropriate texture's together into one PNG/GL-TEXTURE that way I can just draw one big polygon and use the texture created from the concatenation process.

Also what's the best way of going about collision detection when it comes to tile-maps?


You have a few thousand polygons on screen, so what? Do you experience performance issues on anything better than a 5 year old cheap laptop? Cause you shouldn't, and if you do it's not because you use a few thousand polygons.

  • 1
    \$\begingroup\$ 1. 5+ year old computers are common. 2. If the OP is targeting older computers, the optimisation he suggests is sensible, and one that I have made myself. One screen-size polygon is significantly faster than one-polygon-per-tile on graphics hardware of that era. \$\endgroup\$ Mar 7 '12 at 19:33
  • \$\begingroup\$ For the majority of computers unable to handle this scenario it wouldn't be the poly count that cause problems unless we are talking about some seriously tiny tiles. 5 years is just what I feel comfortable claiming without risking that some nitpicker find an obscure counter-example. As for supporting old hardware incompatibility between the library and old hardware/driver stacks is probably a way bigger issue. But if you seriously think this detour is a good idea write so in an answer and prepare to get downvoted. \$\endgroup\$ Mar 7 '12 at 21:08
  • \$\begingroup\$ It's just it would be more efficient in the long run. \$\endgroup\$ Mar 8 '12 at 11:33
  • \$\begingroup\$ @SyntheCypher Not really, the theoretical gain is negligible. You would however increase load time and use a lot more video memory. Depending on the amount, that extra memory requirement could be what breaks the game on some old computers. \$\endgroup\$ Mar 8 '12 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.