---
name: "waffle_window"
section: "3"
platform: "linux"
package: "libwaffle-doc"
version: "1.8.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/waffle_window"
---

# waffle\_window(3)

class waffle\_window

## NAME

waffle\_window, waffle\_window\_create, waffle\_window\_destroy, waffle\_window\_show, waffle\_window\_swap\_buffers, waffle\_window\_get\_native - class waffle\_window

## SYNOPSIS

```
#include <waffle.h>
struct waffle_window;
```

**struct waffle\_window\* waffle\_window\_create(struct waffle\_window \****config***, int32\_t** *width***, int32\_t** *height***);**

**struct waffle\_window\* waffle\_window\_create2(struct waffle\_window \****config***, const intptr\_t** *attrib\_list***\[\]);**

**bool waffle\_window\_destroy(struct waffle\_window \****self***);**

**bool waffle\_window\_show(struct waffle\_window \****self***);**

**bool waffle\_window\_swap\_buffers(struct waffle\_window \****self***);**

**union waffle\_native\_window\* waffle\_window\_get\_native(struct waffle\_window \****self***);**

## DESCRIPTION

**struct waffle\_window**

An opaque type.

**waffle\_window\_create()**

Create a window with the properties specified by *config*.

If the platform allows, the window is not displayed onto the screen after creation. To display the window, call **waffle\_window\_show()**.

**waffle\_window\_create2()**

Feature test macro: WAFFLE\_API\_VERSION \>= 0x0106. (See [**waffle\_feature\_test\_macros**(7)](/waffle_feature_test_macros/7.md)).

Create a window with the properties specified by *config* and *attrib\_list*. *attrib\_list* must specify the window size either with the attributes **WAFFLE\_WINDOW\_WIDTH** and **WAFFLE\_WINDOW\_HEIGHT** having positive values \<= **INT32\_MAX**, or with the attribute **WAFFLE\_WINDOW\_FULLSCREEN** equal to [true(1)](/true/1.md).

**waffle\_window\_destroy()**

Destroy the window and release its memory.

**waffle\_window\_show()**

Show the window on the display. If the window is already shown, or if the native platform does not support showing windows (such as GBM), then do nothing and returns true.

**waffle\_window\_swap\_buffers()**

If the window is double-buffered, then implicitly call **glFlush()** and post the contents of the back buffer to the front buffer. If the window is front-buffered, then do nothing. For platform-specific details of swap semantics, see the specification for the relevant native platform: the **GLX 1.4 Specification**\[1\], the **EGL 1.4 Specification**\[2\], or the **CGL Reference**\[3\].

**waffle\_window\_get\_native()**

Get the window's underlying native objects. Use [**free**(3)](/free/3.md) to deallocate the returned pointer. See [**waffle\_native**(3)](/waffle_native/3.md) for the definition of **union waffle\_native\_window**.

## RETURN VALUE

Functions whose return type is **bool** return true on success and false on failure. Functions whose return type is a pointer return **NULL** on failure. Use [**waffle\_error\_get\_info**(3)](/waffle_error_get_info/3.md) to get information about any errors.

## ERRORS

See [**waffle\_error**(3)](/waffle_error/3.md) for the complete list of waffle's error codes.

No errors are specific to the **waffle\_window** functions.

## ISSUES

Please report bugs or and feature requests to **https://gitlab.freedesktop.org/mesa/waffle/issues**.

## SEE ALSO

[**waffle**(7)](/waffle/7.md)

## AUTHOR

**Chad Versace** \<chad.versace@linux.intel.com\>

Former maintainer

## COPYRIGHT

Copyright © 2013 Intel\

This manual page is licensed under the Creative Commons Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0). To view a copy of this license, visit **http://creativecommons.org.license/by-sa/3.0/us**.

## NOTES

- 1\.

  GLX 1.4 Specification

  http://www.opengl.org/registry/doc/glx1.4.pdf

- 2\.

  EGL 1.4 Specification

  http://www.khronos.org/registry/egl/specs/eglspec.1.4.20110406.pdf

- 3\.

  CGL Reference

  https://developer.apple.com/library/mac/#documentation/graphicsimaging/reference/CGL\_OpenGL/Reference/reference.html
