Previous: glViewport Table of Contents (GL) Next: glXChooseFBConfig

glWindowPos

specify the raster position in window coordinates for pixel operations

Deprecation Notice

Note that this function has been marked deprecated in the OpenGL 3.0 specification. You should not be using this function in new code, though it will likely be supported by most implementations via the GL_ARB_compatibility extension. For more information on OpenGL 3.x deprecations, see the deprecations page.

Signature

glWindowPos( )->
glWindowPos2d( GLdouble ( x ) , GLdouble ( y ) )-> void
glWindowPos2d( x , y )
glWindowPos2d(GLdouble(x), GLdouble(y)) -> None
glWindowPos2dv( const GLdouble * ( v ) )-> void
glWindowPos2dv( v )
glWindowPos2dv(GLdoubleArray(v)) -> None
glWindowPos2f( GLfloat ( x ) , GLfloat ( y ) )-> void
glWindowPos2f( x , y )
glWindowPos2f(GLfloat(x), GLfloat(y)) -> None
glWindowPos2fv( const GLfloat * ( v ) )-> void
glWindowPos2fv( v )
glWindowPos2fv(GLfloatArray(v)) -> None
glWindowPos2i( GLint ( x ) , GLint ( y ) )-> void
glWindowPos2i( x , y )
glWindowPos2i(GLint(x), GLint(y)) -> None
glWindowPos2iv( const GLint * ( v ) )-> void
glWindowPos2iv( v )
glWindowPos2iv(GLintArray(v)) -> None
glWindowPos2s( GLshort ( x ) , GLshort ( y ) )-> void
glWindowPos2s( x , y )
glWindowPos2s(GLshort(x), GLshort(y)) -> None
glWindowPos2sv( const GLshort * ( v ) )-> void
glWindowPos2sv( v )
glWindowPos2sv(GLshortArray(v)) -> None
glWindowPos3d( GLdouble ( x ) , GLdouble ( y ) , GLdouble ( z ) )-> void
glWindowPos3d( x , y , z )
glWindowPos3d(GLdouble(x), GLdouble(y), GLdouble(z)) -> None
glWindowPos3dv( const GLdouble * ( v ) )-> void
glWindowPos3dv( v )
glWindowPos3dv(GLdoubleArray(v)) -> None
glWindowPos3f( GLfloat ( x ) , GLfloat ( y ) , GLfloat ( z ) )-> void
glWindowPos3f( x , y , z )
glWindowPos3f(GLfloat(x), GLfloat(y), GLfloat(z)) -> None
glWindowPos3fv( const GLfloat * ( v ) )-> void
glWindowPos3fv( v )
glWindowPos3fv(GLfloatArray(v)) -> None
glWindowPos3i( GLint ( x ) , GLint ( y ) , GLint ( z ) )-> void
glWindowPos3i( x , y , z )
glWindowPos3i(GLint(x), GLint(y), GLint(z)) -> None
glWindowPos3iv( const GLint * ( v ) )-> void
glWindowPos3iv( v )
glWindowPos3iv(GLintArray(v)) -> None
glWindowPos3s( GLshort ( x ) , GLshort ( y ) , GLshort ( z ) )-> void
glWindowPos3s( x , y , z )
glWindowPos3s(GLshort(x), GLshort(y), GLshort(z)) -> None
glWindowPos3sv( const GLshort * ( v ) )-> void
glWindowPos3sv( v )
glWindowPos3sv(GLshortArray(v)) -> None

Parameters

VariablesDescription
x, y, z
Specify the x , y , z coordinates for the raster position.

Parameters

v
Specifies a pointer to an array of two or three elements, specifying x , y , z coordinates, respectively.

Description

The GL maintains a 3D position in window coordinates. This position, called the raster position, is used to position pixel and bitmap write operations. It is maintained with subpixel accuracy. See glBitmap , glDrawPixels , and glCopyPixels .
glWindowPos2 specifies the x and y coordinates, while z is implicitly set to 0. glWindowPos3 specifies all three coordinates. The w coordinate of the current raster position is always set to 1.0.
glWindowPos directly updates the x and y coordinates of the current raster position with the values specified. That is, the values are neither transformed by the current modelview and projection matrices, nor by the viewport-to-window transform. The z coordinate of the current raster position is updated in the following manner:
z = n f n + z f - n if z <= 0 if z >= 1 otherwise
where n is GL_DEPTH_RANGE 's near value, and f is GL_DEPTH_RANGE 's far value. See glDepthRange .
The specified coordinates are not clip-tested, causing the raster position to always be valid.
The current raster position also includes some associated color data and texture coordinates. If lighting is enabled, then GL_CURRENT_RASTER_COLOR (in RGBA mode) or GL_CURRENT_RASTER_INDEX (in color index mode) is set to the color produced by the lighting calculation (see glLight , glLightModel , and glShadeModel ). If lighting is disabled, current color (in RGBA mode, state variable GL_CURRENT_COLOR ) or color index (in color index mode, state variable GL_CURRENT_INDEX ) is used to update the current raster color. GL_CURRENT_RASTER_SECONDARY_COLOR (in RGBA mode) is likewise updated.
Likewise, GL_CURRENT_RASTER_TEXTURE_COORDS is updated as a function of GL_CURRENT_TEXTURE_COORDS , based on the texture matrix and the texture generation functions (see glTexGen ). The GL_CURRENT_RASTER_DISTANCE is set to the GL_CURRENT_FOG_COORD .

Notes

glWindowPos is available only if the GL version is 1.4 or greater.
The raster position is modified by glRasterPos , glBitmap , and glWindowPos .
Calling glDrawElements , or glDrawRangeElements may leave the current color or index indeterminate. If glWindowPos is executed while the current color or index is indeterminate, the current raster color or current raster index remains indeterminate.
There are distinct raster texture coordinates for each texture unit. Each texture unit's current raster texture coordinates are updated by glWindowPos .

Errors

GL_INVALID_OPERATION is generated if glWindowPos is executed between the execution of glBegin and the corresponding execution of glEnd .

Associated Gets

glGet with argument GL_CURRENT_RASTER_POSITION
glGet with argument GL_CURRENT_RASTER_POSITION_VALID
glGet with argument GL_CURRENT_RASTER_DISTANCE
glGet with argument GL_CURRENT_RASTER_COLOR
glGet with argument GL_CURRENT_RASTER_SECONDARY_COLOR
glGet with argument GL_CURRENT_RASTER_INDEX
glGet with argument GL_CURRENT_RASTER_TEXTURE_COORDS

See Also

Previous: glViewport Table of Contents (GL) Next: glXChooseFBConfig