Cogl 2.0 Reference Manual | ||||
---|---|---|---|---|
Top | Description |
void cogl_rectangle (float x_1
,float y_1
,float x_2
,float y_2
); void cogl_rectangles (const float *verts
,unsigned int n_rects
); void cogl_rectangle_with_texture_coords (float x1
,float y1
,float x2
,float y2
,float tx1
,float ty1
,float tx2
,float ty2
); void cogl_rectangles_with_texture_coords (const float *verts
,unsigned int n_rects
); void cogl_rectangle_with_multitexture_coords (float x1
,float y1
,float x2
,float y2
,const float *tex_coords
,int tex_coords_len
);
void cogl_rectangle (float x_1
,float y_1
,float x_2
,float y_2
);
Fills a rectangle at the given coordinates with the current source material
|
X coordinate of the top-left corner |
|
Y coordinate of the top-left corner |
|
X coordinate of the bottom-right corner |
|
Y coordinate of the bottom-right corner |
void cogl_rectangles (const float *verts
,unsigned int n_rects
);
Draws a series of rectangles in the same way that
cogl_rectangle()
does. In some situations it can give a
significant performance boost to use this function rather than
calling cogl_rectangle()
separately for each rectangle.
verts
should point to an array of floats with
n_rects
* 4 elements. Each group of 4 values corresponds to the
parameters x1, y1, x2, and y2, and have the same
meaning as in cogl_rectangle()
.
|
an array of vertices. [in][array][transfer none] |
|
number of rectangles to draw |
Since 1.0
void cogl_rectangle_with_texture_coords (float x1
,float y1
,float x2
,float y2
,float tx1
,float ty1
,float tx2
,float ty2
);
Draw a rectangle using the current material and supply texture coordinates
to be used for the first texture layer of the material. To draw the entire
texture pass in tx1
=0.0 ty1
=0.0 tx2
=1.0 ty2
=1.0.
|
x coordinate upper left on screen. |
|
y coordinate upper left on screen. |
|
x coordinate lower right on screen. |
|
y coordinate lower right on screen. |
|
x part of texture coordinate to use for upper left pixel |
|
y part of texture coordinate to use for upper left pixel |
|
x part of texture coordinate to use for lower right pixel |
|
y part of texture coordinate to use for left pixel |
Since 1.0
void cogl_rectangles_with_texture_coords (const float *verts
,unsigned int n_rects
);
Draws a series of rectangles in the same way that
cogl_rectangle_with_texture_coords()
does. In some situations it can give a
significant performance boost to use this function rather than
calling cogl_rectangle_with_texture_coords()
separately for each rectangle.
verts
should point to an array of floats with
n_rects
* 8 elements. Each group of 8 values corresponds to the
parameters x1, y1, x2, y2, tx1, ty1, tx2 and ty2 and have the same
meaning as in cogl_rectangle_with_texture_coords()
.
|
an array of vertices. [in][array][transfer none] |
|
number of rectangles to draw |
Since 0.8.6
void cogl_rectangle_with_multitexture_coords (float x1
,float y1
,float x2
,float y2
,const float *tex_coords
,int tex_coords_len
);
This function draws a rectangle using the current source material to texture or fill with. As a material may contain multiple texture layers this interface lets you supply texture coordinates for each layer of the material.
The first pair of coordinates are for the first layer (with the smallest layer index) and if you supply less texture coordinates than there are layers in the current source material then default texture coordinates (0.0, 0.0, 1.0, 1.0) are generated.
|
x coordinate upper left on screen. |
|
y coordinate upper left on screen. |
|
x coordinate lower right on screen. |
|
y coordinate lower right on screen. |
|
An array containing groups of 4 float values: [tx1, ty1, tx2, ty2] that are interpreted as two texture coordinates; one for the upper left texel, and one for the lower right texel. Each value should be between 0.0 and 1.0, where the coordinate (0.0, 0.0) represents the top left of the texture, and (1.0, 1.0) the bottom right. [in][array][transfer none] |
|
The length of the tex_coords array. (e.g. for one layer and one group of texture coordinates, this would be 4) |
Since 1.0