I think the thing you've skipped over might be the solution for you:
using a vertex array (or buffer) to display multiple rectangles with a single draw call.
That's what Selba Ward's
Pixel Display so maybe seeing that may help you. You may also find some things interesting in similar
Selba Ward drawables such as Tile Map and Console Screen.
It's worth noting that with the number of tiles you are using, it's not that different from one per pixel in full HD (1920x1080), presuming you're drawing all to the screen at once! I wouldn't call this "flat colored rectangles", I'd call them pixels!
In this case, you may actually want to use a vertex array with point primitive; that changes a single pixel.
Of course, if you're in 4k or something, this won't do.
Indeed, if you have a large map but only drawing a few at once, this is a very different story. You can draw only the visible tiles so the number is significantly easier. You can change the visible ones to match where in the map you are looking! See Selba Ward's
Tile Map for one example of how to do this (you could just use that tile map!
) Tile Map uses textures for each tile (but draws them all as a vertex array) so you can create any tilemap you like!
float screenheight = sf::VideoMode::getDesktopMode().width;
I don't think this is your intention.
screenwidth = sqrt((screenwidth / 2) * (screenwidth / 2) + (screenheight / 2) * (screenheight / 2));
I'm also interested in knowing what the intended effect of this is (it's changing the width to be the same as the length of the diagonal of a quarter of the screen).