2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
8 This manual page is licensed under the Creative Commons Attribution-ShareAlike 3.0 United States License (CC BY-SA 3.0
9 US). To view a copy of this license, visit http://creativecommons.org.license/by-sa/3.0/us.
14 xmlns:xi="http://www.w3.org/2001/XInclude">
16 <!-- See http://www.docbook.org/tdg/en/html/refentry.html. -->
19 <refentrytitle>waffle_display</refentrytitle>
20 <manvolnum>3</manvolnum>
24 <refname>waffle_display</refname>
25 <refname>waffle_display_connect</refname>
26 <refname>waffle_display_disconnect</refname>
27 <refname>waffle_display_supports_context_api</refname>
28 <refname>waffle_display_get_native</refname>
29 <refpurpose>class <classname>waffle_display</classname></refpurpose>
33 <title>Waffle Manual</title>
34 <productname>waffle</productname>
35 <xi:include href="common/author-lina.versace.xml"/>
36 <xi:include href="common/copyright.xml"/>
37 <xi:include href="common/legalnotice.xml"/>
42 <funcsynopsis language="C">
45 #include <waffle.h>
47 struct waffle_display;
51 <funcdef>struct waffle_display* <function>waffle_display_connect</function></funcdef>
52 <paramdef>const char* <parameter>name</parameter></paramdef>
56 <funcdef>bool <function>waffle_display_disconnect</function></funcdef>
57 <paramdef>struct waffle_display *<parameter>self</parameter></paramdef>
61 <funcdef>bool <function>waffle_display_supports_context_api</function></funcdef>
62 <paramdef>struct waffle_display *<parameter>self</parameter></paramdef>
63 <paramdef>int32_t <parameter>context_api</parameter></paramdef>
67 <funcdef>union waffle_native_display* <function>waffle_display_get_native</function></funcdef>
68 <paramdef>struct waffle_display *<parameter>self</parameter></paramdef>
75 <title>Description</title>
80 <term><type>struct waffle_display</type></term>
89 <term><function>waffle_display_connect()</function></term>
92 Connect to a display. The interpretation of <parameter>name</parameter> differs according to the platform
93 given to <citerefentry><refentrytitle><function>waffle_init</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>.
96 On Android, CGL and WGL <parameter>name</parameter> is ignored.
99 On the X11 platforms, GLX and X11/EGL, the function connects to the X11 display with the given
100 <parameter>name</parameter>. If <parameter>name</parameter> is null, then it uses the value of the
101 environment variable <envar>DISPLAY</envar>.
104 On Wayland, the function connects to the Wayland display with the given name. If <parameter>name</parameter> is null, then it
105 uses the value of the environment variable <envar>WAYLAND_DISPLAY</envar>.
108 On GBM, the function opens the device at the filepath <parameter>name</parameter>.
110 If <parameter>name</parameter> is NULL, then the function uses the value of environment variable
111 <envar>WAFFLE_GBM_DEVICE</envar>.
113 If <parameter>name</parameter> is null and <envar>WAFFLE_GBM_DEVICE</envar> is unset, then the function
114 iterates using libdrm through the set of card devices in the drm subsystem, which are usually located in
115 <filename>/dev/dri</filename>, and attempts to open each in turn with <code>open(O_RDWR | O_CLOEXEC)</code>
122 <term><function>waffle_display_disconnect()</function></term>
125 Disconnect from the <type>waffle_display</type> and release it's memory. All pointers to waffle objects that
126 were created with the display become invalid.
132 <term><function>waffle_display_supports_context_api()</function></term>
135 Check if the display is capable of creating
136 a <citerefentry><refentrytitle><function>waffle_context</function></refentrytitle><manvolnum>3</manvolnum></citerefentry> with
137 the given <parameter>context_api</parameter>. See
138 <citerefentry><refentrytitle><function>waffle_config</function></refentrytitle><manvolnum>3</manvolnum></citerefentry> for
139 choices of <parameter>context_api</parameter> and expectations for each platform.
145 <term><function>waffle_display_get_native()</function></term>
148 Get the display's underlying native objects. Use
149 <citerefentry><refentrytitle><function>free</function></refentrytitle><manvolnum>3</manvolnum></citerefentry> to deallocate the
151 See <citerefentry><refentrytitle><function>waffle_native</function></refentrytitle><manvolnum>3</manvolnum></citerefentry>
152 for the definition of <type>union waffle_native_display</type>.
161 <title>Return Value</title>
162 <xi:include href="common/return-value.xml"/>
166 <title>Errors</title>
168 <xi:include href="common/error-codes.xml"/>
171 No errors are specific to any of the <type>waffle_display</type> functions.
175 <xi:include href="common/issues.xml"/>
178 <title>See Also</title>
180 <citerefentry><refentrytitle>waffle</refentrytitle><manvolnum>7</manvolnum></citerefentry>
187 vim:tw=120 et ts=2 sw=2: