hi, can anybody tell me why this code is not working, it compiles but it crashes it only says that the game.exe stopped working and then i got to close it here is the code
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <iostream>
int main()
{
sf::RenderWindow mainW(sf::VideoMode(800, 600, 32),"lol this doesn't work");
sf::Image myImage;
sf::Sprite mySprite;
if(!myImage.LoadFromFile("lol.tga"))
std::cout << "error loading "<< std::endl;
else
std::cout << "load successful" <<std::endl;
mySprite.SetImage(myImage);
mySprite.SetPosition(50.f,20.f);
while(mainW.IsOpened())
{
sf::Event myEvent;
while(mainW.GetEvent(myEvent))
{
if(myEvent.Type == sf::Event::Closed)
mainW.Close();
if((myEvent.Type == sf::Event::KeyPressed) &&(myEvent.Key.Code == sf::Key::Left))
mainW.Draw(mySprite);
}
mainW.Clear();
mainW.Display();
}
return EXIT_SUCCESS;
}
i linked like this:
sfml-system-d.lib
sfml-window-d.lib
sfml-graphics-d.lib
and i included SFML_DYNAMIC in the preprocessor....and inlcuded the files to my project in the project folder... i also tried this
sfml-system.lib
sfml-window.lib
sfml-graphics.lib
but none of them work so i'm kind of lost help guys