本文整理汇总了C++中window::close方法的典型用法代码示例。如果您正苦于以下问题:C++ window::close方法的具体用法?C++ window::close怎么用?C++ window::close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类window
的用法示例。
在下文中一共展示了window::close方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: timer_callback
void loading_screen::timer_callback(window& window)
{
if (!work_ || !worker_ || worker_->timed_join(boost::posix_time::milliseconds(0))) {
if (exception_) {
clear_timer();
std::rethrow_exception(exception_);
}
window.close();
}
if (!work_) {
return;
}
const char* stage = current_stage_
#if defined(_MSC_VER) && _MSC_VER < 1900
;
#else
.load(std::memory_order_acquire);
示例2: draw_callback
void outro::draw_callback(window& window)
{
if(SDL_GetTicks() < next_draw_) {
return;
}
/* If we've faded fully in...
*
* NOTE: we want fading to take around half a second. Given this function runs about every 3 frames, we
* limit ourselves to a reasonable 10 fade steps with an alpha difference (rounded up) of 25.5 each cycle.
* The actual calculation for alpha is done in the window definition in WFL.
*/
if(fading_in_ && fade_step_ > 10) {
// Schedule the fadeout after the provided delay.
if(timer_id_ == 0) {
timer_id_ = add_timer(duration_, [this](size_t) { fading_in_ = false; });
}
return;
}
// If we've faded fully out...
if(!fading_in_ && fade_step_ < 0) {
window.close();
return;
}
canvas& window_canvas = window.get_canvas(0);
window_canvas.set_variable("fade_step", wfl::variant(fade_step_));
window_canvas.set_is_dirty(true);
window.set_is_dirty(true);
if(fading_in_) {
fade_step_ ++;
} else {
fade_step_ --;
}
set_next_draw();
}
示例3: on_resize
void title_screen::on_resize(window& win)
{
redraw_background_ = true;
win.close();
}