---
name: "glReadBuffer"
section: "3x"
platform: "linux"
package: "xlibmesa-gl-dev"
version: "4.3.0.dfsg.1-14sarge7"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/glReadBuffer"
---

# glReadBuffer(3x)

select a color buffer source for pixels

## NAME

**glReadBuffer** - select a color buffer source for pixels

## C SPECIFICATION

void **glReadBuffer**( GLenum *mode* )

```

```

## PARAMETERS

- *mode*

  Specifies a color buffer. Accepted values are **GL\_FRONT\_LEFT**, **GL\_FRONT\_RIGHT**, **GL\_BACK\_LEFT**, **GL\_BACK\_RIGHT**, **GL\_FRONT**, **GL\_BACK**, **GL\_LEFT**, **GL\_RIGHT**, and **GL\_AUX***i*, where *i* is between 0 and **GL\_AUX\_BUFFERS** -1.

## DESCRIPTION

**glReadBuffer** specifies a color buffer as the source for subsequent **glReadPixels**, **glCopyTexImage1D**, **glCopyTexImage2D**, **glCopyTexSubImage1D**, **glCopyTexSubImage2D**, **glCopyTexSubImage3D**, and **glCopyPixels** commands.  *mode* accepts one of twelve or more predefined values. (**GL\_AUX0** through **GL\_AUX3** are always defined.) In a fully configured system, **GL\_FRONT**, **GL\_LEFT**, and **GL\_FRONT\_LEFT** all name the front left buffer, **GL\_FRONT\_RIGHT** and **GL\_RIGHT** name the front right buffer, and **GL\_BACK\_LEFT** and **GL\_BACK** name the back left buffer.

Nonstereo double-buffered configurations have only a front left and a back left buffer. Single-buffered configurations have a front left and a front right  buffer if stereo, and only a front left buffer if nonstereo. It is an error to specify a nonexistent buffer to **glReadBuffer**.

*mode* is initially **GL\_FRONT** in single-buffered configurations, and **GL\_BACK** in double-buffered configurations.

## ERRORS

**GL\_INVALID\_ENUM** is generated if *mode* is not one of the twelve (or more) accepted values.

**GL\_INVALID\_OPERATION** is generated if *mode* specifies a buffer that does not exist.

**GL\_INVALID\_OPERATION** is generated if **glReadBuffer** is executed between the execution of **glBegin** and the corresponding execution of **glEnd**.

## ASSOCIATED GETS

**glGet** with argument **GL\_READ\_BUFFER**

## SEE ALSO

**glCopyPixels(3G)**, **glCopyTexImage1D(3G)**, **glCopyTexImage2D(3G)**, **glCopyTexSubImage1D(3G)**, **glCopyTexSubImage2D(3G)**, **glCopyTexSubImage3D(3G)**, **glDrawBuffer(3G)**, **glReadPixels(3G)**
