Problem mit SFML (Simple and Fast Multimedia Library)
-
Hi ich habe ein Problem mit SFML (Simple and Fast Multimedia Library)
und zwar wenn ich ein Bsp. Programm laufen lasse wie z.B dieses:#include <SFML/Window.hpp> int main() { // Create the main rendering window sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics"); // Start game loop bool Running = true; while (Running) { // Process events sf::Event Event; while (App.GetEvent(Event)) { // Close window : exit if (Event.Type == sf::Event::Closed) Running = false; } // Display window contents on screen App.Display(); } return EXIT_SUCCESS; }Habe ich sobald ich das Programm ausführe und das Fenster seheeine CPU Auslastung von 100%
Ich benutze Code::Blocks wieso ist das so?
Ich hoffe ihr könnt mir helfen mfg
-
Ähh...
while (Running) { // Process events sf::Event Event; while (App.GetEvent(Event)) { // Close window : exit if (Event.Type == sf::Event::Closed) Running = false; } // Display window contents on screen App.Display(); }Du weisst schon, was das hier macht, oder?
-
Ich denke mal wegen der Endlosschleife.
Vielleicht solltest du eine Art Framelimit einbauen.
-
Kauf dir einfach nen Dual Core CPU und schon hast du nur noch 50% Auslastung
-

-
sf::Sleep oder bau nen sf::Timer ein.
-
Heutige Multimedia-Anwendungen haben halt sone Auslastung.
<< Jetzt wird mir auch klar, warum?! >>