add_repaint_func


Description:


[ Version ( since = "1.0" ) ]
public uint add_repaint_func (owned SourceFunc func)

Adds a function to be called whenever Clutter is processing a new frame.

If the function returns false it is automatically removed from the list of repaint functions and will not be called again.

This function is guaranteed to be called from within the same thread that called main, and while the Clutter lock is being held; the function will be called within the main loop, so it is imperative that it does not block, otherwise the frame time budget may be lost.

A repaint function is useful to ensure that an update of the scenegraph is performed before the scenegraph is repainted; for instance, uploading a frame from a video into a Texture. By default, a repaint function added using this function will be invoked prior to the frame being processed.

Adding a repaint function does not automatically ensure that a new frame will be queued.

When the repaint function is removed (either because it returned false or because remove_repaint_func has been called) the notify function will be called, if any is set.

See also: add_repaint_func_full

Parameters:

func

the function to be called within the paint cycle

data

data to be passed to the function, or null

notify

function to be called when removing the repaint function, or null

Returns:

the ID (greater than 0) of the repaint function. You can use the returned integer to remove the repaint function by calling remove_repaint_func.


Namespace: Clutter.Threads
Package: clutter-1.0



2022 vala-language.org