wywala aplikacje

#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <SFML/Window.hpp>
#include <SFML/Network.hpp>
#include <SFML/Config.hpp>
#include <SFML/System.hpp>
#include <iostream>
#include <fstream>
#include <windows.h>
#include <vector>

sf::RenderWindow window( sf::VideoMode( 800, 600), "plum plum", sf::Style::Close );
sf::Event ev;
class Object
{
    public:
    sf::RectangleShape shape;
    float x = 0;
    float y = 0;
    float w = 50;
    float h = 50;
    sf::Color color;

    void draw() {
        shape.setPosition(sf::Vector2f(x, y));
        shape.setSize(sf::Vector2f(w, h));
        shape.setFillColor(color);
        window.draw(shape);
    }
};

int main()
{
    std::vector<Object> sciana;
    std::string linia;
    std::fstream plik;
    plik.open("mapa.txt", std::ios::in);
    while(!plik.eof())
    {
        getline(plik, linia);
        int x = std::stoi(linia.substr(0, linia.find_last_of(",")));
        int y = std::stoi(linia.substr(0, linia.find(",")));
        Object nowaSciana;
        nowaSciana.x = x;
        nowaSciana.y = y;
        sciana.push_back(nowaSciana);
        std::cout << linia << std::endl;
        std::cout << x << " " << y << std::endl;
    }

while(true)
{
    while(window.pollEvent(ev))
    {
        if(ev.type == ev.Closed)
        {
            return 0;
        }
    }
    window.clear(sf::Color(100, 0, 0));

    for (int i = 0; i < sciana.size(); i++) {
        sciana[i].draw();
    }

    window.display();
    }
}