Example #1
0
 // updates Display
 public void update() {
   Window w = vc.getFullScreenWindow();
   if (w != null) {
     BufferStrategy s = w.getBufferStrategy();
     if (!s.contentsLost()) {
       s.show();
     }
   }
 }
Example #2
0
 /** @return Retorna el entorno de dibujado. */
 public Graphics2D getGraphics() {
   Window window = device.getFullScreenWindow();
   if (window != null) {
     BufferStrategy strategy = window.getBufferStrategy();
     return (Graphics2D) strategy.getDrawGraphics();
   } else {
     return null;
   }
 }
Example #3
0
  // we will set Graphics object = to this
  public Graphics2D getGraphics() {

    Window w = vc.getFullScreenWindow();

    if (w != null) {
      BufferStrategy bs = w.getBufferStrategy();
      return (Graphics2D) bs.getDrawGraphics();
    } else {
      return null;
    }
  }
Example #4
0
  /** Actualiza la pantalla con el doble buffer e intenta sincronizar la imagen. */
  public void update() {
    Window window = device.getFullScreenWindow();

    if (window != null) {
      BufferStrategy strategy = window.getBufferStrategy();
      if (!strategy.contentsLost()) {
        strategy.show();
      }
    }
    // Sync the display on some systems.
    // (on Linux, this fixes event queue problems)
    Toolkit.getDefaultToolkit().sync();
  }