Example #1
0
  void updateScreen() {
    re.BeginFrame(0.0f);

    switch (currentState) {
      case 0:
        re.DrawStretchPic(0, 0, viddef.getWidth(), viddef.getHeight(), "conback");
        re.DrawPic(viddef.getWidth() / 2 - 50, viddef.getHeight() / 2, "loading");
        currentState = 1;
        break;
      case 1:
        // register the map
        re.SetSky("space1", 0, new float[] {0, 0, 0});
        re.BeginRegistration("ColorTest");
        re.EndRegistration();
        currentState = 2;
        // break;
      default:
        if (framecount % 500 == 0) {
          long time = System.currentTimeMillis();
          fps = 500000.0f / (time - start);
          start = time;
        }
        String text = fps + " fps";

        testMap();

        drawString(10, viddef.getHeight() - 16, text);
    }

    re.EndFrame();
    framecount++;
  }
Example #2
0
 void run() {
   startTime = System.currentTimeMillis();
   while (true) {
     re.updateScreen(null);
     re.getKeyboardHandler().Update();
     //			try {
     //				Thread.sleep(5);
     //			}
     //			catch (InterruptedException e) {
     //			}
   }
 }
Example #3
0
 private final int time() {
   return (int) (System.currentTimeMillis() - startTime);
 }