add_resize_callback


Description:

public OnscreenResizeClosure add_resize_callback (OnscreenResizeCallback callback, UserDataDestroyCallback? destroy)

Registers a callback with this that will be called whenever the this framebuffer changes size.

The callback can be removed using remove_resize_callback passing the returned closure pointer.

<note>Since Cogl automatically updates the viewport of an this framebuffer that is resized, a resize callback can also be used to track when the viewport has been changed automatically by Cogl in case your application needs more specialized control over the viewport.</note>

<note>A resize callback will only ever be called while dispatching Cogl events from the system mainloop; so for example during poll_renderer_dispatch. This is so that callbacks shouldn't occur while an application might have arbitrary locks held for example.</note>

Parameters:

this

A Onscreen framebuffer

callback

A OnscreenResizeCallback to call when the this changes size.

destroy

An optional callback to destroy user_data when the callback is removed or this is freed.

user_data

Private data to be passed to callback.

Returns:

a OnscreenResizeClosure pointer that can be used to remove the callback and associated user_data later.