TextureRectangle.with_size


Description:

public TextureRectangle.with_size (Context ctx, int width, int height)

Creates a new TextureRectangle texture with a given width, and height.

This texture is a low-level texture that the GPU can sample from directly unlike high-level textures such as Texture2DSliced and AtlasTexture.

<note>Unlike for Texture2D textures, coordinates for TextureRectangle textures should not be normalized. So instead of using the coordinate (1, 1) to sample the bottom right corner of a rectangle texture you would use (width, height) where width and height are the width and height of the texture.</note>

<note>If you want to sample from a rectangle texture from GLSL you should use the sampler2DRect sampler type.</note>

<note>Applications wanting to use TextureRectangle should first check for the cogl_feature_id_texture_rectangle feature using has_feature.</note>

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 going to be used and can optimize how it is allocated.

Parameters:

ctx

A Context pointer

width

The texture width to allocate

height

The texture height to allocate

Returns:

A pointer to a new TextureRectangle object with no storage allocated yet.