Hi guys,
I have a fresh Ubuntu Mate install on one of my machines and a I can't load/display images.
#include <SFML/Graphics.hpp>
int main()
{
// Create the main window
sf::RenderWindow app(sf::VideoMode(800, 600), "SFML window");
// Load a sprite to display
sf::Texture texture;
if (!texture.loadFromFile("cb.bmp"))
return EXIT_FAILURE;
sf::Sprite sprite(texture);
// Start the game loop
while (app.isOpen())
{
// Process events
sf::Event event;
while (app.pollEvent(event))
{
// Close window : exit
if (event.type == sf::Event::Closed)
app.close();
}
// Clear screen
app.clear();
// Draw the sprite
app.draw(sprite);
// Update the window
app.display();
}
return EXIT_SUCCESS;
}
Everytime a try to execute the code I get a segmentation fault, but if a put a wrong path for the image (like "cb2.bmp") I get "Failed to load image "cb2.bmp". Reason: Unable to open file."
If a comment every line mentioning "texture" and "sprite", the program runs but obviosly I get a black screen.
I get the same results compiling directly from the console.
I've faced the same issues long ago on a previous Linux distro ("lubuntu"), but I fixed somehow. Driver issues?