当前位置: 首页>>代码示例>>C++>>正文


C++ Engine::ClearArea方法代码示例

本文整理汇总了C++中Engine::ClearArea方法的典型用法代码示例。如果您正苦于以下问题:C++ Engine::ClearArea方法的具体用法?C++ Engine::ClearArea怎么用?C++ Engine::ClearArea使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Engine的用法示例。


在下文中一共展示了Engine::ClearArea方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GdBeginDr

int GdBeginDr(Drauing *drawing, GpBox *damage, int landscape)
{
  int needToRedraw= 0;
  Engine *eng;

  if (damage) {
    /* If drawing has incurred damage, report damage to ALL engines
       interested in the drawing (not just active engines).  */
    for (eng=GpNextEngine(0) ; eng ; eng=GpNextEngine(eng))
      if (eng->drawing==drawing) GpDamage(eng, drawing, damage);
  }

  /* Loop on active engines to alert them that drawing is coming.  */
  for (eng=GpNextActive(0) ; eng ; eng=GpNextActive(eng)) {
    if (eng->drawing!=drawing) {
      /* This engine is not marked as interested in this drawing.
         Mark it, and reset damaged and lastDrawn flags so that no
         elements will be inhibited.  */
      eng->drawing= drawing;
      eng->lastDrawn= -1;
      eng->damaged= 0;
      if (landscape != eng->landscape) {
        eng->landscape= landscape;
        /* This change will be detected and acted upon by the first call
           to the ChangeMap method (GpSetTrans).  */
      }
      /* The semantics here are subtle --
         After a ClearDrawing, GdDetach zeroes eng->drawing in order to
         communicate that the drawing has been cleared.  Thus, the code
         gets here on a GdDraw after the drawing has been cleared, so
         the time has come to carry out the deferred clearing of this
         engine's plotting surface.  */
      GpClear(eng, CONDITIONALLY);
      needToRedraw= 1;

    } else if (eng->damaged) {
      /* This engine was interested in the drawing, which has been
         damaged.  Clear damaged area in preparation for repair work.
         (This is redundant if the damage was due to an X windows
          expose event, but the resulting inefficiency is very small.)  */
      eng->ClearArea(eng, &eng->damage);
      needToRedraw= 1;

    } else if (eng->lastDrawn<drawing->nElements-1) {
      needToRedraw= 1;
    }
  }

  gdNowRendering= gdMaxRendered= -1;
  return needToRedraw;
}
开发者ID:MattWherry,项目名称:yorick,代码行数:51,代码来源:engine.c


注:本文中的Engine::ClearArea方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。