示例#1
0
void TextPainter::Text::Update()
{
    //content_.clear();
    std::string new_content;
    updater_(&new_content);
    if (content_ == new_content)
        return;
    content_.clear();
    content_ = new_content;
    auto local = TTF_RenderText_Blended(master_->GetFont(font_name_, size_), content_.c_str(), color_);
              
    delete content_image_;
    content_image_ = nullptr;

    if (local)
        content_image_ = new ApproxGLImage(local);
}
void Actor::update(std::chrono::milliseconds elapsed)
	{
	animations_.setCurrentFrame(updater_(animations_, elapsed));
	}