#include "SFML\Graphics.hpp"
#include <random>
#include <ctime>
int main() {
srand(time(NULL));
sf::RenderWindow TestingWindow(sf::VideoMode(100, 100), "Testing Window");
sf::Image img;
sf::Texture txt;
sf::Sprite spr;
int x = 1, y = 1, z;
while (y < 100){
while (x < 100) {
z = rand() % 2 + 1;
if (z == 1) {
img.setPixel(x, y, sf::Color::Black);
}
else {
img.setPixel(x, y, sf::Color::Black);
}
x++;
}
x = 1; y++;
}
txt.loadFromImage(img);
spr.setTexture(txt);
while (TestingWindow.isOpen())
{
sf::Event event;
while (TestingWindow.pollEvent(event))
{
if (event.type == sf::Event::Closed)
TestingWindow.close();
}
TestingWindow.clear();
TestingWindow.draw(spr);
TestingWindow.display();
}
}