---
name: "VIRTUAL_W"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/VIRTUAL_W"
---

# VIRTUAL\_W(3alleg)

Global define to obtain the virtual size of the screen. Allegro game programming library.

## NAME

VIRTUAL\_W, VIRTUAL\_H - Global define to obtain the virtual size of the screen. Allegro game programming library.

## SYNOPSIS

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

**#define VIRTUAL\_W;**

**#define VIRTUAL\_H;**

## DESCRIPTION

Global defines that return the width and height of the virtual screen, or zero if the screen has not been initialised yet. Example:

```
   char buf[100];
   ...
   uszprintf(buf, sizeof(buf),
             "The virtual screen size is %d x %d pixels",
             SCREEN_W, SCREEN_H);
```

## SEE ALSO

[**screen**(3alleg)](/screen/3alleg.md), [**set\_gfx\_mode**(3alleg)](/set_gfx_mode/3alleg.md), [**SCREEN\_W**(3alleg)](/SCREEN_W/3alleg.md), [**SCREEN\_H**(3alleg)](/SCREEN_H/3alleg.md)
