I'm trying to use Shape to draw random noise in 8x8 blocks but it's running at about 11FPS. This is my code:
//PIXEL_SIZE is defined to 8
size_t h = (engine::Window->GetHeight() / PIXEL_SIZE) + 1;
size_t w = (engine::Window->GetWidth() / PIXEL_SIZE) + 1;
Shape s;
for (size_t y = 0; y < h; y++) {
for (size_t x = 0; x < w; x++) {
s = Shape::Rectangle(FloatRect(float(x * PIXEL_SIZE), float(y * PIXEL_SIZE), float(PIXEL_SIZE), float(PIXEL_SIZE) ), Color(utils::Rand(5,10), utils::Rand(10,14), utils::Rand(200,255) ) );
rt.Draw(s);
}
}
rt.Display();
engine::Window->Draw( Sprite( rt.GetImage() ) );
What is a better way to draw noise like this?
In case it helps this is what it renders, albeit slowly:
If there is no way to do this with Shape, can someone give me an example of how to do this with a shader?