This has got me stumped and very annoyed.
Just come back to SFML, used it in my second year at uni, and then in third year we went on to OpenGL, which I hated.
So now I'm trying to make some simple 2D games for my portfolio.
However, I'm stuck at just getting a simple SFML window to display.
The clock example in the tutorial for setting up sfml worked, and I have no link errors.
Here's my code
#include <SFML/Graphics.hpp>
#include <iostream>
int main()
{
//create main window
sf::RenderWindow App(sf::VideoMode(800,600), "SFML test");
sf::Image Image;
if(!Image.LoadFromFile("ball.jpg"))
return EXIT_FAILURE;
sf::Sprite Sprite(Image);
while(App.IsOpened())
{
sf::Event Event;
std::cout << "event created" << std::endl;
while(App.GetEvent(Event))
{
std::cout << "inside while loop" << std::endl;
if(Event.Type == sf::Event::Closed)
App.Close();
}
//clear window
App.Clear();
App.Draw(Sprite);
//update window
App.Display();
}
return EXIT_SUCCESS;
}
When I run with debugging, the error I get is :
Microsoft Visual Studio C Runtime Library has detected a fatal error in sfml-test.exe.
.
If I enter debugging, it says its on the line with "while(App.GetEvent(Event))". (There is a green arrow on the line).
Still reacquainting myself with visual studio as I've been doing a lot of java in netbeans recently.
Can anyone help me before I start pulling my hair out?
Thanks