---
name: "vga_addmode"
section: "3"
platform: "linux"
package: "libsvga1-dev"
version: "1:1.4.3-33"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/vga_addmode"
---

# vga\_addmode(3)

add a mode to svgalib modes list

## NAME

vga\_addmode - add a mode to svgalib modes list

## SYNOPSIS

**#include \<vga.h\>**

**int vga\_addmode(int width, int height, int num\_cols, int offset, int bytesperpixel )**

## DESCRIPTION

Adds a mode to the list of modes, with the given parameters.  The function returns the mode number. If such a mode already exists on the list, its number is returned, and no mode is added.

## NOTE

Adding a mode to the list is not enough in order to use it. There must also be a timing line that fits that mode. This can be added either as a modeline in the config file, or with one of the functions [**vga\_addtiming**(3)](/vga_addtiming/3.md) and [**vga\_guesstiming**(3)](/vga_guesstiming/3.md).

## SEE ALSO

[**vga\_addtiming**(3)](/vga_addtiming/3.md) [**vga\_guesstiming**(3)](/vga_guesstiming/3.md) **addmodetest**(6)

## AUTHOR

This manual page was written by Matan Ziv-Av
