Major problem with tile maps and I'm not sure how to solve it.
My tile map uses a repeating grid of vertices. The only thing that changes is the starting texture in the first grid cell or the upper left corner. As you scroll right, the offset increases, down it increases by mapwidth, etc, etc.
Big problem. I'm using DrawPrimitive to draw 1 tile with a texture. This means I'm setting the texture for every single tile being rendered. Big performance drain there.
But is there any way around this?
Positioning each quad in world space would and drawing all quads that share a texture would not be a problem, but....determining which cells are visible might be. I could use a quad tree but I'm not so sure that would be any faster than my current method.