Hello,
also, this code will always return -1. After an if statement without {} only the next statement will be in the if branch. This means, no matter what, return -1 will be executed.
if (!texture.loadFromFile("Bug1.png"))
std::cout << "nicht geladen" << std::endl;
return -1;
I am quite sure your intention is this:
if (!texture.loadFromFile("Bug1.png"))
{
std::cout << "nicht geladen" << std::endl;
return -1;
}