Clutter Wiki

Views
From ClutterProject
Jump to: navigation, search

CoglDisplay

  • Represents the configuration of a display pipeline.
  • Consider that if you are using a renderer that supports multiple windows, there may be top level constraints on the pixel formats that can be used for windows depending on the shared display pipeline that they all use. E.g. If your X server has a 24bit root window visual it doesn't make much sense to ask to create 16bit windows since that would imply a format conversion when presenting to the front buffer.
  • Note: A CoglDisplay does not have to represent a single physical display; it's possible (e.g. when using the X11 Xrandr extension) that a single CoglDisplay represents multiple physical displays.
display = cogl_display_new (renderer);
cogl_display_require_depth_support (&error);
cogl_display_require_stencil_support (&error);
cogl_display_require_stereo_support (&error);
cogl_display_require_double_buffering_support (&error);
cogl_display_request_color_bits (24, &error);
cogl_display_require_alpha_component (&error);
cogl_display_request_alpha_bits (8, &error);
cogl_display_set_overlay_level (1, &error);
cogl_display_get_transparency_key (&color, &error);
if (!cogl_display_setup (display, &error))
  g_critical ("Failed to commit to the given set of display constraints with "
              "the given renderer");
  • In OpenGL terms the fbconfig/pixel format associated with the GL context is chosen here.
  • Note the display becomes immutable if cogl_display_setup() succeeds.
  • Ideally a display object should start with a floating reference so you don't have to explicitly unref it after creating a CoglContext with it.
Personal tools