package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.gdk/Ocgtk_gdk/Gdk/Wrappers/Gl_texture_builder/index.html

Module Wrappers.Gl_texture_builder

type t = [ `gl_texture_builder | `object_ ] Gobject.obj
val new_ : unit -> t

Create a new GLTextureBuilder

val set_width : t -> int -> unit

Sets the width of the texture.

The width must be set before calling method@Gdk.GLTextureBuilder.build.

val set_update_texture : t -> [ `texture | `object_ ] Gobject.obj option -> unit

Sets the texture to be updated by this texture. See method@Gdk.GLTextureBuilder.set_update_region for an explanation.

val set_update_region : t -> Ocgtk_cairo.Cairo.Wrappers.Region.t option -> unit

Sets the region to be updated by this texture. Together with property@Gdk.GLTextureBuilder:update-texture this describes an update of a previous texture.

When rendering animations of large textures, it is possible that consecutive textures are only updating contents in parts of the texture. It is then possible to describe this update via these two properties, so that GTK can avoid rerendering parts that did not change.

An example would be a screen recording where only the mouse pointer moves.

val set_id : t -> int -> unit

Sets the texture id of the texture. The texture id must remain unmodified until the texture was finalized. See method@Gdk.GLTextureBuilder.build for a longer discussion.

The id must be set before calling method@Gdk.GLTextureBuilder.build.

val set_height : t -> int -> unit

Sets the height of the texture.

The height must be set before calling method@Gdk.GLTextureBuilder.build.

val set_has_mipmap : t -> bool -> unit

Sets whether the texture has a mipmap. This allows the renderer and other users of the generated texture to use a higher quality downscaling.

Typically, the `glGenerateMipmap` function is used to generate a mimap.

val set_format : t -> Gdk_enums.memoryformat -> unit

Sets the format of the texture. The default is `GDK_MEMORY_R8G8B8A8_PREMULTIPLIED`.

The format is the preferred format the texture data should be downloaded to. The format must be supported by the GL version of property@Gdk.GLTextureBuilder:context.

GDK's texture download code assumes that the format corresponds to the storage parameters of the GL texture in an obvious way. For example, a format of `GDK_MEMORY_R16G16B16A16_PREMULTIPLIED` is expected to be stored as `GL_RGBA16` texture, and `GDK_MEMORY_G8A8` is expected to be stored as `GL_RG8` texture.

Setting the right format is particularly useful when using high bit depth textures to preserve the bit depth, to set the correct value for unpremultiplied textures and to make sure opaque textures are treated as such.

Non-RGBA textures need to have swizzling parameters set up properly to be usable in GSK's shaders.

val set_context : t -> [ `gl_context | `draw_context | `object_ ] Gobject.obj option -> unit

Sets the context to be used for the texture. This is the context that owns the texture.

The context must be set before calling method@Gdk.GLTextureBuilder.build.

val get_width : t -> int

Gets the width previously set via gdk_gl_texture_builder_set_width() or 0 if the width wasn't set.

val get_update_texture : t -> [ `texture | `object_ ] Gobject.obj option

Gets the texture previously set via gdk_gl_texture_builder_set_update_texture() or %NULL if none was set.

val get_update_region : t -> Ocgtk_cairo.Cairo.Wrappers.Region.t option

Gets the region previously set via gdk_gl_texture_builder_set_update_region() or %NULL if none was set.

val get_id : t -> int

Gets the texture id previously set via gdk_gl_texture_builder_set_id() or 0 if the id wasn't set.

val get_height : t -> int

Gets the height previously set via gdk_gl_texture_builder_set_height() or 0 if the height wasn't set.

val get_has_mipmap : t -> bool

Gets whether the texture has a mipmap.

val get_format : t -> Gdk_enums.memoryformat

Gets the format previously set via gdk_gl_texture_builder_set_format().

val get_context : t -> [ `gl_context | `draw_context | `object_ ] Gobject.obj option

Gets the context previously set via gdk_gl_texture_builder_set_context() or %NULL if none was set.