Signature
Parameters
Description
glDrawTexOES
draws a texture rectangle to the screen.
z
is mapped to window depth Zw as follows:
If
If
Otherwise
width
and
height
specify the width and height of the affected screen rectangle in pixels.
These values may be positive or negative;
however if either of these are negative, nothing is drawn.
Calling one of the DrawTex functions generates a
fragment for each pixel that overlaps the screen
rectangle bounded by (
x
,
y
)
and (
x
+
width
),
(
y
+
height
).
For each generated fragment, the depth is given by
Zw
as defined above, and the color by the current color.
Texture coordinates for each texture unit are computed as follows:
Let
X
and
Y
be the screen x and y coordinates of each sample point associated with the fragment.
Let
Wt
and
Ht
be the width and height in texels of the texture
currently bound to the texture unit.
(If the texture is a mipmap, let
Wt
and
Ht
be the dimensions of the level specified by
GL_TEXTURE_BASE_LEVEL
).
Let
Ucr
,
Vcr
,
Wcr
and
Hcr
be (respectively) the four integers that make up the
texture crop rectangle parameter for the currently bound texture.
The fragment texture coordinates
(
s
,
t
,
r
,
q
)
are given by:
Notes
In the specific case where
X
,
Y
,
x
and
y
are all integers,
Wcr
/
width
and
Hcr
/
height
are both equal to one, the base level is used for the texture read,
and fragments are sampled at pixel centers,
implementations are required to ensure that the resulting u, v texture
indices are also integers.
This results in a one-to-one mapping of texels to fragments.
Note that
Wcr
and/or
Hcr
can be negative.
The formulas given above for
s
and
t
still apply in this case.
The result is that if
Wcr
is negative, the source rectangle
for
glDrawTexOES
operations lies to the left of the reference
point (
Ucr
,
Vcr
)
rather than to the right of it,
and appears right-to-left reversed on the screen after a
call to DrawTex.
Similarly, if
Hcr
is negative,
the source rectangle lies below the reference point
(
Ucr
,
Vcr
)
rather than above it, and appears upside-down on the screen.
Note also that
s
,
t
,
r
, and
q
are computed for each fragment as part of
glDrawTexOES
rendering. This implies
that the texture matrix is ignored and has no effect on
the rendered result.
glDrawTexOES
is available only if
the
GL_OES_draw_texture
extension is supported
by your implementation.
See Also
Copyright
Copyright
2003-2004
Silicon Graphics, Inc. This document is licensed under the SGI
Free Software B License. For details, see
http://oss.sgi.com/projects/FreeB/
.