1
General / Re: Issues with using SFML with Visual Studio 2010
« on: March 27, 2014, 05:01:22 am »
If you created a Win32 application delete your whole code and put this.
Then what you need to do is link all the libraries E.G, these are for release. Add the -d for debug.
(Yet again, not the best way to do it since you're not using them, but I don't know what you move onto after this, you may need them)
#include <SFML/Graphics.hpp>
using namespace sf;
int main()
{
RenderWindow window(VideoMode(200, 200), "Apocalypse");
CircleShape shape(100.f);
shape.setFillColor(Color::Green);
while (window.isOpen())
{
Event event;
while (window.pollEvent(event))
{
if (event.type == Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
(I know using namespace sf; is bad but I'm testing stuff)using namespace sf;
int main()
{
RenderWindow window(VideoMode(200, 200), "Apocalypse");
CircleShape shape(100.f);
shape.setFillColor(Color::Green);
while (window.isOpen())
{
Event event;
while (window.pollEvent(event))
{
if (event.type == Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
Then what you need to do is link all the libraries E.G, these are for release. Add the -d for debug.
sfml-main.lib
sfml-graphics.lib
sfml-audio.lib
sfml-system.lib
sfml-window.lib
sfml-network.lib
sfml-graphics.lib
sfml-audio.lib
sfml-system.lib
sfml-window.lib
sfml-network.lib
(Yet again, not the best way to do it since you're not using them, but I don't know what you move onto after this, you may need them)