#include <SFML/Graphics.hpp>
int main(){
sf::RenderWindow Window;
Window.Create(sf::VideoMode(512, 512, 32), "Test");
sf::Image Background;
Background.LoadFromFile("Any512x512Image.png");
sf::Sprite BG(Background);
//sf::RenderImage Screen; // Uncomment this line and comment the definition ahead and Flush if you want to test both
if (sf::Shader::IsAvailable()){
sf::RenderImage Screen;
Screen.Draw(BG);
Screen.Display();
Window.Draw(sf::Sprite(Screen.GetImage()));
Window.Flush();
}
else
Window.Draw(BG);
Window.Display();
sf::Event Event;
while (Window.IsOpened()){
while (Window.GetEvent(Event)){
if (Event.Type == sf::Event::Closed)
Window.Close();
if (Event.Type == sf::Event::KeyPressed && Event.Key.Code == sf::Key::Escape)
Window.Close();
}
}
return EXIT_SUCCESS;
}
There's the code that does not work for me. It draws nothing.