Constructor
CoglTexture2Dnew_from_data
Declaration [src]
CoglTexture2D*
cogl_texture_2d_new_from_data (
CoglContext* ctx,
int width,
int height,
CoglPixelFormat format,
int rowstride,
const uint8_t* data,
GError** error
)
Description [src]
Creates a low-level CoglTexture2D
texture based on data residing
in memory.
data
pointer does
not need to remain valid once this function returns. This means it
is not possible to configure the texture before it is allocated. If
you do need to configure the texture before allocation (to specify
constraints on the internal format for example) then you can
instead create a CoglBitmap
for your data and use
cogl_texture_2d_new_from_bitmap()
or use
cogl_texture_2d_new_with_size()
and then upload data using
cogl_texture_set_data()
Available since: | 2.0 |
Parameters
ctx |
CoglContext |
A |
|
The data is owned by the caller of the function. | |
width |
int |
Width of texture in pixels. |
|
height |
int |
Height of texture in pixels. |
|
format |
CoglPixelFormat |
The |
|
rowstride |
int |
The memory offset in bytes between the starts of
scanlines in |
|
data |
const uint8_t* |
Pointer the memory region where the source buffer resides. |
|
The data is owned by the caller of the function. | |
error |
GError ** |
The return location for a GError* , or NULL . |
Return value
Returns: | CoglTexture2D |
A newly allocated |
|
The caller of the function takes ownership of the data, and is responsible for freeing it. |