Cogl.Framebuffer.prototype.draw_textured_rectangle

function draw_textured_rectangle(pipeline: Cogl.Pipeline, x_1: Number(gfloat), y_1: Number(gfloat), x_2: Number(gfloat), y_2: Number(gfloat), s_1: Number(gfloat), t_1: Number(gfloat), s_2: Number(gfloat), t_2: Number(gfloat)): void {
    // Gjs wrapper for cogl_framebuffer_draw_textured_rectangle()
}
  

Draws a textured rectangle to framebuffer using the given pipeline state with the top left corner positioned at (x_1, y_1) and the bottom right corner positioned at (x_2, y_2). The top left corner will have texture coordinates of (s_1, t_1) and the bottom right corner will have texture coordinates of (s_2, t_2).

<note>The position is the position before the rectangle has been transformed by the model-view matrix and the projection matrix.</note>

This is a high level drawing api that can handle any kind of Cogl.MetaTexture texture such as Cogl.Texture2DSliced textures which may internally be comprised of multiple low-level textures. This is unlike low-level drawing apis such as Cogl.Primitive.prototype.draw which only support low level texture types that are directly supported by GPUs such as Cogl.Texture2D.

<note>The given texture coordinates will only be used for the first texture layer of the pipeline and if your pipeline has more than one layer then all other layers will have default texture coordinates of s_1=0.0 t_1=0.0 s_2=1.0 t_2=1.0 </note>

The given texture coordinates should always be normalized such that (0, 0) corresponds to the top left and (1, 1) corresponds to the bottom right. To map an entire texture across the rectangle pass in s_1=0, t_1=0, s_2=1, t_2=1.

<note>Even if you have associated a Cogl.TextureRectangle texture with one of your pipeline layers which normally implies working with non-normalized texture coordinates this api should still be passed normalized texture coordinates.</note>

Since 1.10

pipeline

A Cogl.Pipeline state object

x_1

x coordinate upper left on screen.

y_1

y coordinate upper left on screen.

x_2

x coordinate lower right on screen.

y_2

y coordinate lower right on screen.

s_1

S texture coordinate of the top-left coorner

t_1

T texture coordinate of the top-left coorner

s_2

S texture coordinate of the bottom-right coorner

t_2

T texture coordinate of the bottom-right coorner