Questions tagged «sfml»

3
如何调用在另一个文件上找到的函数?
我最近开始使用C ++和SFML库,我想知道我是否在适当地称为“ player.cpp”的文件上定义了Sprite,如何在位于“ main.cpp”的主循环中调用它? 这是我的代码(请注意,这是SFML 2.0,而不是1.6!)。 main.cpp #include "stdafx.h" #include <SFML/Graphics.hpp> #include "player.cpp" int main() { sf::RenderWindow window(sf::VideoMode(800, 600), "Skylords - Alpha v1"); while (window.isOpen()) { sf::Event event; while (window.pollEvent(event)) { if (event.type == sf::Event::Closed) window.close(); } window.clear(); window.draw(); window.display(); } return 0; } 播放器 #include "stdafx.h" #include <SFML/Graphics.hpp> int …
73 c++  sfml  identifier 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.