Hi, all.
I can't seem to get SFML 2.2 to work in Visual Studio. I've gotten 2.1 to work, so I'm not sure what I'm doing incorrectly.
There seems to be an issue when I try to load a texture from a file. I've made sure that the file is actually in the directory.
The console absolutely freaks out when the texture load function is called, and I get the usual "Your program has stopped working" error from Windows, which is useless because it gives no reasoning as to why.
The SFML sample of drawing a green circle works fine.
These are my Visual Studio settings:
C++/General
Additional Include Directories: C:\SFML\SFML-2.2-32\include
Linker/General
Additional Library Directories: C:\SFML\SFML-2.2-32\lib
Linker/Input
Additional Dependencies: sfml-graphics.lib
sfml-window.lib
sfml-system.lib
sfml-audio.lib
sfml-network.lib
I have copied all the DLL files to my project's directory.
I don't have any pre-processor settings set.
This is the code I'm using:
#include <iostream>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(500, 500), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
sf::Sprite sprite;
sf::Texture texture;
//The program freaks out here
//a bunch of incoherent stuff outputs from the console and the application freezes
if (!texture.loadFromFile("sfml-logo-big.bmp"))
{
}
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
The output from the console when it crashes is just thousands of random, incoherent characters - kind of like what you'd see if you tried to look an encrypted file.
Did I mess up setting this up? I thought I set it up correctly, since the drawing of a green circle works fine.