#include <SFML\Window.hpp>
#include <SFML\Graphics.hpp>
int main() {
sf::RenderWindow mainwindow(sf::VideoMode(1920, 1080), "Mein Erstes Spiel", sf::Style::Default);
sf::Texture background;
background.loadFromFile("background.png");
sf::Sprite backgroundsprite;
backgroundsprite.setTexture(background);
// As long as Window is open
while (mainwindow.isOpen()) {
sf::Event event;
while (mainwindow.pollEvent(event)) {
if (event.type == sf::Event::Closed) {
// Hier kommt auch das speichern rein z.B.
mainwindow.close();
}
// clear window
mainwindow.clear();
// Draw here
mainwindow.draw(backgroundsprite);
// end the current frame
mainwindow.display();
}
}
return 0;
}
I followed the Tutorial but im getting the error messages
LNK2001 and
LNK1120
Im not finding helpful thread on the internet ...
Please help me
[EDIT]
The error is where im trying to draw the sprite
mainwindow.draw(backgroundsprite);
When im removing this line it works (but obviously nothing is displayed)