I have a sf::Font that is loaded and a sf::Text vector for all my texts in the game debug screen. I have created a variable for frame rate named FPS which is constantly changing... when I print the FPS variable just before using the setString() function, it prints out perfectly between 45-65, when it shows up on the window it says 1 or 0. PS: I am using a M1 Mac if that's pertinent to the problem.
Here is my code:
void IGGUI::update(float *dt)
{
FPS = to_string(int(1 / *dt));
}
void IGGUI::render(RenderWindow *window)
{
debug_screen.at(0).setString("Framerate: "+ FPS);
debug_screen.at(1).setString("Current game state: Development");
for(int i = 0; i < debug_screen.size(); i++)
{
window->draw(debug_screen.at(i));
}
}
Any help would be appreciated it might be something stupid or something deeper...