First: I did do a search and did find other topics containing the same issue, however they didn't help in fixing my problem.
I'm completely new to sfml, and completely lost. I looked at the official tutorial on rendering graphics with the graphics package. Managed to get a black screen. After that I looked at a different tutorial on actually getting an image to render, and all that happens is a quick 1frame white screen and then it closes and returns that it cant open the image file when I have the file in the location I
*think* it should go(Source->Bin->Debug, with the debug exe) My image's name is 'ball.png'
My code looks like:
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
using namespace sf;
int main()
{
// Create the main rendering window
sf::RenderWindow Window(sf::VideoMode(800, 600, 32), "SFML Graphics");
sf::Image Ball;
if (!Ball.LoadFromFile("ball.png"))
return 1;
sf::Sprite SprBall;
SprBall.SetImage(Ball);
SprBall.SetPosition(100.0f, 30.0f);
// Start game loop
while (Window.IsOpened())
{
// Process events
sf::Event Event;
while (Window.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
Window.Close();
}
// Clear the screen (fill it with some random color)
Window.Clear(sf::Color(23, 98, 137));
//Drawing the Ball
Window.Draw(SprBall);
// Display window contents on screen
Window.Display();
}
return EXIT_SUCCESS;
}
Thanks for any/all help given
Edit: Oh and sorry if it looks very messy, its a mix of 2 different tutorials.