SFML 2.0, nic się nie wyświetla
Ostatnio zmodyfikowano 2014-06-07 20:14
drudl Temat założony przez niniejszego użytkownika |
SFML 2.0, nic się nie wyświetla » 2014-06-05 13:22:27 Witam, zainstalowałem SFML przez CMake i próbowałem uruchomić program testowy, ale nic się nie wyświetla. To kod: #include <SFML/Graphics.hpp> #include <cmath>
int main() { sf::RenderWindow okno( sf::VideoMode( 320, 240 ), "Kurs SFML 2.0 - http://cpp0x.pl" ); sf::Clock stoper; while( okno.isOpen() ) { sf::Event event; while( okno.pollEvent( event ) ) { if( event.type == sf::Event::Closed ) okno.close(); } okno.clear(); sf::CircleShape ksztalt( std::sin( stoper.getElapsedTime().asSeconds() ) * okno.getSize().y / 8 + okno.getSize().y / 4 ); ksztalt.setOrigin( sf::Vector2f( ksztalt.getRadius(), ksztalt.getRadius() ) ); ksztalt.setPosition( okno.getSize().x / 2.0f, okno.getSize().y / 2.0f ); ksztalt.setFillColor( sf::Color::Yellow ); okno.draw( ksztalt ); okno.display(); } return 0; } a to co wyświetla Build log: -------------- Build: all in SFML ---------------
Using makefile: Makefile [ 16%] Built target sfml-system [ 18%] Built target sfml-main [ 40%] Built target sfml-window [ 53%] Built target sfml-network [ 86%] Built target sfml-graphics [100%] Built target sfml-audio Process terminated with status 0 (0 minutes, 2 seconds) 0 errors, 0 warnings Chyba powinien się tworzyć plik z końcówką exe.exe, ale nic się nie dzieje. Nie wiem co z tym zrobić. |
|
pekfos |
» 2014-06-05 14:41:40 Kompilujesz SFML, a nie swój program. |
|
drudl Temat założony przez niniejszego użytkownika |
» 2014-06-05 15:55:34 Rzeczywiście.
Czy ktoś mógłby mi to wytłumaczyć: If you use an IDE, a target is simply a project. To build a target, select the corresponding project and compile it (even "clean" or "install" must be compiled to be executed -- don't be confused by the fact that no source code is actually compiled). If you use a makefile, pass the name of the target to the make command to build this target. Examples: "nmake doc", "mingw32-make install", "make sfml-network".
Now you should have successfully compiled SFML. Congratulations!
bo kompletnie tego nie rozumiem. Tłumaczyłem w google tłumaczu, ale nie za bardzo wiem co zrobić.
I w ogóle co to znaczy, że kompiluję SFML? |
|
pekfos |
» 2014-06-05 16:31:17 Kompilujesz kod biblioteki SFML, a nie swój. |
|
drudl Temat założony przez niniejszego użytkownika |
» 2014-06-06 16:17:07 Czyli jak skompiluję to co, mogę jakoś uruchomić SFML? Żeby działał. |
|
pekfos |
» 2014-06-06 16:37:05 Nie.. Masz utworzyć swój projekt z własnym kodem i tylko linkować SFML. |
|
drudl Temat założony przez niniejszego użytkownika |
» 2014-06-06 17:00:23 Tu mam problem, bo nie wiem gdzie stworzyły się te biblioteki. |
|
pekfos |
» 2014-06-06 17:16:46 To wyszukaj. Np po sfml-system, albo *.a. |
|
« 1 » 2 3 4 |