gl.Bitmap(xorig, yorig, xmove, ymove[, bitmapArray])
gl.Bitmap()
takes up to five arguments. The first pair specifies the location of the bitmap origin relative
to the lower left corner of the bitmap image. The second pair of arguments specifies x and y offsets to be
added to the current raster position after the bitmap has been drawn. The final argument is a table containing
pixel data of the bitmap image itself.
The bitmap image is interpreted like image data for the gl.DrawPixels() command, with
the bitmap's width and height corresponding to the width and height arguments of that command, and with type
set to GL_BITMAP
and format set to GL_COLOR_INDEX
. Modes specified using gl.PixelStore()
affect the interpretation of bitmap image data; modes specified using gl.PixelTransfer() do not.
If the current raster position is invalid, gl.Bitmap()
is ignored. Otherwise, the lower left corner of the
bitmap image is positioned at the window coordinates xw = xr - xo and yw = yr - yo where (xr,yr) is the raster
position and (xo,yo) is the bitmap origin. Fragments are then generated for each pixel corresponding to a 1 (one)
in the bitmap image. These fragments are generated using the current raster z coordinate, color or color index,
and current raster texture coordinates. They are then treated just as if they had been generated by a point, line,
or polygon, including texture mapping, fogging, and all per-fragment operations such as alpha and depth testing.
After the bitmap has been drawn, the x and y coordinates of the current raster position are offset by xmove
and ymove
.
No change is made to the z coordinate of the current raster position, or to the current raster color, texture coordinates, or index.
To set a valid raster position outside the viewport, first set a valid raster position inside the viewport, then call
gl.Bitmap()
without the bitmap parameter and with xmove
and ymove
set to the offsets of the new raster position.
This technique is useful when panning an image around the viewport.
Please consult an OpenGL reference manual for more information.
#GL_INVALID_OPERATION
is generated if glBitmap is executed between the execution of gl.Begin() and the corresponding execution of gl.End()
#GL_CURRENT_RASTER_POSITION
gl.Get() with argument #GL_CURRENT_RASTER_COLOR
gl.Get() with argument #GL_CURRENT_RASTER_SECONDARY_COLOR
gl.Get() with argument #GL_CURRENT_RASTER_DISTANCE
gl.Get() with argument #GL_CURRENT_RASTER_INDEX
gl.Get() with argument #GL_CURRENT_RASTER_TEXTURE_COORDS
gl.Get() with argument #GL_CURRENT_RASTER_POSITION_VALID