本文整理汇总了C++中Composite::updateCursor方法的典型用法代码示例。如果您正苦于以下问题:C++ Composite::updateCursor方法的具体用法?C++ Composite::updateCursor怎么用?C++ Composite::updateCursor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composite
的用法示例。
在下文中一共展示了Composite::updateCursor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void AlloyContext::update(Composite& rootNode) {
endTime = std::chrono::steady_clock::now();
double updateElapsed = std::chrono::duration<double>(
endTime - lastUpdateTime).count();
double animateElapsed = std::chrono::duration<double>(
endTime - lastAnimateTime).count();
double cursorElapsed = std::chrono::duration<double>(
endTime - lastCursorTime).count();
if (deferredTasks.size() > 0) {
executeDeferredTasks();
cursorLocator.reset(screenSize);
rootNode.updateCursor(&cursorLocator);
dirtyCursorLocator = false;
mouseOverRegion = locate(cursorPosition);
dirtyCursor = false;
dirtyLayout = true;
}
if (updateElapsed > UPDATE_LOCATOR_INTERVAL_SEC) {
if (dirtyCursorLocator) {
cursorLocator.reset(screenSize);
rootNode.updateCursor(&cursorLocator);
dirtyCursorLocator = false;
mouseOverRegion = locate(cursorPosition);
dirtyCursor = false;
}
lastUpdateTime = endTime;
}
if (cursorElapsed >= UPDATE_CURSOR_INTERVAL_SEC) { //Dont try to animate faster than 60 fps.
if (dirtyCursor && !dirtyCursorLocator) {
mouseOverRegion = locate(cursorPosition);
dirtyCursor = false;
}
dirtyUI = true;
lastCursorTime = endTime;
}
if (animateElapsed >= ANIMATE_INTERVAL_SEC) { //Dont try to animate faster than 60 fps.
lastAnimateTime = endTime;
if (animator.step(animateElapsed)) {
dirtyLayout = true;
dirtyUI = true;
}
}
if (dirtyLayout) {
rootNode.pack(this);
animator.firePostEvents();
dirtyCursorLocator = true;
dirtyLayout = false;
}
}