/** ***************************************************************************** * Copyright 2011 See AUTHORS file. * * Licensed under the Apache License, Version 2 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************** */ /**

* Encapsulates OpenGL ES 2 frame buffer objects. This is a simple helper class which should cover most FBO uses. It will * automatically create a texture for the color attachment and a renderbuffer for the depth buffer. You can get a hold of the * texture by {@link FrameBuffer#getColorBufferTexture()}. This class will only work with OpenGL ES 2.0. *

* *

* FrameBuffers are managed. In case of an OpenGL context loss, which only happens on Android when a user switches to another * application or receives an incoming call, the framebuffer will be automatically recreated. *

* *

* A FrameBuffer must be disposed if it is no longer needed *

* * @author mzechner, realitix */ export declare class FrameBuffer { /** the framebuffer handle * */ protected framebufferHandle: WebGLFramebuffer; readonly gl: WebGLRenderingContext; readonly width: number; readonly height: number; readonly texture: WebGLTexture; private lastViewport; /** 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 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 */ constructor(gl: WebGLRenderingContext, width: number, height: number); bindTexture(): void; protected createTexture(): WebGLTexture; /** Releases all resources associated with the FrameBuffer. */ dispose(): void; /** Makes the frame buffer current so everything gets drawn to it. */ bind(): void; /** Unbinds the framebuffer, all drawing will be performed to the normal framebuffer from here on. */ unbind(): void; /** Binds the frame buffer and sets the viewport accordingly, so everything gets drawn to it. */ begin(): void; /** Unbinds the framebuffer, all drawing will be performed to the normal framebuffer from here on. */ endSimple(): void; /** Unbinds the framebuffer and sets viewport sizes, all drawing will be performed to the normal framebuffer from here on. * * @param x The x-axis position of the viewport in pixels * @param y The y-asis position of the viewport in pixels * @param width The width of the viewport in pixels * @param height The height of the viewport in pixels */ end(x: number, y: number, width: number, height: number): void; } //# sourceMappingURL=FrameBuffer.d.ts.map