Cogl.Renderer.new
function new(): Cogl.Renderer {
// Gjs wrapper for cogl_renderer_new()
}
Instantiates a new (unconnected) Cogl.Renderer object. A Cogl.Renderer represents a means to render. It encapsulates the selection of an underlying driver, such as OpenGL or OpenGL-ES and a selection of a window system binding API such as GLX, or EGL or WGL.
While the renderer is unconnected it can be configured so that applications may specify backend constraints, such as "must use x11" for example via Cogl.Renderer.prototype.add_constraint.
There are also some platform specific configuration apis such as cogl_xlib_renderer_set_foreign_display() that may also be used while the renderer is unconnected.
Once the renderer has been configured, then it may (optionally) be explicitly connected using Cogl.Renderer.prototype.connect which allows errors to be handled gracefully and potentially fallback configurations can be tried out if there are initial failures.
If a renderer is not explicitly connected then Cogl.Display.new will automatically connect the renderer for you. If you don't have any code to deal with error/fallback situations then its fine to just let Cogl do the connection for you.
Once you have setup your renderer then the next step is to create a Cogl.Display using Cogl.Display.new.
<note>Many applications don't need to explicitly use Cogl.Renderer.new or Cogl.Display.new and can just jump straight to Cogl.Context.new and pass a null display argument so Cogl will automatically connect and setup a renderer and display.</note>
Since 1.10
- Returns
A newly created Cogl.Renderer.