X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fmainloop.hpp;h=bd03372b94467fc1d6e6018ddb74118c171a9cf9;hb=e7a070520aa3c241979f73fb67d6a62df4e86b66;hp=47621f3480d77a43e7aa674218949f244730e821;hpb=c62711567861587107d124642db29e2674ee6533;p=supertux.git diff --git a/src/mainloop.hpp b/src/mainloop.hpp index 47621f348..bd03372b9 100644 --- a/src/mainloop.hpp +++ b/src/mainloop.hpp @@ -33,11 +33,17 @@ class MainLoop public: MainLoop(); ~MainLoop(); - - void run(); + + void run(DrawingContext &context); void exit_screen(ScreenFade* fade = NULL); void quit(ScreenFade* fade = NULL); void set_speed(float speed); + float get_speed() const; + + /** + * requests that a screenshot be taken after the next frame has been rendered + */ + void take_screenshot(); // push new screen on screen_stack void push_screen(Screen* screen, ScreenFade* fade = NULL); @@ -48,19 +54,25 @@ public: private: void draw_fps(DrawingContext& context, float fps); - + void draw(DrawingContext& context); + void update_gamelogic(float elapsed_time); + void process_events(); + void handle_screen_switch(); + bool running; float speed; bool nextpop; bool nextpush; + /// measured fps + float fps; std::auto_ptr next_screen; std::auto_ptr current_screen; std::auto_ptr console; std::auto_ptr screen_fade; std::vector screen_stack; + bool screenshot_requested; /**< true if a screenshot should be taken after the next frame has been rendered */ }; extern MainLoop* main_loop; #endif -