Hi I started using SFML with Visual Studio 2012 today. Iv have not ran into any problems while rendering a Window , and using events such as keyboard, joystick , window and mouse. I'm trying to display an image on screen using the "Texture" and "Sprite" Class. My image is called "Mage" witch is a png file that is in the same folder as Main. I get this error when I use write "Window.Draw(sprite)".
Error 1 error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B) c:\Users\nicho_000\documents\visual studio 2012\Projects\XXX\XXX\Main.obj
My Code
#include<SFML/Graphics.hpp>
void LoadContent();
void Update();
void Draw();
sf::RenderWindow window;
sf::Texture texture;
sf::Sprite sprite;
int main()
{
window.create(sf::VideoMode(800,600),"Game");
LoadContent();
while (window.isOpen())
{
Update();
Draw();
}
}
void LoadContent()
{
texture.loadFromFile("Mage.png");
sprite.setTexture(texture);
}
void Update()
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed || event.key.code == sf::Keyboard::Escape )
window.close();
}
}
void Draw()
{
window.clear(sf::Color(116,146,208));
window.draw(sprite);
window.display();
}
Thanks