<commit_before>pc.extend(pc.gfx, function () {
    /**
     * @name pc.gfx.RenderTarget
     * @class A frame buffer is a rectangular rendering surface. It can be rendered to via a pc.gfx.RenderTarget.
     * @param {number} width The width of the frame buffer in pixels.
     * @param {number} height The height of the frame buffer in pixels.
     * @param {boolean} depth True if the frame buffer is to include a depth buffer and false otherwise.
     */
    var RenderTarget = function (framebuffer, viewport) {
        this._framebuffer = framebuffer || pc.gfx.FrameBuffer.getBackBuffer();
        this._viewport = viewport ||
            {
                x: 0,
                y: 0,
                width: this._framebuffer.getWidth(),
                height: this._framebuffer.getHeight()
            };
    };

    /**
     * @function
     * @name pc.gfx.RenderTarget#setViewport
     * @description 
     * @param {Object} viewport
     * @author <NAME>
     */
    RenderTarget.prototype.setViewport = function (viewport) {
        this._viewport = viewport;
    };

    /**
     * @function
     * @name pc.gfx.RenderTarget#getViewport
     * @description 
     * @returns {Object}
     * @author <NAME>
     */
    RenderTarget.prototype.getViewport = function () {
        return this._viewport;
    };

    /**
     * @function
     * @name pc.gfx.RenderTarget#setFrameBuffer
     * @description 
     * @param {pc.gfx.RenderTarget} framebuffer
     * @author <NAME>
     */
    RenderTarget.prototype.setFrameBuffer = function (framebuffer) {
        this._framebuffer = framebuffer;
    };

    /**
     * @function
     * @name pc.gfx.RenderTarget#getFrameBuffer
     * @description 
     * @returns {pc.gfx.RenderTarget}
     * @author <NAME>
     */
    RenderTarget.prototype.getFrameBuffer = function () {
        return this._framebuffer;
    };

    /**
     * @function
     * @name pc.gfx.RenderTarget#bind
     * @description 
     * @author <NAME>
     */
    RenderTarget.prototype.bind = function () {
        var gl = pc.gfx.Device.getCurrent().gl;
        gl.viewport(this._viewport.x, this._viewport.y, this._viewport.width, this._viewport.height);
        gl.scissor(this._viewport.x, this._viewport.y, this._viewport.width, this._viewport.height);
        this._framebuffer.bind();
    };

    return {
        RenderTarget: RenderTarget
    }; 
}());<commit_msg>Improved docs for pc.gfx.RenderTarget.<commit_after>pc.extend(pc.gfx, function () {
    /**
     * @name pc.gfx.RenderTarget
     * @class A render target is a viewport onto a frame buffer.
     * @param {pc.gfx.FrameBuffer} width The width of the frame buffer in pixels.
     * @param {Object} viewport The viewport to set with the following members:
     * @param {Number} viewport.x The top left corner x coordinate in pixel space.
     * @param {Number} viewport.y The top left corner y coordinate in pixel space.
     * @param {Number} viewport.width The viewport width in pixels.
     * @param {Number} viewport.height The viewport height in pixels.
     */
    var RenderTarget = function (framebuffer, viewport) {
        this._framebuffer = framebuffer || pc.gfx.FrameBuffer.getBackBuffer();
        this._viewport = viewport ||
            {
                x: 0,
                y: 0,
                width: this._framebuffer.getWidth(),
                height: this._framebuffer.getHeight()
            };
    };

    /**
     * @function
     * @name pc.gfx.RenderTarget#setViewport
     * @description Sets the viewport on the render target's frame buffer. The viewport is a
     * rectangular region specified by a top left corner coordinate and a width and height.
     * @param {Object} viewport The viewport to set with the following members:
     * @param {Number} viewport.x The top left corner x coordinate in pixel space.
     * @param {Number} viewport.y The top left corner y coordinate in pixel space.
     * @param {Number} viewport.width The viewport width in pixels.
     * @param {Number} viewport.height The viewport height in pixels.
     * @author <NAME>
     */
    RenderTarget.prototype.setViewport = function (viewport) {
        this._viewport = viewport;
    };

    /**
     * @function
     * @name pc.gfx.RenderTarget#getViewport
     * @description Returns the viewport used by the specified render target.
     * @returns {Object} The viewport for the specified render target.
     * @author <NAME>
     */
    RenderTarget.prototype.getViewport = function () {
        return this._viewport;
    };

    /**
     * @function
     * @name pc.gfx.RenderTarget#setFrameBuffer
     * @description Assigns a frame buffer to the render target. The frame buffer will
     * receive the results of all rendering output sent to this render target according
     * to the viewport.
     * @param {pc.gfx.RenderTarget} framebuffer The frame buffer to set on the specified render
     * target.
     * @author <NAME>
     */
    RenderTarget.prototype.setFrameBuffer = function (framebuffer) {
        this._framebuffer = framebuffer;
    };

    /**
     * @function
     * @name pc.gfx.RenderTarget#getFrameBuffer
     * @description Returns the frame buffer assigned to the specified render target.
     * @returns {pc.gfx.FrameBuffer} The frame buffer assigned to the render target.
     * @author <NAME>
     */
    RenderTarget.prototype.getFrameBuffer = function () {
        return this._framebuffer;
    };

    /**
     * @function
     * @name pc.gfx.RenderTarget#bind
     * @description Activates the specified render target to receive all subsequent rendering
     * output. All rendering will be clipped to the viewport of the render target and rendered
     * to the render target's frame buffer.
     * @author <NAME>
     */
    RenderTarget.prototype.bind = function () {
        var gl = pc.gfx.Device.getCurrent().gl;
        gl.viewport(this._viewport.x, this._viewport.y, this._viewport.width, this._viewport.height);
        gl.scissor(this._viewport.x, this._viewport.y, this._viewport.width, this._viewport.height);
        this._framebuffer.bind();
    };

    return {
        RenderTarget: RenderTarget
    }; 
}());
{'fraction_non_alphanumeric': 0.10477732793522267, 'fraction_numerical': 0.0006477732793522267, 'mean_word_length': 2.41404090657822, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2349582', 'n_tokens_mistral': 1746, 'n_tokens_neox': 1741, 'n_words': 504}