本文整理汇总了C++中DrawingContext::take_screenshot方法的典型用法代码示例。如果您正苦于以下问题:C++ DrawingContext::take_screenshot方法的具体用法?C++ DrawingContext::take_screenshot怎么用?C++ DrawingContext::take_screenshot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DrawingContext
的用法示例。
在下文中一共展示了DrawingContext::take_screenshot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
void
ScreenManager::draw(DrawingContext& context)
{
assert(!m_screen_stack.empty());
static Uint32 fps_ticks = SDL_GetTicks();
m_screen_stack.back()->draw(context);
m_menu_manager->draw(context);
if (m_screen_fade)
{
m_screen_fade->draw(context);
}
Console::current()->draw(context);
if (g_config->show_fps)
{
draw_fps(context, m_fps);
}
if (g_config->show_player_pos)
{
draw_player_pos(context);
}
// if a screenshot was requested, pass request on to drawing_context
if (m_screenshot_requested)
{
context.take_screenshot();
m_screenshot_requested = false;
}
context.do_drawing();
/* Calculate frames per second */
if (g_config->show_fps)
{
static int frame_count = 0;
++frame_count;
if (SDL_GetTicks() - fps_ticks >= 500)
{
m_fps = (float) frame_count / .5;
frame_count = 0;
fps_ticks = SDL_GetTicks();
}
}
}