summaryrefslogtreecommitdiff
path: root/cogl/cogl-onscreen-template-private.h
Commit message (Collapse)AuthorAgeFilesLines
* This re-licenses Cogl under the MIT licenseRobert Bragg2014-01-141-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This follows up on the proposal that was sent to the Cogl mailing list to re-license from the LGPL to the MIT license: http://lists.freedesktop.org/archives/cogl/2013-December/001465.html Note: there was a copyright assignment policy in place for Clutter (and therefore Cogl which was part of Clutter at the time) until the 11th of June 2010 and so we only checked the details after that point (commit 0bbf50f905) For each file, authors were identified via this Git command: $ git blame -p -C -C -C20 -M -M10 0bbf50f905..HEAD We received blanket approvals for re-licensing all Red Hat and Collabora contributions which reduced how many people needed to be contacted individually: - http://lists.freedesktop.org/archives/cogl/2013-December/001470.html - http://lists.freedesktop.org/archives/cogl/2014-January/001536.html Individual approval requests were sent to all the other identified authors who all confirmed the re-license on the Cogl mailinglist: http://lists.freedesktop.org/archives/cogl/2014-January As well as updating the copyright header in all sources files, the COPYING file has been updated to reflect the license change and also document the other licenses used in Cogl such as the SGI Free Software License B, version 2.0 and the 3-clause BSD license.
* Removes the CoglSwapChain apiRobert Bragg2013-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The CoglSwapChain api made initializing a context more awkward than it ought to be in the relatively common case where you want onscreen framebuffers to have an alpha channel. The api let you specify an explicit swap-chain length and also request that the swap chain buffers should have an alpha component and then the a CoglSwapChain could be used to construct a CoglOnscreenTemplate This removes the CoglSwapChain object and apis and adds a cogl_onscreen_template_set_has_alpha() api instead. Since we can't normally control exactly how long the swap chain is even if we have api to request a length this patch doesn't replace that capability. One thing to note here is that this removes the ability to request a single buffered CoglOnscreen framebuffer but since we have never had a use case for that and have not generally considered the implications of supporting single buffered rendering in Cogl's design it is probably for the best not to imply that it's supported. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* framebuffer: split out CoglOnscreen codeRobert Bragg2011-11-011-0/+1
| | | | | | | | | | This factors out the CoglOnscreen code from cogl-framebuffer.c so we now have cogl-onscreen.c, cogl-onscreen.h and cogl-onscreen-private.h. Notably some of the functions pulled out are currently namespaced as cogl_framebuffer but we know we are planning on renaming them to be in the cogl_onscreen namespace; such as cogl_framebuffer_swap_buffers(). Reviewed-by: Neil Roberts <neil@linux.intel.com>
* Rework how we search for winsys configsRobert Bragg2011-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | When creating new onscreen framebuffers we need to take the configuration in cogl terms and translate that into a configuration applicable to any given winsys, e.g. an EGLConfig or a GLXFBConfig or a PIXELFORMATDESCRIPTOR. Also when we first create a context we typically have to do a very similar thing because most OpenGL winsys APIs also associate a framebuffer config with the context and all future configs need to be compatible with that. This patch introduces an internal CoglFramebufferConfig to wrap up some of the configuration parameters that are common to CoglOnscreenTemplate and to CoglFramebuffer so we aim to re-use code when dealing with the above two problems. This patch also aims to rework the winsys code so it can be more naturally extended as we start adding more configureability to how onscreen framebuffers are created. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* Adds renderer,display,onscreen-template and swap-chain stubsRobert Bragg2011-04-111-0/+37
As part of the process of splitting Cogl out as a standalone graphics API we need to introduce some API concepts that will allow us to initialize a new CoglContext when Clutter isn't there to handle that for us... The new objects roughly in the order that they are (optionally) involved in constructing a context are: CoglRenderer, CoglOnscreenTemplate, CoglSwapChain and CoglDisplay. Conceptually a CoglRenderer represents a means for rendering. Cogl supports rendering via OpenGL or OpenGL ES 1/2.0 and those APIs are accessed through a number of different windowing APIs such as GLX, EGL, SDL or WGL and more. Potentially in the future Cogl could render using D3D or even by using libdrm and directly banging the hardware. All these choices are wrapped up in the configuration of a CoglRenderer. Conceptually a CoglDisplay represents a display pipeline for a renderer. Although Cogl doesn't aim to provide a detailed abstraction of display hardware, on some platforms we can give control over multiple display planes (On TV platforms for instance video content may be on one plane and 3D would be on another so a CoglDisplay lets you select the plane up-front.) Another aspect of CoglDisplay is that it lets us negotiate a display pipeline that best supports the type of CoglOnscreen framebuffers we are planning to create. For instance if you want transparent CoglOnscreen framebuffers then we have to be sure the display pipeline wont discard the alpha component of your framebuffers. Or if you want to use double/tripple buffering that requires support from the display pipeline. CoglOnscreenTemplate and CoglSwapChain are how we describe our default CoglOnscreen framebuffer configuration which can affect the configuration of the display pipeline. The default/simple way we expect most CoglContexts to be constructed will be via something like: if (!cogl_context_new (NULL, &error)) g_error ("Failed to construct a CoglContext: %s", error->message); Where that NULL is for an optional "display" parameter and NULL says to Cogl "please just try to do something sensible". If you want some more control though you can manually construct a CoglDisplay something like: display = cogl_display_new (NULL, NULL); cogl_gdl_display_set_plane (display, plane); if (!cogl_display_setup (display, &error)) g_error ("Failed to setup a CoglDisplay: %s", error->message); And in a similar fashion to cogl_context_new() you can optionally pass a NULL "renderer" and/or a NULL "onscreen template" so Cogl will try to just do something sensible. If you need to change the CoglOnscreen defaults you can provide a template something like: chain = cogl_swap_chain_new (); cogl_swap_chain_set_has_alpha (chain, TRUE); cogl_swap_chain_set_length (chain, 3); onscreen_template = cogl_onscreen_template_new (chain); cogl_onscreen_template_set_pixel_format (onscreen_template, COGL_PIXEL_FORMAT_RGB565); display = cogl_display_new (NULL, onscreen_template); if (!cogl_display_setup (display, &error)) g_error ("Failed to setup a CoglDisplay: %s", error->message);