draw a bitmap
glBitmap( GLsizei ( width ) , GLsizei ( height ) , GLfloat ( xorig ) , GLfloat ( yorig ) , GLfloat ( xmove ) , GLfloat ( ymove ) , const GLubyte * ( bitmap ) )-> void
A bitmap is a binary image. When drawn, the bitmap is positioned relative to the current raster position, and frame buffer pixels corresponding to 1's in the bitmap are written using the current raster color or index. Frame buffer pixels corresponding to 0's in the bitmap are not modified.
glBitmap takes seven arguments. The first pair specifies the width and height of the bitmap image. The second pair specifies the location of the bitmap origin relative to the lower left corner of the bitmap image. The third 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 pointer to the bitmap image itself.
If a non-zero named buffer object is bound to the GL_PIXEL_UNPACK_BUFFER target (see glBindBuffer ) while a bitmap image is specified, bitmap is treated as a byte offset into the buffer object's data store.
The bitmap image is interpreted like image data for the glDrawPixels command, with 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 glPixelStore affect the interpretation of bitmap image data; modes specified using glPixelTransfer do not.
If the current raster position is invalid, glBitmap is ignored. Otherwise, the lower left corner of the bitmap image is positioned at the window coordinates
where is the raster position and 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.
To set a valid raster position outside the viewport, first set a valid raster position inside the viewport, then call glBitmap with NULL as 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.
GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to the GL_PIXEL_UNPACK_BUFFER target and the buffer object's data store is currently mapped.
GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to the GL_PIXEL_UNPACK_BUFFER target and the data would be unpacked from the buffer object such that the memory reads required would exceed the data store size.
glGet with argument GL_CURRENT_RASTER_POSITION
glGet with argument GL_CURRENT_RASTER_COLOR
glGet with argument GL_CURRENT_RASTER_SECONDARY_COLOR
glGet with argument GL_CURRENT_RASTER_DISTANCE
glGet with argument GL_CURRENT_RASTER_INDEX
glGet with argument GL_CURRENT_RASTER_TEXTURE_COORDS
glGet with argument GL_CURRENT_RASTER_POSITION_VALID
glGet with argument GL_PIXEL_UNPACK_BUFFER_BINDING
Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/ .
Sample Code References
The following code samples have been found which appear to reference the functions described here. Take care that the code may be old, broken or not even use PyOpenGL.
OpenGLContext tests/getteximage.py Lines: 33
OpenGLContext OpenGLContext/scenegraph/text/glutfont.py Lines: 40
OpenGLContext OpenGLContext/scenegraph/text/font.py Lines: 336, 344, 351, 356, 359, 366, 370, 372
OpenGLContext OpenGLContext/scenegraph/text/pygamefont.py Lines: 73
OpenGLContext OpenGLContext/scenegraph/text/wxfont.py Lines: 103
OpenGL-Demo PyOpenGL-Demo/redbook/drawf.py Lines: 83, 84, 85