Beispiel #1
0
  /**
   * Creates a new FrameBuffer having the given dimensions and potentially a depth buffer attached.
   *
   * @param format the format of the color buffer; according to the OpenGL ES 2.0 spec, only RGB565,
   *     RGBA4444 and RGB5_A1 are color-renderable
   * @param width the width of the framebuffer in pixels
   * @param height the height of the framebuffer in pixels
   * @param hasDepth whether to attach a depth buffer
   * @throws GdxRuntimeException in case the FrameBuffer could not be created
   */
  public FrameBuffer(Pixmap.Format format, int width, int height, boolean hasDepth) {
    this.width = width;
    this.height = height;
    this.format = format;
    this.hasDepth = hasDepth;
    build();

    addManagedFrameBuffer(Gdx.app, this);
  }