Texture2D.from_bitmap


Description:

public Texture2D.from_bitmap (Bitmap bitmap)

Creates a low-level Texture2D texture based on data residing in a Bitmap.

The storage for the texture is not allocated before this function returns. You can call allocate to explicitly allocate the underlying storage or preferably let Cogl automatically allocate storage lazily when it may know more about how the texture is being used and can optimize how it is allocated.

The texture is still configurable until it has been allocated so for example you can influence the internal format of the texture using set_components and set_premultiplied.

<note>Many GPUs only support power of two sizes for Texture2D textures. You can check support for non power of two textures by checking for the cogl_feature_id_texture_npot feature via has_feature.</note>

Parameters:

bitmap

A Bitmap

Returns:

A newly allocated Texture2D