---
name: "glMatrixMode"
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/glMatrixMode"
---

# glMatrixMode(3x)

specify which matrix is the current matrix

## NAME

**glMatrixMode** - specify which matrix is the current matrix

## C SPECIFICATION

void **glMatrixMode**( GLenum *mode* )

```

```

## PARAMETERS

- *mode*

  Specifies which matrix stack is the target for subsequent matrix operations. Three values are accepted: **GL\_MODELVIEW**, **GL\_PROJECTION**, and **GL\_TEXTURE**. The initial value is **GL\_MODELVIEW**.

  Additionally, if the **GL\_ARB\_imaging** extension is supported, **GL\_COLOR** is also accepted.

## DESCRIPTION

**glMatrixMode** sets the current matrix mode. *mode* can assume one of four values:

- **GL\_MODELVIEW**

  Applies subsequent matrix operations to the modelview matrix stack.

- **GL\_PROJECTION**

  Applies subsequent matrix operations to the projection matrix stack.

- **GL\_TEXTURE**

  Applies subsequent matrix operations to the texture matrix stack.

- **GL\_COLOR**

  Applies subsequent matrix operations to the color matrix stack.

To find out which matrix stack is currently the target of all matrix operations, call **glGet** with argument **GL\_MATRIX\_MODE**. The initial value is **GL\_MODELVIEW**.

## ERRORS

**GL\_INVALID\_ENUM** is generated if *mode* is not an accepted value.

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

## ASSOCIATED GETS

**glGet** with argument **GL\_MATRIX\_MODE**

## SEE ALSO

**glLoadMatrix(3G)**, **glPushMatrix(3G)**
