### Constructor

# Cogl Display new

#### Declaration [src]

    CoglDisplay*
    cogl_display_new (
      CoglRenderer* renderer,
      CoglOnscreenTemplate* onscreen_template
    )

#### Description [src]

Explicitly allocates a new `CoglDisplay` object to encapsulate the common state of the display pipeline that applies to the whole application.

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 cogl_display_set_onscreen_template().

When a display is first allocated via `cogl_display_new()` 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 `cogl_display_setup()` to explicitly apply the configuration and check for errors. Alternaitvely you can pass the display to `cogl_context_new()` 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.

#### Parameters

`renderer`

  Type: `CoglRenderer`

  A `CoglRenderer`.

  The data is owned by the caller of the function.

`onscreen_template`

  Type: `CoglOnscreenTemplate`

  A `CoglOnscreenTemplate`.

  The data is owned by the caller of the function.

#### Return value

Type: `CoglDisplay`

A newly allocated `CoglDisplay` object in a mutable configuration mode.

The caller of the function takes ownership of the data, and is responsible for freeing it.