我正在尝试将我的纹理加载到我的窗口....但是当我在 Windows 10 笔记本电脑上的 Visual Studio 中编译时,它说“sf 没有成员纹理”,老实说,我不确定到底发生了什么!无论出于何种原因,它都没有加载 sf!如果您有任何想法,请告诉我...非常感谢,这对我来说意义重大!(我也尝试过使用“#include”,但不幸的是它没有为我解决)
#include <SFML/Window.hpp>
int main()
{
sf::Texture texture;
if (!texture.loadFromFile("sheet_1.png"))
{
// error...
}
sf::Window window(sf::VideoMode(800, 600), "My window");
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
}
return 0;
}