#include <SFML/Graphics.hpp>
#include <string>
#include <iostream>
#include <vector>

using namespace sf; using namespace std;

class Obj {
public:
	string path;
	Sprite sprite;
	Texture texture;
	Obj(string Path) : path(Path)
	{
		if (!texture.loadFromFile(Path))
		{
			cout << "load texture fail" << endl;
		}
		sprite.setTexture(texture);
	}
};

vector<Obj> obj;

int countObjects = 0;

void createObject(string Path){
	countObjects++;
	obj.emplace_back(Path);
}


int main() {
	RenderWindow window(VideoMode(800, 600), L"name", Style::Default);
	createObject("res/obj1.png");
	createObject("res/obj2.png");


	Event event;
	while (window.isOpen()){
		while (window.pollEvent(event))	{
			if (event.type == Event::Closed ||
				(event.type == sf::Event::KeyPressed && event.key.code == Keyboard::Escape))
				window.close();
		}


		window.clear();
		window.draw(obj[0].sprite);
		window.display();
	}
	return 0;
}