Gdx.input.setInputProcessor(cameraController); GLFrameBuffer.FrameBufferBuilder frameBufferBuilder = new GLFrameBuffer.FrameBufferBuilder(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); frameBufferBuilder.addColorTextureAttachment(GL30.GL_RGBA8, GL30.GL_RGBA, GL30.GL_UNSIGNED_BYTE); frameBufferBuilder.addColorTextureAttachment(GL30.GL_RGB8, GL30.GL_RGB, GL30.GL_UNSIGNED_BYTE); frameBufferBuilder.addColorTextureAttachment(GL30.GL_RGB8, GL30.GL_RGB, GL30.GL_UNSIGNED_BYTE); frameBufferBuilder.addDepthTextureAttachment(GL30.GL_DEPTH_COMPONENT32F, GL30.GL_FLOAT); frameBuffer = frameBufferBuilder.build();
GLFrameBuffer.FrameBufferBuilder frameBufferBuilder = new GLFrameBuffer.FrameBufferBuilder(200, (int) (r.getRegionHeight() * 200f / r.getRegionWidth())); frameBufferBuilder.addColorTextureAttachment(GL30.GL_RGBA8, GL30.GL_RGBA, GL30.GL_UNSIGNED_BYTE); FrameBuffer fbo = 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(); }
/** 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(); }