/** Creates a new FrameBuffer having the given dimensions and potentially a depth and a stencil 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 com.badlogic.gdx.utils.GdxRuntimeException in case the FrameBuffer could not be created */ public FrameBuffer (Pixmap.Format format, int width, int height, boolean hasDepth, boolean hasStencil) { FrameBufferBuilder frameBufferBuilder = new FrameBufferBuilder(width, height); frameBufferBuilder.addBasicColorTextureAttachment(format); if (hasDepth) frameBufferBuilder.addBasicDepthRenderBuffer(); if (hasStencil) frameBufferBuilder.addBasicStencilRenderBuffer(); this.bufferBuilder = frameBufferBuilder; build(); }
/** Creates a new FrameBuffer having the given dimensions and potentially a depth and a stencil 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 com.badlogic.gdx.utils.GdxRuntimeException in case the FrameBuffer could not be created */ public FrameBuffer (Pixmap.Format format, int width, int height, boolean hasDepth, boolean hasStencil) { FrameBufferBuilder frameBufferBuilder = new FrameBufferBuilder(width, height); frameBufferBuilder.addBasicColorTextureAttachment(format); if (hasDepth) frameBufferBuilder.addBasicDepthRenderBuffer(); if (hasStencil) frameBufferBuilder.addBasicStencilRenderBuffer(); this.bufferBuilder = frameBufferBuilder; build(); }
/** Creates a new FrameBuffer having the given dimensions and potentially a depth and a stencil 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 com.badlogic.gdx.utils.GdxRuntimeException in case the FrameBuffer could not be created */ public FrameBuffer (Pixmap.Format format, int width, int height, boolean hasDepth, boolean hasStencil) { FrameBufferBuilder frameBufferBuilder = new FrameBufferBuilder(width, height); frameBufferBuilder.addBasicColorTextureAttachment(format); if (hasDepth) frameBufferBuilder.addBasicDepthRenderBuffer(); if (hasStencil) frameBufferBuilder.addBasicStencilRenderBuffer(); this.bufferBuilder = frameBufferBuilder; build(); }