Cogl.Renderer¶
- Subclasses:
None
Methods¶
- Inherited:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
None
Fields¶
None
Class Details¶
- class Cogl.Renderer¶
- Bases:
- Abstract:
No
- classmethod new()¶
- Returns:
A newly created
Cogl.Renderer
.- Return type:
Instantiates a new (unconnected)
Cogl.Renderer
object. ACogl.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.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.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
usingCogl.Display.new
().Many applications don’t need to explicitly use
Cogl.Renderer.new
() orCogl.Display.new
() and can just jump straight toCogl.Context.new
() and pass aNone
display argument so Cogl will automatically connect and setup a renderer and display.New in version 1.10.
- add_constraint(constraint)¶
- Parameters:
constraint (
Cogl.RendererConstraint
) – ACogl.RendererConstraint
to add
This adds a renderer selection constraint.
Applications should ideally minimize how many of these constraints they depend on to ensure maximum portability.
New in version 1.10.
- check_onscreen_template(onscreen_template)¶
- Parameters:
onscreen_template (
Cogl.OnscreenTemplate
) – ACogl.OnscreenTemplate
- Raises:
- Returns:
- Return type:
Tests if a given onscreen_template can be supported with the given self.
New in version 1.10.
- connect()¶
- Raises:
- Returns:
True
if there was no error while connecting the given self.False
if there was an error.- Return type:
Connects the configured self. Renderer connection isn’t a very active process, it basically just means validating that any given constraint criteria can be satisfied and that a usable driver and window system backend can be found.
New in version 1.10.
- foreach_output(callback, *user_data)¶
- Parameters:
callback (
Cogl.OutputCallback
) – ACogl.OutputCallback
to be called for each display outputuser_data (
object
orNone
) – A user pointer to be passed to callback
Iterates all known display outputs for the given self and passes a corresponding
Cogl.Output
pointer to the given callback for each one, along with the given user_data.New in version 1.14.
- get_driver()¶
- Return type:
Queries what underlying driver is being used by Cogl.
This may only be called on a connected
Cogl.Renderer
.New in version 1.10.
- get_n_fragment_texture_units()¶
- Returns:
the number of texture image units.
- Return type:
Queries how many texture units can be used from fragment programs
New in version 1.8.
- get_winsys_id()¶
- Returns:
The
Cogl.WinsysID
corresponding to the chosen window system backend.- Return type:
Queries which window system backend Cogl has chosen to use.
This may only be called on a connected
Cogl.Renderer
.
- remove_constraint(constraint)¶
- Parameters:
constraint (
Cogl.RendererConstraint
) – ACogl.RendererConstraint
to remove
This removes a renderer selection constraint.
Applications should ideally minimize how many of these constraints they depend on to ensure maximum portability.
New in version 1.10.
- set_driver(driver)¶
- Parameters:
driver (
Cogl.Driver
) –
Requests that Cogl should try to use a specific underlying driver for rendering.
If you select an unsupported driver then
Cogl.Renderer.connect
() will fail and report an error. Most applications should not explicitly select a driver and should rely on Cogl automatically choosing the driver.This may only be called on an un-connected
Cogl.Renderer
.New in version 1.10.
- set_winsys_id(winsys_id)¶
- Parameters:
winsys_id (
Cogl.WinsysID
) – An ID of the winsys you explicitly want to use.
This allows you to explicitly select a winsys backend to use instead of letting Cogl automatically select a backend.
if you select an unsupported backend then
Cogl.Renderer.connect
() will fail and report an error.This may only be called on an un-connected
Cogl.Renderer
.