Компилятор : VS 2017.
Я скачал sfml и установил на проект через NuGet (пытался по другому – не получалось).
Все работало нормально,но сейчас когда я хочу вывести картинку Мне выдает в консольном окне :
Failed to load image “h.png” . Reason: Unable to open file SFML.
И черное окно Sfml.
Код:
#include <SFML/Graphics.hpp>
#include <windows.h>
using namespace sf;
int main()
{
RenderWindow window(sf::VideoMode(640, 480), “SFML”);
/*Image heroimage;
heroimage.loadFromFile(“herofolder\\h.png”);*/
Texture herotexture;
herotexture.loadFromFile(“h.png”);
Sprite herosprite;
herosprite.setTexture(herotexture);
herosprite.setPosition(0, 0);
while (window.isOpen())
{
Event event;
while (window.pollEvent(event))
{
if (event.type == Event::Closed)
window.close();
}
window.clear();
window.draw(herosprite);
window.display();
}
int a;
while (true) {}
return 0;
}
Я умею читать. Файл Существует. Прописывая полный путь вылезает ошибка , но все может компилироваться и все равно черный экран.
Помогите!