Callbacks

DebugObjectForeachTypeCallback (info, *user_data)

FeatureCallback (feature, *user_data)

FenceCallback (fence, *user_data)

FrameCallback (onscreen, event, info, *user_data)

FuncPtr ()

MetaTextureCallback (sub_texture, sub_texture_coords, meta_coords, *user_data)

OnscreenDirtyCallback (onscreen, info, *user_data)

OnscreenResizeCallback (onscreen, width, height, *user_data)

OnscreenX11MaskCallback (onscreen, event_mask, *user_data)

OutputCallback (output, *user_data)

PipelineLayerCallback (pipeline, layer_index, *user_data)

PrimitiveAttributeCallback (primitive, attribute, *user_data)

SwapBuffersNotify (framebuffer, *user_data)

Details

Cogl.DebugObjectForeachTypeCallback(info, *user_data)
Parameters:

A callback function to use for Cogl.debug_object_foreach_type().

New in version 1.8.

Cogl.FeatureCallback(feature, *user_data)
Parameters:

A callback used with Cogl.foreach_feature() for enumerating all context level features supported by Cogl.

New in version 0.10.

Cogl.FenceCallback(fence, *user_data)
Parameters:
  • fence (Cogl.Fence) – Unused. In the future this parameter may be used to pass extra information about the fence completion but for now it should be ignored.

  • user_data (object or None) – The private data passed to cogl_framebuffer_add_fence_callback()

The callback prototype used with cogl_framebuffer_add_fence_callback() for notification of GPU command completion.

New in version 2.0.

Cogl.FrameCallback(onscreen, event, info, *user_data)
Parameters:

Is a callback that can be registered via Cogl.Onscreen.add_frame_callback() to be called when a frame progresses in some notable way.

Please see the documentation for Cogl.FrameEvent and Cogl.Onscreen.add_frame_callback() for more details about what events can be notified.

New in version 1.14.

Cogl.FuncPtr()

The type used by cogl for function pointers, note that this type is used as a generic catch-all cast for function pointers and the actual arguments and return type may be different.

Cogl.MetaTextureCallback(sub_texture, sub_texture_coords, meta_coords, *user_data)
Parameters:
  • sub_texture (Cogl.Texture) – A low-level Cogl.Texture making up part of a #CoglMetaTexture.

  • sub_texture_coords (float) – A float 4-tuple ordered like (tx1,ty1,tx2,ty2) defining what region of the current sub_texture maps to a sub-region of a #CoglMetaTexture. (tx1,ty1) is the top-left sub-region coordinate and (tx2,ty2) is the bottom-right. These are low-level texture coordinates.

  • meta_coords (float) – A float 4-tuple ordered like (tx1,ty1,tx2,ty2) defining what sub-region of a #CoglMetaTexture this low-level sub_texture maps too. (tx1,ty1) is the top-left sub-region coordinate and (tx2,ty2) is the bottom-right. These are high-level meta-texture coordinates.

  • user_data (object or None) – A private pointer passed to cogl_meta_texture_foreach_in_region().

A callback used with cogl_meta_texture_foreach_in_region() to retrieve details of all the low-level Cogl.Texture s that make up a given #CoglMetaTexture.

New in version 1.10.

Cogl.OnscreenDirtyCallback(onscreen, info, *user_data)
Parameters:

Is a callback that can be registered via Cogl.Onscreen.add_dirty_callback() to be called when the windowing system determines that a region of the onscreen window has been lost and the application should redraw it.

New in version 1.16.

Cogl.OnscreenResizeCallback(onscreen, width, height, *user_data)
Parameters:

Is a callback type used with the Cogl.Onscreen.add_resize_callback() allowing applications to be notified whenever an onscreen framebuffer is resized.

Cogl automatically updates the viewport of an onscreen framebuffer that is resized so this callback is also an indication that the viewport has been modified too A resize callback will only ever be called while dispatching Cogl events from the system mainloop; so for example during Cogl.poll_renderer_dispatch(). This is so that callbacks shouldn’t occur while an application might have arbitrary locks held for example.

New in version 2.0.

Cogl.OnscreenX11MaskCallback(onscreen, event_mask, *user_data)
Parameters:
Cogl.OutputCallback(output, *user_data)
Parameters:

A callback type that can be passed to Cogl.Renderer.foreach_output() for iterating display outputs for a given renderer.

New in version 1.14.

Cogl.PipelineLayerCallback(pipeline, layer_index, *user_data)
Parameters:
Return type:

int

The callback prototype used with Cogl.Pipeline.foreach_layer() for iterating all the layers of a pipeline.

New in version 2.0.

Cogl.PrimitiveAttributeCallback(primitive, attribute, *user_data)
Parameters:
Return type:

int

The callback prototype used with Cogl.Primitive.foreach_attribute() for iterating all the attributes of a Cogl.Primitive.

The function should return True to continue iteration or False to stop.

New in version 1.10.

Cogl.SwapBuffersNotify(framebuffer, *user_data)
Parameters: