Cogl.Texture3D.new_from_bitmap
function new_from_bitmap(bitmap: Cogl.Bitmap, height: Number(gint), depth: Number(gint)): Cogl.Texture3D { // Gjs wrapper for cogl_texture_3d_new_from_bitmap() }
Creates a low-level 3D texture and initializes it with the images in bitmap. The images are assumed to be packed together after one another in the increasing y axis. The height of individual image is given as height and the number of images is given in depth. The actual height of the bitmap can be larger than height × depth. In this case it assumes there is padding between the images.
The storage for the texture is not allocated before this function returns. You can call Cogl.Texture.prototype.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.
The texture is still configurable until it has been allocated so for example you can influence the internal format of the texture using Cogl.Texture.prototype.set_components and Cogl.Texture.prototype.set_premultiplied.
<note>This texture will fail to allocate later if Cogl.FeatureID.ogl_feature_id_texture_3d is not advertised. Allocation can also fail if the requested dimensions are not supported by the GPU.</note>
Since 2.0
- bitmap
A Cogl.Bitmap object.
- height
height of the texture in pixels.
- depth
depth of the texture in pixels.
- Returns
a newly created Cogl.Texture3D