Allocates a new TextureRectangle texture which will be initialized with the pixel
data from bitmap
.
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.
bitmap |
A Bitmap |
A pointer to a new TextureRectangle texture. |