SFML community forums

Help => Graphics => Topic started by: vietanh8286 on July 30, 2012, 05:50:54 am

Title: Proplem with sf::Text
Post by: vietanh8286 on July 30, 2012, 05:50:54 am
Hi there,

my code:

textFps->setString("FPS: "); <- has an exception: std::bad_alloc

but,

textFps->setString(L"FPS: ");
-> OK

-------------------------------------------------
extend:

std::stringstream ss;
ss << getFps(elapsedTime);
textFps->setString("FPS: " + ss.str());
-> has an exception: std::length_error

help me :( Thanks!!!
Title: Re: Proplem with sf::Text
Post by: Laurent on July 30, 2012, 08:18:29 am
OS? Compiler? Version of SFML?
Title: Re: Proplem with sf::Text
Post by: vietanh8286 on July 30, 2012, 08:43:11 am
I use Windows 7 64bit, VS2008 and SFML2 (81e4209)
Title: Re: Proplem with sf::Text
Post by: Laurent on July 30, 2012, 09:10:08 am
Are you sure that you're not using release libraries in debug mode?
Title: Re: Proplem with sf::Text
Post by: vietanh8286 on July 30, 2012, 09:42:44 am
 :( ohhhh!!! I forgot it :(
I fixed it. Very Thank you  ;D