Explicitly allocates a new Display object to encapsulate the common state of the display pipeline that applies to the whole application.
<note>Many applications don't need to explicitly use Display and can just jump straight to Context and pass a null display argument so Cogl will automatically connect and setup a renderer and display.</note>
A display
can only be made for a specific choice of renderer which is why this takes the renderer
argument.
A common use for explicitly allocating a display object is to define a template for allocating onscreen framebuffers which is what the
onscreen_template
argument is for, or alternatively you can use
set_onscreen_template.
When a display is first allocated via Display it is in a mutable configuration mode. It's designed this way so we can extend the apis available for configuring a display without requiring huge numbers of constructor arguments.
When you have finished configuring a display object you can optionally call setup to explicitly apply the configuration and check for errors. Alternaitvely you can pass the display to Context and Cogl will implicitly apply your configuration but if there are errors then the application will abort with a message. For simple applications with no fallback options then relying on the implicit setup can be fine.
renderer |
A Renderer |
onscreen_template |
A newly allocated Display object in a mutable configuration mode. |