package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Renderer

type t = [ `renderer | `object_ ] Gobject.obj
val new_for_surface : Ocgtk_gdk.Gdk.Wrappers.Surface.t -> t

Create a new Renderer

val unrealize : t -> unit

Releases all the resources created by gsk_renderer_realize().

val render_texture : t -> [ `render_node ] Gobject.obj -> Ocgtk_graphene.Graphene.Wrappers.Rect.t option -> Ocgtk_gdk.Gdk.Wrappers.Texture.t

Renders the scene graph, described by a tree of `GskRenderNode` instances, to a `GdkTexture`.

The @renderer will acquire a reference on the `GskRenderNode` tree while the rendering is in progress.

If you want to apply any transformations to @root, you should put it into a transform node and pass that node instead.

val render : t -> [ `render_node ] Gobject.obj -> Ocgtk_cairo.Cairo.Wrappers.Region.t option -> unit

Renders the scene graph, described by a tree of `GskRenderNode` instances to the renderer's surface, ensuring that the given @region gets redrawn.

If the renderer has no associated surface, this function does nothing.

Renderers must ensure that changes of the contents given by the @root node as well as the area given by @region are redrawn. They are however free to not redraw any pixel outside of @region if they can guarantee that it didn't change.

The @renderer will acquire a reference on the `GskRenderNode` tree while the rendering is in progress.

val realize_for_display : t -> Ocgtk_gdk.Gdk.Wrappers.Display.t -> (bool, GError.t) result

Creates the resources needed by the @renderer to render the scene graph.

Note that it is mandatory to call method@Gsk.Renderer.unrealize before destroying the renderer.

val realize : t -> Ocgtk_gdk.Gdk.Wrappers.Surface.t option -> (bool, GError.t) result

Creates the resources needed by the @renderer to render the scene graph.

Since GTK 4.6, the surface may be `NULL`, which allows using renderers without having to create a surface. Since GTK 4.14, it is recommended to use method@Gsk.Renderer.realize_for_display instead.

Note that it is mandatory to call method@Gsk.Renderer.unrealize before destroying the renderer.

val is_realized : t -> bool

Checks whether the @renderer is realized or not.

val get_surface : t -> Ocgtk_gdk.Gdk.Wrappers.Surface.t option

Retrieves the `GdkSurface` set using gsk_enderer_realize().

If the renderer has not been realized yet, %NULL will be returned.

val get_realized : t -> bool

Get property: realized