Hi,
This code:
#include <iostream>
#include <SFML/Graphics.hpp>
int main()
{
int x = 0;
int y = 0;
// Create the main rendering window
sf::RenderWindow App(sf::VideoMode(1440, 900, 32), "SFML Graphics");
// Start game loop
while (App.IsOpened())
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
App.Close();
}
// Clear the screen (fill it with black color)
if(y == 0)
{
App.Clear();
y = 1;
}
sf::Image Image;
if (!Image.LoadFromFile("sprite.tga"))
{
if(x == 0)
{
std::cout << "Bild konnte nicht geladen werden\n";
}
x = 1;
}
// Display window contents on screen
App.Display();
}
return EXIT_SUCCESS;
}
displays an empty window, but it should display a sprite in the window.
Thank you for your help.