/** Metoda pokazuje na pasku tytulowym apliakcji ilosc fps-ow. * @warning Funkcja jest niestabilna i w systemie linuks moze powodowac po jakims czasie * niespodziewane zakonczenie aplikacji. Brak pomyslu na naprawe. * * @param void * @return void */ void App::FPS_show() { std::ostringstream ss; ss << pframeRating; string strFPS("Debug ["); strFPS += ss.str(); strFPS += " fps]"; SDL_WM_SetCaption( strFPS.data(),NULL ); pframeRating = 0; }
void framesPerSecond::show(SDL_Renderer* renderer, TTF_Font *font) { SDL_Rect rectText; SDL_Color text_color = {255, 255, 255}; string text; ostringstream strStream; // float to std::string strStream << fps; string strFPS(strStream.str()); text = "FPS: " + strFPS; rectText.x = 0; rectText.y = 0; rect = rectText; write(renderer,font,text,text_color,rect); };