Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Proplem with sf::Text  (Read 1569 times)

0 Members and 1 Guest are viewing this topic.

vietanh8286

  • Newbie
  • *
  • Posts: 9
    • Yahoo Instant Messenger - jaguar8286
    • View Profile
    • Email
Proplem with sf::Text
« 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!!!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Proplem with sf::Text
« Reply #1 on: July 30, 2012, 08:18:29 am »
OS? Compiler? Version of SFML?
Laurent Gomila - SFML developer

vietanh8286

  • Newbie
  • *
  • Posts: 9
    • Yahoo Instant Messenger - jaguar8286
    • View Profile
    • Email
Re: Proplem with sf::Text
« Reply #2 on: July 30, 2012, 08:43:11 am »
I use Windows 7 64bit, VS2008 and SFML2 (81e4209)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Proplem with sf::Text
« Reply #3 on: July 30, 2012, 09:10:08 am »
Are you sure that you're not using release libraries in debug mode?
Laurent Gomila - SFML developer

vietanh8286

  • Newbie
  • *
  • Posts: 9
    • Yahoo Instant Messenger - jaguar8286
    • View Profile
    • Email
Re: Proplem with sf::Text
« Reply #4 on: July 30, 2012, 09:42:44 am »
 :( ohhhh!!! I forgot it :(
I fixed it. Very Thank you  ;D

 

anything