Example #1
0
/*
 * Main loop.
 */
void MainLoop() {
  LoopEventT event = LOOP_CONTINUE;

  SetVBlankCounter(0);

  do {
    int frameNumber = GetVBlankCounter();

    if (event != LOOP_CONTINUE) {
      CanvasFill(R_("Canvas"), 0);

      if (event == LOOP_NEXT)
        effect = (effect + 1) % lastEffect;
      if (event == LOOP_PREV) {
        effect--;
        if (effect < 0)
          effect += lastEffect;
      }
    }

    RenderVector(frameNumber);
    RenderChunky(frameNumber);
    RenderFrameNumber(frameNumber);

    DisplaySwap();
  } while ((event = ReadLoopEvent()) != LOOP_EXIT);
}
Example #2
0
void MainLoop() {
  LoopEventT event = LOOP_CONTINUE;

  SetVBlankCounter(0);

  do {
    static bool paused = FALSE;
    static int oldFrameNumber = 0;
    int frameNumber = GetVBlankCounter();

    if (event == LOOP_PAUSE)
      paused = !paused;

    if (paused) {
      SetVBlankCounter(oldFrameNumber);
      frameNumber = oldFrameNumber;
    } else {
      oldFrameNumber = frameNumber;
    }

    if (event == LOOP_TRIGGER) {
      RenderMode++;
      if (RenderMode > 4)
        RenderMode = 0;

      if (RenderMode < RENDER_FILLED)
        RenderAllFaces = true;
      else
        RenderAllFaces = false;
    }

    RenderMesh(frameNumber);
    RenderFrameNumber(frameNumber);
    RenderFramesPerSecond(frameNumber);

    DisplaySwap();
  } while ((event = ReadLoopEvent()) != LOOP_EXIT);
}
Example #3
0
/*
 * Main loop.
 */
void MainLoop() {
  LoopEventT event = LOOP_CONTINUE;

  SetVBlankCounter(0);

  do {
    int frameNumber = GetVBlankCounter();

    RenderEffect(frameNumber);
    RenderFrameNumber(frameNumber);
    RenderFramesPerSecond(frameNumber);

    DisplaySwap();
  } while ((event = ReadLoopEvent()) != LOOP_EXIT);
}