You can draw quads too, if all you want is just drawing tons of points there is no need for anything else. Don't actually use vertex array because it's dynamic, just use C array or std::array of vertices that is like 400 or 800 or other multiple of amount of vertices you have per point.
Super messy pseudocode, you can make offsets up to left and right constants and access .x and .y of vertices directly and set color to all black beforehand.
for each point in points:
if not point in screen skip
vertices[i++].position=point+offset_up_left;
vertices[i++].position=point+offset_down_left;
vertices[i++].position=point+offset_down_right;
vertices[i++].position=point+offset_up_right;
if i==vertices size draw_quads_and_set_i_to_0
but don't forget to draw last partially filled array too.
Edit: Like this: i should be zero before the loop and half_radius should be half of your desired radius like 1.5f if you want 3x3 squares for points.
for(auto it=points.begin();it!=points.end();++it)
{
vertices[i].position.x=it->x-half_radius;
vertices[i++].position.y=it->y-half_radius;
vertices[i].position.x=it->x-half_radius;
vertices[i++].position.y=it->y+half_radius;
vertices[i].position.x=it->x+half_radius;
vertices[i++].position.y=it->y+half_radius;
vertices[i].position.x=it->x+half_radius;
vertices[i++].position.y=it->y-half_radius;
if(i==vertices.size())
{
render_window.draw(vertices,i,sf::Quads);
i=0;
}
}
render_window.draw(vertices,i,sf::Quads);//last partially fileld batch
This should be much faster and much much less memory consuming than what you're doing now, because sf::Transform in shape is not checking for being ready, there are no hundreds of virtual calls and draw calls, there is no operating on pointers and the vertices object is a linear array so cache misses are minimal probably, there is just tiny bit of float subtraction and addition.