[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

glBitmap Subroutine

Purpose

Draws a bitmap.

Library

OpenGL C bindings library: libGL.a

C Syntax

void glBitmap(GLsizei Width, 
      GLsizei Height,
      GLfloat xOrigin, 
      GLfloat yOrigin, 
      GLfloat xMove,
      GLfloat yMove, 
      const GLubyte *Bitmap)

Parameters

Width Specifies the pixel width of the bitmap image.
Height Specifies the pixel height of the bitmap image.
xOrigin Specifies the location of the x origin in the bitmap image. The x origin is measured from the lower left corner of the bitmap, with right and up being the positive axes.
yOrigin Specifies the location of the y origin in the bitmap image. The y origin is measured from the lower left corner of the bitmap, with right and up being the positive axes.
xMove Specifies the x offset to be added to the current raster position after the bitmap is drawn.
yMove Specifies the y offset to be added to the current raster position after the bitmap is drawn.
Bitmap Specifies the address of the bitmap image.

Description

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.

The glBitmap subroutine takes seven arguments. The first pair of arguments specify the width and height of the bitmap image. The second pair of arguments specify the location of the bitmap origin relative to the lower left corner of the bitmap image. The final pair of arguments specify 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.

The bitmap image is interpreted like image data for the glDrawPixels subroutine, with Width and Height corresponding to the width and height arguments of that subroutine, and with Type set to GL_BITMAP and Format set to GL_COLOR_INDEX. Modes specified using the glPixelStore subroutine affect the interpretation of bitmap image data; modes specified using the glPixelTransfer subroutine do not.

If the current raster position is not valid, the glBitmap subroutine is ignored. Otherwise, the lower left corner of the bitmap image is positioned at the following window coordinates:

xw =  [xr - xo]
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 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, index, or texture coordinates.

Errors

GL_INVALID_VALUE Either Width or Height is negative.
GL_INVALID_OPERATION The glBitmap subroutine is called between a call to glBegin and the corresponding call to glEnd.

Associated Gets

Associated gets for the glBitmap subroutine are as follows. (See the glGet subroutine for more information.)

glGet with argument GL_CURRENT_RASTER_POSITION

glGet with argument GL_CURRENT_RASTER_COLOR

glGet with argument GL_CURRENT_RASTER_INDEX

glGet with argument GL_CURRENT_RASTER_TEXTURE_COORDS

glGet with argument GL_CURRENT_RASTER_POSITION_VALID.

Files

/usr/include/GL/gl.h
Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL.

Related Information

The glBegin or glEnd subroutine, glDrawPixels subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glRasterPos subroutine.

OpenGL Overview.


[ Previous | Next | Contents | Glossary | Home | Search ]