Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GLTextureBuilder

[20:7] extends: object

Constructs [class@Gdk.Texture] objects from GL textures. The operation is quite simple: Create a texture builder, set all the necessary properties - keep in mind that the properties [property@Gdk.GLTextureBuilder:context], [property@Gdk.GLTextureBuilder:id], [property@Gdk.GLTextureBuilder:width], and [property@Gdk.GLTextureBuilder:height] are mandatory - and then call [method@Gdk.GLTextureBuilder.build] to create the new texture. GdkGLTextureBuilder can be used for quick one-shot construction of textures as well as kept around and reused to construct multiple textures.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GLTextureBuilder ()

    Creates a new texture builder.

  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asObject ()

    Wraps this handle as Object.

    • @r A Object object.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setColorstate (object Value)

    The color state of the texture.

    • @p Value is the new property value.
    • @r None.
  • setContext (object Value)

    The context owning the texture.

    • @p Value is the new property value.
    • @r None.
  • setFormat (string Value)

    The format when downloading the texture.

    • @p Value is the new property value.
    • @r None.
  • setHasmipmap (bool Value)

    If the texture has a mipmap.

    • @p Value is the new property value.
    • @r None.
  • setHeight (int Value)

    The height of the texture.

    • @p Value is the new property value.
    • @r None.
  • setId (int Value)

    The texture ID to use.

    • @p Value is the new property value.
    • @r None.
  • setSync (Value)

    An optional GLSync object. If this is set, GTK will wait on it before using the texture.

    • @p Value is the new property value.
    • @r None.
  • setUpdateregion (object Value)

    The update region for [property@Gdk.GLTextureBuilder:update-texture].

    • @p Value is the new property value.
    • @r None.
  • setUpdatetexture (object Value)

    The texture [property@Gdk.GLTextureBuilder:update-region] is an update for.

    • @p Value is the new property value.
    • @r None.
  • setWidth (int Value)

    The width of the texture.

    • @p Value is the new property value.
    • @r None.
  • get_color_state ()

    Gets the color state previously set via gdk_gl_texture_builder_set_color_state().

  • get_context ()

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

  • get_format ()

    Gets the format previously set via gdk_gl_texture_builder_set_format().

  • get_has_mipmap ()

    Gets whether the texture has a mipmap.

  • get_height ()

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

  • get_id ()

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

  • get_sync ()

    Gets the GLsync previously set via gdk_gl_texture_builder_set_sync().

  • get_update_region ()

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

  • get_update_texture ()

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

  • get_width ()

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

  • set_color_state (object color_state)

    Sets the color state for the texture. By default, the sRGB colorstate is used. If you don't know what colorstates are, this is probably the right thing.

    • @p color_state is a GdkColorState.
    • @r None.
  • set_context (object context)

    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].

    • @p context is The context the texture belongs to or %NULL to unset.
    • @r None.
  • set_format (string format)

    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.

    • @p format is The texture's format.
    • @r None.
  • set_has_mipmap (bool has_mipmap)

    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.

    • @p has_mipmap is Whether the texture has a mipmap.
    • @r None.
  • set_height (int height)

    Sets the height of the texture. The height must be set before calling [method@Gdk.GLTextureBuilder.build].

    • @p height is The texture's height or 0 to unset.
    • @r None.
  • set_id (int id)

    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].

    • @p id is The texture id to be used for creating the texture.
    • @r None.
  • set_sync (sync)

    Sets the GLSync object to use for the texture. GTK will wait on this object before using the created GdkTexture. The destroy function that is passed to [method@Gdk.GLTextureBuilder.build] is responsible for freeing the sync object when it is no longer needed. The texture builder does not destroy it and it is the callers responsibility to make sure it doesn't leak.

    • @p sync is the GLSync object.
    • @r None.
  • set_update_region (object region)

    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.

    • @p region is the region to update.
    • @r None.
  • set_update_texture (object texture)

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

    • @p texture is the texture to update.
    • @r None.
  • set_width (int width)

    Sets the width of the texture. The width must be set before calling [method@Gdk.GLTextureBuilder.build].

    • @p width is The texture's width or 0 to unset.
    • @r None.

class: GLTextureBuilderMeta

[494:14] static extends: object

Generated metadata helpers for GLTextureBuilder class surfaces.

Methods

  • properties ()

    Returns property metadata for GLTextureBuilder.

    • @r A list.